diff options
author | Robert Griesemer <gri@golang.org> | 2015-11-19 16:11:09 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2015-11-20 19:56:27 +0000 |
commit | 64cd86798b32e1259eee39fdf5535f48cb1a7c13 (patch) | |
tree | 9b0c0f0ae5acae5b72febe1e7408137f51a3c448 /test/syntax | |
parent | 7218b79f23186420b7ae5535bb5157923473e63e (diff) | |
download | go-64cd86798b32e1259eee39fdf5535f48cb1a7c13.tar.gz go-64cd86798b32e1259eee39fdf5535f48cb1a7c13.zip |
cmd/compile: better syntax error recovery
Use a combination of follow- and stop-token lists and nesting levels
to better synchronize parser after a syntax error.
Fixes #13319.
Change-Id: I9592e0b5b3ba782fb9f9315fea16163328e204f7
Reviewed-on: https://go-review.googlesource.com/17080
Reviewed-by: Chris Manghane <cmang@golang.org>
Diffstat (limited to 'test/syntax')
-rw-r--r-- | test/syntax/composite.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/syntax/composite.go b/test/syntax/composite.go index 6565334935..722805a273 100644 --- a/test/syntax/composite.go +++ b/test/syntax/composite.go @@ -7,5 +7,5 @@ package main var a = []int{ - 3 // ERROR "need trailing comma before newline in composite literal" + 3 // ERROR "need trailing comma before newline in composite literal|expecting comma or }" } |