mirror of
https://github.com/golang/go
synced 2024-11-25 04:37:56 -07:00
go/ast: document invalid raw string literal end position containing carriage returns
Change-Id: If631d4cb32d8f8a15d68924f8fa1d7975c1c919a
This commit is contained in:
parent
1041c2cf01
commit
5ad182c51a
@ -305,6 +305,12 @@ type (
|
|||||||
// first and the last rune in the Value field will be ". The
|
// first and the last rune in the Value field will be ". The
|
||||||
// [strconv.Unquote] and [strconv.UnquoteChar] functions can be
|
// [strconv.Unquote] and [strconv.UnquoteChar] functions can be
|
||||||
// used to unquote STRING and CHAR values, respectively.
|
// used to unquote STRING and CHAR values, respectively.
|
||||||
|
//
|
||||||
|
// For raw string literals (Kind == token.STRING && Value[0] == '`'),
|
||||||
|
// the Value field contains the string text without carriage returns (\r) that
|
||||||
|
// may have been present in the source. Because the end position is
|
||||||
|
// computed using len(Value), the position reported by [BasicLit.End] does not match the
|
||||||
|
// true source end position for raw string literals containing carriage returns.
|
||||||
BasicLit struct {
|
BasicLit struct {
|
||||||
ValuePos token.Pos // literal position
|
ValuePos token.Pos // literal position
|
||||||
Kind token.Token // token.INT, token.FLOAT, token.IMAG, token.CHAR, or token.STRING
|
Kind token.Token // token.INT, token.FLOAT, token.IMAG, token.CHAR, or token.STRING
|
||||||
|
Loading…
Reference in New Issue
Block a user