Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ const (
StringType
BoolType
VoidType
InvalidType
)

var DataStructureMap = map[DataStructure]string{
IntType: "int",
StringType: "string",
BoolType: "bool",
VoidType: "void",
IntType: "int",
StringType: "string",
BoolType: "bool",
VoidType: "void",
InvalidType: "invalid",
}

func (ds DataStructure) String() string {
Expand Down
66 changes: 33 additions & 33 deletions parse/parser_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -2228,7 +2228,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -2262,7 +2262,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -2297,7 +2297,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -2332,7 +2332,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -2428,7 +2428,7 @@ func TestParseAssignStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -2812,7 +2812,7 @@ func TestParseIfStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -2865,7 +2865,7 @@ func TestParseIfStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand All @@ -2878,7 +2878,7 @@ func TestParseIfStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -3018,7 +3018,7 @@ func TestParseBlockStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3057,7 +3057,7 @@ string b = abc`,
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand All @@ -3070,7 +3070,7 @@ string b = abc`,
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -3115,7 +3115,7 @@ bool c = true`,
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand All @@ -3128,7 +3128,7 @@ bool c = true`,
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand All @@ -3141,7 +3141,7 @@ bool c = true`,
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -3231,7 +3231,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3265,7 +3265,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3301,7 +3301,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3333,7 +3333,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3367,7 +3367,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -3399,7 +3399,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -3431,7 +3431,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -3465,7 +3465,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -3497,7 +3497,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -3529,7 +3529,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand Down Expand Up @@ -3639,7 +3639,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3681,7 +3681,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand Down Expand Up @@ -3728,7 +3728,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand All @@ -3741,7 +3741,7 @@ func TestParseStatement(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand Down Expand Up @@ -4140,7 +4140,7 @@ func TestUpdateScopeSymbol(t *testing.T) {
return false
}

if sym.Type() != symbol.IntegerSymbol {
if sym.Type() != symbol.IntegerObject {
return false
}

Expand All @@ -4162,7 +4162,7 @@ func TestUpdateScopeSymbol(t *testing.T) {
return false
}

if sym.Type() != symbol.BooleanSymbol {
if sym.Type() != symbol.BooleanObject {
return false
}

Expand All @@ -4184,7 +4184,7 @@ func TestUpdateScopeSymbol(t *testing.T) {
return false
}

if sym.Type() != symbol.StringSymbol {
if sym.Type() != symbol.StringObject {
return false
}

Expand All @@ -4206,7 +4206,7 @@ func TestUpdateScopeSymbol(t *testing.T) {
return false
}

if sym.Type() != symbol.FunctionSymbol {
if sym.Type() != symbol.FunctionObject {
return false
}

Expand Down
Loading