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

Commit f406b00

Browse files
authored
Avoid using the ambiguous \h shorthand character
Depending on the regular expression engine used, \h does not always mean the same. With a PCRE engine, it matches white spaces, whereas, with a Oniguruma engine, it matches hexademical digit characters. Atom uses an Oniguruma engine, but github.com relies on a PCRE engine.
1 parent ff646d3 commit f406b00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

grammars/rust.cson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040
'escaped_character': {
4141
'name': 'constant.character.escape.rust'
42-
'match': '\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
42+
'match': '\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
4343
}
4444
'string_literal': {
4545
'comment': 'Double-quote string literal'
@@ -221,7 +221,7 @@
221221
{
222222
'comment': 'Single-quote string literal (character)'
223223
'name': 'string.quoted.single.rust'
224-
'match': 'b?\'([^\'\\\\]|\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))\''
224+
'match': 'b?\'([^\'\\\\]|\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))\''
225225
}
226226
{ 'include': '#string_literal' }
227227
{ 'include': '#raw_string_literal' }

0 commit comments

Comments
 (0)