-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
go/parser: redundant error message with unexpected comma #24327
Comments
I’m confused. Your expected output isn’t sufficient (nothing after “found”). Are you saying that it should not say |
yes. |
This is another case of go/parser being behind cmd/compile/internal/syntax in terms of reporting errors to humans.
I'll let @griesemer decide what to do. |
Marking as unplanned. go/parser is likely falling behind the compiler due to the compiler's parser (package syntax) being actively improved whenever we run into unsatisfying error messages. It's fairly time-consuming to back-port those fixes because the parsers don't have the same structure, and small local changes sometimes have unexpected consequences with respect to error handling (hence those changes, even if small, are time-consuming to get right). Ideally, in the long run we should migrate to package syntax. Failing that, one option might be to replace go/parser with the syntax package parser while keeping the same API. That might be not too hard since the syntax trees are reasonably close. |
Change https://golang.org/cl/308612 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
What did you expect to see?
[edit]
What did you see instead?
The text was updated successfully, but these errors were encountered: