aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Poliwczak <mpoliwczak34@gmail.com>2026-01-23 11:15:19 +0100
committerMateusz Poliwczak <mpoliwczak34@gmail.com>2026-01-28 22:44:54 -0800
commit2bd7f15dd7423b6817939b199cd2c8032e3b79cc (patch)
tree9e4b309ad565e1f464e3f310afde49c70201afd5
parent74c909b2c57c1bf2d7d347d2f8f266348e2f2581 (diff)
downloadgo-2bd7f15dd7423b6817939b199cd2c8032e3b79cc.tar.xz
go/scanner: document implicit semicolon in multiline comments
Updates #54941 Change-Id: I62406c53b5b27742003098c77cfba0a96a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/738720 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
-rw-r--r--src/go/scanner/scanner.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/go/scanner/scanner.go b/src/go/scanner/scanner.go
index 1e68932e61..9ace335302 100644
--- a/src/go/scanner/scanner.go
+++ b/src/go/scanner/scanner.go
@@ -800,7 +800,9 @@ func (s *Scanner) End() token.Pos {
// If the returned token is [token.SEMICOLON], the corresponding
// literal string is ";" if the semicolon was present in the source,
// and "\n" if the semicolon was inserted because of a newline or
-// at EOF.
+// at EOF. If the newline is within a /*...*/ comment, the SEMICOLON token
+// is synthesized immediately after the COMMENT token; its position is that
+// of the actual newline within the comment.
//
// If the returned token is [token.ILLEGAL], the literal string is the
// offending character.