summaryrefslogtreecommitdiff
path: root/literals.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-13 20:50:21 +1000
committerAdam Scarr <adam@vektah.net>2017-08-13 20:50:21 +1000
commit1c37779bd46d988c9e7b4bdb846b9daa89856b7c (patch)
treeedef3c6b701c4a25fe2bd1b0f700d15c1949e4fa /literals.go
parent51ad26c781c149c08017ffee2bb4906c9bb39282 (diff)
Use .Token to return from StringLit to avoid convT2E
Diffstat (limited to 'literals.go')
-rw-r--r--literals.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/literals.go b/literals.go
index 00e39f9..260a26e 100644
--- a/literals.go
+++ b/literals.go
@@ -6,7 +6,7 @@ import (
"unicode/utf8"
)
-// StringLit matches a quoted string and returns it in .Result. It may contain:
+// StringLit matches a quoted string and returns it in .Token. It may contain:
// - unicode
// - escaped characters, eg \" or \n
// - unicode sequences, eg \uBEEF
@@ -59,12 +59,12 @@ func StringLit(allowedQuotes string) Parser {
}
case quote:
if buf == nil {
- node.Result = ps.Input[ps.Pos+1 : end]
+ node.Token = ps.Input[ps.Pos+1 : end]
ps.Pos = end + 1
return
}
ps.Pos = end + 1
- node.Result = buf.String()
+ node.Token = buf.String()
return
default:
if buf == nil {