Skip to content

Commit e343e96

Browse files
committed
Make num type suffix match lenient to safen diffs
1 parent c17f9a8 commit e343e96

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Syntaxes/Nim.YAML-tmLanguage

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,23 @@ patterns:
115115

116116
- comment: A float literal
117117
name: constant.numeric.float.decimal.nim
118-
match: (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF](32|64|128))|[fFdD])? #' highlight-flaw-fixer-comment
118+
match: (\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF]\d)|[fFdD])? #' highlight-flaw-fixer-comment
119119

120120
- comment: A hexadecimal literal
121121
name: constant.numeric.integer.hexadecimal.nim
122-
match: (?<![\w\x{80}-\x{10FFFF}])(0[xX]\h[_\h]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? #' highlight-flaw-fixer-comment
122+
match: (0[xX]\h[_\h]*)('?(([iIuUfF]\d)|[uUfFdD]))? #' highlight-flaw-fixer-comment
123123

124124
- comment: A base-8 integer literal
125125
name: constant.numeric.integer.octal.nim
126-
match: (?<![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? #' highlight-flaw-fixer-comment
126+
match: (0[ocC][0-7][_0-7]*)('?(([iIuUfF]\d)|[uUfFdD]))? #' highlight-flaw-fixer-comment
127127

128128
- comment: A base-2 integer literal
129129
name: constant.numeric.integer.binary.nim
130-
match: (?<![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? #' highlight-flaw-fixer-comment
130+
match: (0(b|B)[01][_01]*)('?(([iIuUfF]\d)|[uUfFdD]))? #' highlight-flaw-fixer-comment
131131

132132
- comment: A base-10 integer literal
133133
name: constant.numeric.integer.decimal.nim
134-
match: (?<![\w\x{80}-\x{10FFFF}])(\d[_\d]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))? #' highlight-flaw-fixer-comment
134+
match: (\d[_\d]*)('?(([iIuUfF]\d)|[uUfFdD]))? #' highlight-flaw-fixer-comment
135135

136136
- comment: Language Constants.
137137
name: constant.language.nim

Syntaxes/Nim.tmLanguage

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,39 +322,39 @@
322322
<key>comment</key>
323323
<string>A float literal</string>
324324
<key>match</key>
325-
<string>(?&lt;![\w\x{80}-\x{10FFFF}])(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF](32|64|128))|[fFdD])?</string>
325+
<string>(\d[_\d]*((\.[_\d]+([eE][\+\-]?\d[_\d]*)?)|([eE][\+\-]?\d[_\d]*)))('?([fF]\d)|[fFdD])?</string>
326326
<key>name</key>
327327
<string>constant.numeric.float.decimal.nim</string>
328328
</dict>
329329
<dict>
330330
<key>comment</key>
331331
<string>A hexadecimal literal</string>
332332
<key>match</key>
333-
<string>(?&lt;![\w\x{80}-\x{10FFFF}])(0[xX]\h[_\h]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))?</string>
333+
<string>(0[xX]\h[_\h]*)('?(([iIuUfF]\d)|[uUfFdD]))?</string>
334334
<key>name</key>
335335
<string>constant.numeric.integer.hexadecimal.nim</string>
336336
</dict>
337337
<dict>
338338
<key>comment</key>
339339
<string>A base-8 integer literal</string>
340340
<key>match</key>
341-
<string>(?&lt;![\w\x{80}-\x{10FFFF}])(0[ocC][0-7][_0-7]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))?</string>
341+
<string>(0[ocC][0-7][_0-7]*)('?(([iIuUfF]\d)|[uUfFdD]))?</string>
342342
<key>name</key>
343343
<string>constant.numeric.integer.octal.nim</string>
344344
</dict>
345345
<dict>
346346
<key>comment</key>
347347
<string>A base-2 integer literal</string>
348348
<key>match</key>
349-
<string>(?&lt;![\w\x{80}-\x{10FFFF}])(0(b|B)[01][_01]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))?</string>
349+
<string>(0(b|B)[01][_01]*)('?(([iIuUfF]\d)|[uUfFdD]))?</string>
350350
<key>name</key>
351351
<string>constant.numeric.integer.binary.nim</string>
352352
</dict>
353353
<dict>
354354
<key>comment</key>
355355
<string>A base-10 integer literal</string>
356356
<key>match</key>
357-
<string>(?&lt;![\w\x{80}-\x{10FFFF}])(\d[_\d]*)('?(([iIuUfF](8|16|32|64))|[uUfFdD]))?</string>
357+
<string>(\d[_\d]*)('?(([iIuUfF]\d)|[uUfFdD]))?</string>
358358
<key>name</key>
359359
<string>constant.numeric.integer.decimal.nim</string>
360360
</dict>
@@ -378,7 +378,7 @@
378378
</dict>
379379
</dict>
380380
<key>comment</key>
381-
<string>Primary branching keywords and their conditions</string>
381+
<string>Primary branching keywords</string>
382382
<key>end</key>
383383
<string>(:)</string>
384384
<key>endCaptures</key>

0 commit comments

Comments
 (0)