-
Notifications
You must be signed in to change notification settings - Fork 18k
go/parser: improve recovery when parsing make(map[K]) #23434
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
Comments
Change https://golang.org/cl/87898 mentions this issue: |
Change https://golang.org/cl/87899 mentions this issue: |
Change https://golang.org/cl/87901 mentions this issue: |
Change https://golang.org/cl/88336 mentions this issue: |
R=go1.11 No semantic change. For #23434. Change-Id: Iafdb062b0ebe6cd6e51f9a98b62b1d10f1bacc5c Reviewed-on: https://go-review.googlesource.com/87899 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
R=go1.11. This is just a copy of the fix for #23434: https://go-review.googlesource.com/c/go/+/87898. Test pending test harness for the syntax package. Change-Id: I52409aebe13ec784ddd7e41190a81c7e126bdd0c Reviewed-on: https://go-review.googlesource.com/87901 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
R=go1.11. Now that we have a syntax error test harness, we can add the proper tests for the recent parser fixes. For #20800. For #20789. For #23385. For #23434. A test for #20789 already exists in test/fixedbugs, but this is the better location for that test. But leaving the existing one where it is as well. Change-Id: I5937b9b63bafd1efab467a00344302e717976171 Reviewed-on: https://go-review.googlesource.com/88336 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
The parser's error recovery is poor when it encounters a map type with a missing value type. (I observed that guru lacks information for all declarations downstream of such a mistake.) Here's an example:
https://play.golang.org/p/3XoDcWYw8vK
Notice how the introduction of any token at all before the close paren, even a nonsensical one such as
!
, causes the parser to reduce a CallExpr correctly and continue happily.The text was updated successfully, but these errors were encountered: