aboutsummaryrefslogtreecommitdiff
path: root/test/switch2.go
AgeCommit message (Collapse)Author
2016-08-19cmd/compile/internal/syntax: match old parser errors and line numbersMatthew Dempsky
This makes a bunch of changes to package syntax to tweak line numbers for AST nodes. For example, short variable declaration statements are now associated with the location of the ":=" token, and function calls are associated with the location of the final ")" token. These help satisfy many unit tests that assume the old parser's behavior. Because many of these changes are questionable, they're guarded behind a new "gcCompat" const to make them easy to identify and revisit in the future. A handful of remaining tests are too difficult to make behave identically. These have been updated to execute with -newparser=0 and comments explaining why they need to be fixed. all.bash now passes with both the old and new parsers. Change-Id: Iab834b71ca8698d39269f261eb5c92a0d55a3bf4 Reviewed-on: https://go-review.googlesource.com/27199 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
2015-11-21cmd/compile: address several more 1.6 TODOs in parserRobert Griesemer
- fix/check location of popdcl calls where questioned - remove unnecessary handling of ... (LDDD) in ntype (couldn't be reached) - inlined and fnret_type and simplified fnres as a consequence - leave handling of ... (LDDD) in arg_list alone (remove TODO) - verify that parser requires a ';' after last statement in a case/default (added test case) Fixes #13243. Change-Id: Iad94b498591a5e85f4cb15bbc01e8e101415560d Reviewed-on: https://go-review.googlesource.com/17155 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Chris Manghane <cmang@golang.org>
2015-11-20cmd/compile: match markdcl and popdcl even in case of errorsRobert Griesemer
Change-Id: I22a8a233bc157fa09cd0283fcd4bc14d90faed70 Reviewed-on: https://go-review.googlesource.com/17066 Reviewed-by: Chris Manghane <cmang@golang.org>