- fixed bug in parser.go - added more tests SVN=126784
diff --git a/usr/gri/gosrc/parser.go b/usr/gri/gosrc/parser.go index 0e025f9..ecf7699 100644 --- a/usr/gri/gosrc/parser.go +++ b/usr/gri/gosrc/parser.go
@@ -592,10 +592,14 @@ P.Trace("IfStat"); P.Expect(Scanner.IF); if P.tok != Scanner.LBRACE { - P.ParseSimpleStat(); + if P.tok != Scanner.SEMICOLON { + P.ParseSimpleStat(); + } if P.tok == Scanner.SEMICOLON { P.Next(); - P.ParseExpression(); + if P.tok != Scanner.LBRACE { + P.ParseExpression(); + } } } P.ParseBlock(); @@ -677,10 +681,14 @@ P.Trace("SwitchStat"); P.Expect(Scanner.SWITCH); if P.tok != Scanner.LBRACE { - P.ParseSimpleStat(); + if P.tok != Scanner.SEMICOLON { + P.ParseSimpleStat(); + } if P.tok == Scanner.SEMICOLON { P.Next(); - P.ParseExpression(); + if P.tok != Scanner.LBRACE { + P.ParseExpression(); + } } } P.Expect(Scanner.LBRACE);