go/src/cmd/compile/internal/syntax
Matthew Dempsky ee161e8591 cmd/compile: handle pragmas immediately with -newparser=1
Instead of saving all pragmas and processing them after parsing is
finished, process them immediately during scanning like the current
lexer does.

This is a bit unfortunate because it means we can't use
syntax.ParseFile to concurrently parse files yet, but it fixes how we
report syntax errors in the presence of //line pragmas.

While here, add a bunch more gcCompat entries to syntax/parser.go to
get "go build -toolexec='toolstash -cmp' std cmd" passing. There are
still a few remaining cases only triggered building unit tests, but
this seems like a nice checkpoint.

Change-Id: Iaf3bbcf2849857a460496f31eea228e0c585ce13
Reviewed-on: https://go-review.googlesource.com/28226
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-08-31 19:49:53 +00:00
..
dumper.go cmd/compile/internal/syntax: fast Go syntax trees, initial commit. 2016-08-18 21:33:38 +00:00
dumper_test.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
nodes.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
parser.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
parser_test.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
printer.go cmd/compile/internal/syntax: fast Go syntax trees, initial commit. 2016-08-18 21:33:38 +00:00
printer_test.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
scanner.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
scanner_test.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
source.go cmd/compile/internal/syntax: fast Go syntax trees, initial commit. 2016-08-18 21:33:38 +00:00
syntax.go cmd/compile: handle pragmas immediately with -newparser=1 2016-08-31 19:49:53 +00:00
tokens.go cmd/compile/internal/syntax: fast Go syntax trees, initial commit. 2016-08-18 21:33:38 +00:00