1
0
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:
Robert Griesemer 2009-06-18 17:04:39 -07:00
parent 05240bb290
commit 5eb5d4d3c0
2 changed files with 3 additions and 1 deletions

View File

@ -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;
}

View File

@ -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 },