lexStringLiteral -> lexQuotedString

master
Jordan Orelli 10 years ago
parent 35b16e6e4f
commit c29ff7de6a

@ -194,7 +194,7 @@ func lexRoot(l *lexer) stateFn {
l.emit(t_object_separator) l.emit(t_object_separator)
return lexRoot return lexRoot
case r == '"', r == '`': case r == '"', r == '`':
return lexStringLiteral(r) return lexQuotedString(r)
case r == '#': case r == '#':
return lexComment return lexComment
case r == '[': case r == '[':
@ -264,7 +264,7 @@ func lexComment(l *lexer) stateFn {
} }
} }
func lexStringLiteral(delim rune) stateFn { func lexQuotedString(delim rune) stateFn {
return func(l *lexer) stateFn { return func(l *lexer) stateFn {
switch r := l.next(); r { switch r := l.next(); r {
case delim: case delim:
@ -276,13 +276,13 @@ func lexStringLiteral(delim rune) stateFn {
return lexErrorf("unexpected eof in string literal") return lexErrorf("unexpected eof in string literal")
default: default:
l.keep(r) l.keep(r)
return lexStringLiteral(delim) return lexQuotedString(delim)
} }
case eof: case eof:
return lexErrorf("unexpected eof in string literal") return lexErrorf("unexpected eof in string literal")
default: default:
l.keep(r) l.keep(r)
return lexStringLiteral(delim) return lexQuotedString(delim)
} }
} }
} }

Loading…
Cancel
Save