1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:44:45 -07:00
go/test/syntax
Matthew Dempsky 70544c91ff cmd/compile/internal/syntax: match old parser errors and line numbers
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>
2016-08-19 01:10:21 +00:00
..
chan1.go cmd/compile/internal/syntax: match old parser errors and line numbers 2016-08-19 01:10:21 +00:00
chan.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
composite.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
ddd.go cmd/compile: use bufio.Reader directly in lexer 2016-03-11 21:27:23 +00:00
else.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
forvar.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
if.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
import.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
interface.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi1.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi2.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi3.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi4.go cmd/compile/internal/syntax: match old parser errors and line numbers 2016-08-19 01:10:21 +00:00
semi5.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi6.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi7.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
topexpr.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
typesw.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
vareq1.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
vareq.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00