@@ -68,6 +68,22 @@ func TestLex(t *testing.T) {
6868 {Kind : EOF },
6969 },
7070 },
71+ {
72+ "`escaped backticks` `` `a``b` ```` `a``` ```b` ```a````b``` ```````` ```a````` `````b```" ,
73+ []Token {
74+ {Kind : String , Value : "escaped backticks" },
75+ {Kind : String , Value : "" },
76+ {Kind : String , Value : "a`b" },
77+ {Kind : String , Value : "`" },
78+ {Kind : String , Value : "a`" },
79+ {Kind : String , Value : "`b" },
80+ {Kind : String , Value : "`a``b`" },
81+ {Kind : String , Value : "```" },
82+ {Kind : String , Value : "`a``" },
83+ {Kind : String , Value : "``b`" },
84+ {Kind : EOF },
85+ },
86+ },
7187 {
7288 "a and orb().val #." ,
7389 []Token {
@@ -332,6 +348,26 @@ literal not terminated (1:10)
332348 | id "hello
333349 | .........^
334350
351+ id ` + "`" + `hello
352+ literal not terminated (1:10)
353+ | id ` + "`" + `hello
354+ | .........^
355+
356+ id ` + "`" + `hello` + "``" + `
357+ literal not terminated (1:12)
358+ | id ` + "`" + `hello` + "``" + `
359+ | ...........^
360+
361+ id ` + "`" + `` + "``" + `hello
362+ literal not terminated (1:12)
363+ | id ` + "```" + `hello
364+ | ...........^
365+
366+ id ` + "`" + `hello` + "``" + ` world
367+ literal not terminated (1:18)
368+ | id ` + "`" + `hello` + "``" + ` world
369+ | .................^
370+
335371früh ♥︎
336372unrecognized character: U+2665 '♥' (1:6)
337373 | früh ♥︎
0 commit comments