diff --git a/compiler/parser/parser.go b/compiler/parser/parser.go index b8ae4bad..7df8bc33 100644 --- a/compiler/parser/parser.go +++ b/compiler/parser/parser.go @@ -566,7 +566,7 @@ func (p *Parser) parseStmtList() (list []ast.Stmt) { defer un(trace(p, "StatementList")) } - for p.token != token.Case && p.token != token.Default && p.token != token.RBrace && p.token != token.EOF { + for p.token != token.RBrace && p.token != token.EOF { list = append(list, p.parseStmt()) } diff --git a/compiler/parser/sync.go b/compiler/parser/sync.go index 4d08826d..83e5e627 100644 --- a/compiler/parser/sync.go +++ b/compiler/parser/sync.go @@ -8,6 +8,4 @@ var stmtStart = map[token.Token]bool{ token.For: true, token.If: true, token.Return: true, - token.Switch: true, - token.Var: true, } diff --git a/compiler/scanner/scanner_test.go b/compiler/scanner/scanner_test.go index f6028198..5a673692 100644 --- a/compiler/scanner/scanner_test.go +++ b/compiler/scanner/scanner_test.go @@ -110,16 +110,12 @@ func TestScanner_Scan(t *testing.T) { {token.Semicolon, ";"}, {token.Colon, ":"}, {token.Break, "break"}, - {token.Case, "case"}, {token.Continue, "continue"}, - {token.Default, "default"}, {token.Else, "else"}, {token.For, "for"}, {token.Func, "func"}, {token.If, "if"}, {token.Return, "return"}, - {token.Switch, "switch"}, - {token.Var, "var"}, } // combine diff --git a/compiler/token/tokens.go b/compiler/token/tokens.go index 813301f3..210bf82d 100644 --- a/compiler/token/tokens.go +++ b/compiler/token/tokens.go @@ -68,9 +68,7 @@ const ( _operatorEnd _keywordBeg Break - Case Continue - Default Else For Func @@ -78,8 +76,6 @@ const ( Immutable If Return - Switch - Var True False In @@ -145,9 +141,7 @@ var tokens = [...]string{ Colon: ":", Question: "?", Break: "break", - Case: "case", Continue: "continue", - Default: "default", Else: "else", For: "for", Func: "func", @@ -155,8 +149,6 @@ var tokens = [...]string{ Immutable: "immutable", If: "if", Return: "return", - Switch: "switch", - Var: "var", True: "true", False: "false", In: "in",