Skip to content

Commit

Permalink
parser/lexer: add tests for special identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
filips committed Jun 11, 2024
1 parent 6e20115 commit c1a6c0a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions parser/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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,
)
})
}

0 comments on commit c1a6c0a

Please sign in to comment.