Skip to content

Commit 8a2ed3d

Browse files
committed
Allow any Unicode codepoint, even those greater than 65535
1 parent a009f33 commit 8a2ed3d

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/Language/ECMAScript3/Lexer.hs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,25 @@ import Data.Maybe (isNothing)
2727

2828
identifierStartCharSet :: Set.CharSet
2929
identifierStartCharSet =
30-
(filterBmpChars $ mconcat
30+
mconcat
3131
[ Set.fromDistinctAscList "$_"
3232
, Set.lowercaseLetter
3333
, Set.uppercaseLetter
3434
, Set.titlecaseLetter
3535
, Set.modifierLetter
3636
, Set.otherLetter
3737
, Set.letterNumber
38-
])
38+
]
3939

4040
identifierRestCharSet :: Set.CharSet
4141
identifierRestCharSet =
4242
identifierStartCharSet
43-
<> (filterBmpChars $ mconcat
43+
<> mconcat
4444
[ Set.nonSpacingMark
4545
, Set.spacingCombiningMark
4646
, Set.decimalNumber
4747
, Set.connectorPunctuation
48-
])
49-
50-
filterBmpChars :: Set.CharSet -> Set.CharSet
51-
filterBmpChars = Set.filter (< '\65536')
48+
]
5249

5350
identifierStart :: Stream s Identity Char => Parser s Char
5451
identifierStart = satisfy (flip Set.member identifierStartCharSet) <?> "letter, '$', '_'"

0 commit comments

Comments
 (0)