[#101] fix constant string "{\""

This commit is contained in:
z7zmey 2020-01-08 09:31:40 +02:00
parent 31052588b1
commit 003ee67a86
3 changed files with 344 additions and 340 deletions

File diff suppressed because it is too large Load Diff

View File

@ -120,9 +120,10 @@ func (lex *Lexer) Lex(lval Lval) int {
| "\n" @constant_string_new_line -> double_qoute
),
double_qoute_nondollar: (
(any - [$"\r\n]) -> double_qoute
(any - [\\$"\r\n]) -> double_qoute
| "\r" @constant_string_new_line -> double_qoute
| "\n" @constant_string_new_line -> double_qoute
| "\\" -> double_qoute_any
| '"' -> final
),
double_qoute_nonvarname: (

View File

@ -496,6 +496,7 @@ func TestConstantStrings(t *testing.T) {
"{"
"{a"
"\{$"
"{\""
`
expected := []string{