]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: handle pragmas immediately with -newparser=1
authorMatthew Dempsky <mdempsky@google.com>
Tue, 30 Aug 2016 23:31:53 +0000 (16:31 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 31 Aug 2016 19:49:53 +0000 (19:49 +0000)
commitee161e859166b8b8b077998c0101f56c18b18329
tree17a635ddb65aa89801ea24571b0e0d18489338dd
parent69e7e8a696825fa818b70587563ac68e52f8b1a1
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>
src/cmd/compile/internal/gc/lex.go
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/syntax/dumper_test.go
src/cmd/compile/internal/syntax/nodes.go
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/syntax/parser_test.go
src/cmd/compile/internal/syntax/printer_test.go
src/cmd/compile/internal/syntax/scanner.go
src/cmd/compile/internal/syntax/scanner_test.go
src/cmd/compile/internal/syntax/syntax.go