From 257f3c42a9cd6eaef1a31ea575a7d25ddcce7d61 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Tue, 17 Feb 2015 00:05:49 +0700 Subject: [PATCH] Don't add wrapping quotes to string value --- lexer/lexer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lexer/lexer.go b/lexer/lexer.go index 889cdb3..be59e2a 100644 --- a/lexer/lexer.go +++ b/lexer/lexer.go @@ -257,6 +257,7 @@ func lexNumber(l *Lexer) stateFn { } func lexString(l *Lexer) stateFn { + l.ignore() escaped := false for { switch r := l.next(); r { @@ -266,7 +267,9 @@ func lexString(l *Lexer) stateFn { if escaped { escaped = false } else { + l.backup() // Going before closing quote l.emit(String) + l.next() // Skipping closing quote return lexInitial } case '\n':