Skip to content

Commit

Permalink
Avoid using the ambiguous \h shorthand character
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pchaigno committed May 27, 2017
1 parent 202295c commit df6eada
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GDScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ patterns:
begin: '@"'
end: (?<!\\)"
- name: constant.numeric.integer.hexadecimal.gdscript
match: \b(?i:0x\h*)\b
match: \b(?i:0x[0-9A-Fa-f]*)\b
- name: constant.numeric.float.gdscript
match: \b(?i:(\d+\.\d*(e[\-\+]?\d+)?))\b
- name: constant.numeric.float.gdscript
Expand Down
2 changes: 1 addition & 1 deletion GDScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(?i:0x\h*)\b</string>
<string>\b(?i:0x[0-9A-Fa-f]*)\b</string>
<key>name</key>
<string>constant.numeric.integer.hexadecimal.gdscript</string>
</dict>
Expand Down

0 comments on commit df6eada

Please sign in to comment.