Removed Void as a concept
This commit is contained in:
@@ -365,7 +365,7 @@ type Break struct {
|
||||
}
|
||||
func (*Break) expression(){}
|
||||
func (*Break) statement(){}
|
||||
func (this *Break) Type () Type { return &TypeVoid { } }
|
||||
func (this *Break) Type () Type { return nil }
|
||||
func (this *Break) String () string {
|
||||
if this.Value == nil {
|
||||
return "[break]"
|
||||
@@ -388,7 +388,7 @@ type Return struct {
|
||||
}
|
||||
func (*Return) expression(){}
|
||||
func (*Return) statement(){}
|
||||
func (this *Return) Type () Type { return &TypeVoid { } }
|
||||
func (this *Return) Type () Type { return nil }
|
||||
func (this *Return) String () string {
|
||||
if this.Value == nil {
|
||||
return "[return]"
|
||||
|
||||
@@ -11,15 +11,6 @@ type Type interface {
|
||||
ty ()
|
||||
}
|
||||
|
||||
// TypeVoid represents the absence of a type.
|
||||
type TypeVoid struct { }
|
||||
func (*TypeVoid) ty(){}
|
||||
func (*TypeVoid) Equals (ty Type) bool {
|
||||
_, equals := ty.(*TypeVoid)
|
||||
return equals
|
||||
}
|
||||
func (*TypeVoid) String () string { return "Void" }
|
||||
|
||||
// TypeNamed refers to a user-defined or built in named type.
|
||||
type TypeNamed struct {
|
||||
Pos lexer.Position
|
||||
|
||||
Reference in New Issue
Block a user