1
0
mirror of https://github.com/golang/go synced 2024-11-23 08:30:05 -07:00
go/test/syntax
Robert Griesemer f8ae30c4a2 cmd/compile/internal/parser: improved a couple of error messages
The new syntax tree introduced with 1.8 represents send statements
(ch <- x) as statements; the old syntax tree represented them as
expressions (and parsed them as such) but complained if they were
used in expression context. As a consequence, some of the errors
that in the past were of the form "ch <- x used as value" now look
like "unexpected <- ..." because a "<-" is not valid according to
Go syntax in those situations. Accept the new error message.

Also: Fine-tune handling of misformed for loop headers.

Also: Minor cleanups/better comments.

Fixes #17590.

Change-Id: Ia541dea1f2f015c1b21f5b3ae44aacdec60a8aba
Reviewed-on: https://go-review.googlesource.com/37386
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-02-24 18:54:36 +00:00
..
chan1.go cmd/compile/internal/parser: improved a couple of error messages 2017-02-24 18:54:36 +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
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
initvar.go cmd/compile/internal/syntax: generalize error about var decls in init clauses 2017-02-13 23:15:32 +00:00
interface.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi1.go cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header 2017-02-09 03:54:47 +00:00
semi2.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi3.go cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header 2017-02-09 03:54:47 +00:00
semi4.go cmd/compile/internal/parser: improved a couple of error messages 2017-02-24 18:54:36 +00:00
semi5.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
semi6.go cmd/compile/internal/syntax: differentiate between ';' and '\n' in syntax errors 2017-02-09 01:45:17 +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