diff options
| author | Robert Griesemer <gri@golang.org> | 2022-08-17 16:48:07 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@google.com> | 2022-08-18 21:46:39 +0000 |
| commit | 9485d4c1bd871be792d03c29b7902f6ac284ed27 (patch) | |
| tree | 62555aa26887fe9db24148e1727f592b8c76abbe /src/runtime/stack.go | |
| parent | 39ec97da15e9167e7a17746c643f264baae6ce7b (diff) | |
| download | go-9485d4c1bd871be792d03c29b7902f6ac284ed27.tar.xz | |
cmd/compile/internal/syntax: handle missing index like in go/parser
Instead of simply reporting an error but otherwise dropping the
index expression from the parse tree when an index is missing
(as in: x[]), create an index expression with a "bad expression"
as index. This matches the behavior of go/parser and permits the
use of the same test case for both parsers.
(It would be simpler to adjust the go/parser to match the syntax
parser's behavior, but that would break backward-compatibility
of the go/parser.)
Adjust the affected test files.
For #54511.
Change-Id: If7668973794604593e869a24b560da92e100b812
Reviewed-on: https://go-review.googlesource.com/c/go/+/424654
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/runtime/stack.go')
0 files changed, 0 insertions, 0 deletions
