]> Cypherpunks repositories - gostls13.git/commit
go/parser, go/ast: correctly take into account presence of } in block
authorRobert Griesemer <gri@golang.org>
Tue, 22 Oct 2019 00:01:14 +0000 (17:01 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 28 Oct 2019 20:47:07 +0000 (20:47 +0000)
commit3e457030d9a0b9ed23d9d5b346723c54ccae1a8e
tree2b05e7743a26b313a10ea0872f6bb475dca4afa6
parent9be36ba7b46c71e9b58c71cfb75a890c3ed4e8a3
go/parser, go/ast: correctly take into account presence of } in block

Correctly track whether the closing } of a block (or a function body)
is present or not in the AST and report correct End() positions in
each case.

There are more cases like this but this CL addresses an immediate
issue and sets a precedent for how to fix similar cases if a need
arises.

Fixes #33649.

Change-Id: Id6662ddaac09f3c15f8003edc9275fe2b0c41c78
Reviewed-on: https://go-review.googlesource.com/c/go/+/202581
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/ast/ast.go
src/go/ast/issues_test.go [new file with mode: 0644]
src/go/parser/parser.go