New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing inconsistency between 6g and gofmt #777
Labels
Comments
This is a gofmt (go/parser) bug. A case clause accepts a list of statements, and a labeled statement is a statement (even if the statement is the empty statement). Thanks for reporting this. - gri Owner changed to g...@golang.org. Status changed to Accepted. |
This is a 6g error. Each statement in the statement list of a case clause needs to be terminated by a semicolon. In this case the statement is a labeled statement with an empty statement. It is not followed by a semicolon, and no semicolon is inserted automatically because the last token on the line is a colon ":" (according to the semicolon insertion rules). Both gofmt and gccgo correctly accept the program when the semicolon is present, and refuse it when the semicolon is missing. Owner changed to r...@golang.org. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by jimteeuwen:
Attachments:
The text was updated successfully, but these errors were encountered: