You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
func f() {
switch x {
case 1:
f(1, g()
case 2:
f()
case 3:
f(1, g()
}
}
go tool compile -oldparser /tmp/xx.go: (yacc parser)
/tmp/xx.go:6: syntax error: unexpected semicolon or newline, expecting )
/tmp/xx.go:10: syntax error: unexpected semicolon or newline, expecting )
Note that it successfully got back on track and processed case 2 with no problems. It then found the next syntax error, namely the one in case 3.
go tool compile /tmp/xx.go: (new parser)
/tmp/xx.go:6: syntax error: need trailing comma before newline in argument list
/tmp/xx.go:7: syntax error: unexpected case, expecting expression
/tmp/xx.go:8: syntax error: unexpected f
It never recovers. The one syntax error produces three errors (only one of them real) and misses the later error.
The text was updated successfully, but these errors were encountered:
/tmp/xx.go:
go tool compile -oldparser /tmp/xx.go: (yacc parser)
Note that it successfully got back on track and processed case 2 with no problems. It then found the next syntax error, namely the one in case 3.
go tool compile /tmp/xx.go: (new parser)
It never recovers. The one syntax error produces three errors (only one of them real) and misses the later error.
The text was updated successfully, but these errors were encountered: