Don't add wrapping quotes to string value
This commit is contained in:
parent
b6eceb5dcd
commit
257f3c42a9
|
@ -257,6 +257,7 @@ func lexNumber(l *Lexer) stateFn {
|
||||||
}
|
}
|
||||||
|
|
||||||
func lexString(l *Lexer) stateFn {
|
func lexString(l *Lexer) stateFn {
|
||||||
|
l.ignore()
|
||||||
escaped := false
|
escaped := false
|
||||||
for {
|
for {
|
||||||
switch r := l.next(); r {
|
switch r := l.next(); r {
|
||||||
|
@ -266,7 +267,9 @@ func lexString(l *Lexer) stateFn {
|
||||||
if escaped {
|
if escaped {
|
||||||
escaped = false
|
escaped = false
|
||||||
} else {
|
} else {
|
||||||
|
l.backup() // Going before closing quote
|
||||||
l.emit(String)
|
l.emit(String)
|
||||||
|
l.next() // Skipping closing quote
|
||||||
return lexInitial
|
return lexInitial
|
||||||
}
|
}
|
||||||
case '\n':
|
case '\n':
|
||||||
|
|
Loading…
Reference in New Issue