Skip to content

Commit

Permalink
Add handling of U+10000 to U+10FFFF in block comments
Browse files Browse the repository at this point in the history
Closes: #56
  • Loading branch information
erikd committed Jul 21, 2016
1 parent 3f8e64c commit f20f817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Tests/Lexer.hs
Expand Up @@ -11,6 +11,10 @@ import Language.JavaScript.Parser.Lexer

testLexer :: Spec
testLexer = describe "Lexer:" $ do
it "comments" $ do
testLex "// πŸ˜πŸ™πŸšπŸ›πŸœπŸπŸžπŸŸπŸ πŸ‘ " `shouldBe` "[CommentToken]"
testLex "/* πŸ˜πŸ™πŸšπŸ›πŸœπŸπŸžπŸŸπŸ πŸ‘ */" `shouldBe` "[CommentToken]"

it "numbers" $ do
testLex "123" `shouldBe` "[DecimalToken 123]"
testLex "037" `shouldBe` "[OctalToken 037]"
Expand Down
2 changes: 1 addition & 1 deletion src/Language/JavaScript/Parser/Lexer.x
Expand Up @@ -42,7 +42,7 @@ $ps = \x2029


$any_char = [\x00-\xff]
$any_unicode_char = [\x00-\xffff]
$any_unicode_char = [\x00-\x10ffff]


$eol_char = [\x000A\x000D\x2028\x2029] -- any end of line character
Expand Down

0 comments on commit f20f817

Please sign in to comment.