Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit a208ceb

Browse files
author
Alhadis
committed
Add error highlighting to codepoints over U+10FFFF
1 parent 9f6a8ac commit a208ceb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

grammars/javascript.cson

+9-1
Original file line numberDiff line numberDiff line change
@@ -1317,12 +1317,20 @@
13171317
'name': 'invalid.illegal.identifier.js'
13181318
}
13191319
{
1320-
'match': '\\\\u(?:[A-Fa-f0-9]{4}|(\\{)[A-Fa-f0-9]+(\\}))'
1320+
'match': '\\\\u(?:[A-Fa-f0-9]{4}|(\\{)([A-Fa-f0-9]+)(\\}))'
13211321
'name': 'constant.character.escape.js'
13221322
'captures':
13231323
'1':
13241324
'name': 'punctuation.section.scope.begin.js'
13251325
'2':
1326+
'patterns': [
1327+
{
1328+
# Max codepoint: \u{10FFFF}
1329+
'match': '[A-Fa-f\\d]{7,}|(?!10)[A-Fa-f\\d]{6}'
1330+
'name': 'invalid.illegal.identifier.js'
1331+
}
1332+
]
1333+
'3':
13261334
'name': 'punctuation.section.scope.end.js'
13271335
}
13281336
{

0 commit comments

Comments
 (0)