Skip to content

Commit c2a1cfb

Browse files
committed
remove emoji identifiers
Some unicode characters or character groups lead to a large increase in parser size. This change halves the size of the generated parser file.
1 parent 73d1539 commit c2a1cfb

File tree

6 files changed

+577334
-1137595
lines changed

6 files changed

+577334
-1137595
lines changed

grammar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,8 @@ module.exports = grammar({
894894
// Some symbols in Sm and So unicode categories that are identifiers
895895
const validMathSymbols = '°∀-∇∎-∑∫-∳';
896896

897-
const start = `[_\\p{XID_Start}${validMathSymbols}\\p{Emoji}&&[^0-9#*]]`;
897+
// Emojis are currently not supported because they double the parser size
898+
const start = `[_\\p{XID_Start}${validMathSymbols}&&[^0-9#*]]`;
898899
const rest = `[^"'\`\\s\\.\\-\\[\\]${nonIdentifierCharacters}]*`;
899900
return new RegExp(start + rest);
900901
},

0 commit comments

Comments
 (0)