aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2022-09-02 11:13:43 -0400
committerGopher Robot <gobot@golang.org>2022-09-28 20:37:59 +0000
commitf1d281fe4d6177349032776c22ab6dfb8533f0eb (patch)
tree7fdfe64648cc9efbad93f74a67414be6f83953d7 /api
parentdbf174d4b9dd96b225a1f10089478f8257a54f80 (diff)
downloadgo-f1d281fe4d6177349032776c22ab6dfb8533f0eb.tar.xz
go/ast: record start and end of file in File.File{Start,End}
This change causes the parser to record the positions of the first and last character in the file in new ast.File fields FileStart and FileEnd. The behavior of the existing Pos() and End() methods, which record the span of declarations, must remain unchanged for compatibility. Fixes golang/go#53202 Change-Id: I250b19e69f41e3590292c3fe6dea1943ec98f629 Reviewed-on: https://go-review.googlesource.com/c/go/+/427955 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'api')
-rw-r--r--api/next/53202.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/next/53202.txt b/api/next/53202.txt
new file mode 100644
index 0000000000..8dadbfb4e5
--- /dev/null
+++ b/api/next/53202.txt
@@ -0,0 +1,2 @@
+pkg go/ast, type File struct, FileEnd token.Pos #53202
+pkg go/ast, type File struct, FileStart token.Pos #53202