diff --git a/parser/lexer_test.go b/parser/lexer_test.go index faa98a48..7e1e5faf 100644 --- a/parser/lexer_test.go +++ b/parser/lexer_test.go @@ -351,6 +351,21 @@ Second line \ token.RIGHT_BRACKET, "", 6, ) + // Identifier from Unicode Nl + test("\u16ee", + token.IDENTIFIER, "ᛮ", 1, + ) + + // Identifier from Unicode Other_ID_Start + test("\u212e", + token.IDENTIFIER, "℮", 1, + ) + + // Using char from ID_Continue after valid start char + test("a\u0300", + token.IDENTIFIER, "à", 1, + ) + // ILLEGAL test(`3ea`, @@ -383,5 +398,15 @@ Second line \ token.STRING, "\"\\x0G\"", 1, token.EOF, "", 7, ) + + // Starting identifier with ID_Continue char from Nm + test("\u0300", + token.ILLEGAL, + ) + + // Starting identifier with Pattern_Syntax + test("'", + token.ILLEGAL, + ) }) }