mirror of
https://github.com/golang/go
synced 2024-11-18 10:54:40 -07:00
`` strings may span multiple lines
R=rsc DELTA=3 (2 added, 0 deleted, 1 changed) OCL=30511 CL=30513
This commit is contained in:
parent
05240bb290
commit
5eb5d4d3c0
@ -331,7 +331,7 @@ func (S *Scanner) scanRawString(pos token.Position) {
|
||||
for S.ch != '`' {
|
||||
ch := S.ch;
|
||||
S.next();
|
||||
if ch == '\n' || ch < 0 {
|
||||
if ch < 0 {
|
||||
S.error(pos, "string not terminated");
|
||||
break;
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ var tokens = [...]elt{
|
||||
elt{ token.CHAR, "'\\uff16'", literal },
|
||||
elt{ token.CHAR, "'\\U0000ff16'", literal },
|
||||
elt{ token.STRING, "`foobar`", literal },
|
||||
elt{ token.STRING, "`" `foo
|
||||
bar` "`", literal },
|
||||
|
||||
// Operators and delimitors
|
||||
elt{ token.ADD, "+", operator },
|
||||
|
Loading…
Reference in New Issue
Block a user