]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header
authorRobert Griesemer <gri@golang.org>
Thu, 9 Feb 2017 01:56:41 +0000 (17:56 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 9 Feb 2017 03:54:47 +0000 (03:54 +0000)
commit3c22e5ca271ca4ad17b34d965e6a9baf7b5cf94d
tree4e334b6df478459a3a7e82103af4c364c2f81208
parent7ad512e7ffe576c4894ea84b02e954846fbda643
cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header

Starting the error message with "expecting" rather than "missing"
causes the syntax error mechanism to add additional helpful info
(it recognizes "expecting" but not "missing").

Fixes #17328.

Change-Id: I8482ca5e5a6a6b22e0ed0d831b7328e264156334
Reviewed-on: https://go-review.googlesource.com/36637
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/syntax/parser.go
test/fixedbugs/issue17328.go [new file with mode: 0644]
test/syntax/semi1.go
test/syntax/semi3.go
test/syntax/semi4.go