You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RegEx \\b([0-9]+)\\b should be changed to \\b([0-9_']+[dD]?)\\b.
The same goes for all number types (hex, octal, binary, floats, etc.): all occurences of [0-9] should become [0-9_'], and for hex nums all [0-9a-fA-F] become [0-9a-fA-F_'], for binaries [0-1] become [0-1_'].
Also octals should follow the rule, but I didn't find an octal-specific definition. It might be worthy implementing a specific definition for octals because they have their custom suffixes: either "o" or "q" (the "q" variant was introduced in Fasm v1.71.56). This is the octals RegEx I used in my Highlight definition file: \b[0-7_']+[oOqQ]\b.
I would love to contribute these fixes myself with a PR, but I'm not sure hwo to handle the Assembly x86 Intel.tmLanguage file — I've never worked on ST packages before, and I don't understand the role of this XML file, it seems a variant of the JSON file but I wouldn't know how to make changes reflect correctly in both files. I'll do some research, and if I work it out I'll try to make a PR linked to this issue.
This is my Fasm language definition for Highlight, if you want to cross-compare:
It's fully commented, and all keywords are grouped by categories. Of course, it's not for live editing, so performance is not an issue there, and I didn't need to worry about RegEx performance hits too much.
The text was updated successfully, but these errors were encountered:
Long numbers can be visually split with either a
'
or character_
. Also, decimal numbers can optionally be suffixed with a "d
"I've just written a FASM syntax definition for Highlight, and I stumbled on the same issues, which were pointed out to me by FASM users:
In your source file, the decimal numbers RegEx (lines 198-204):
The RegEx
\\b([0-9]+)\\b
should be changed to\\b([0-9_']+[dD]?)\\b
.The same goes for all number types (hex, octal, binary, floats, etc.): all occurences of
[0-9]
should become[0-9_']
, and for hex nums all[0-9a-fA-F]
become[0-9a-fA-F_']
, for binaries[0-1]
become[0-1_']
.Also octals should follow the rule, but I didn't find an octal-specific definition. It might be worthy implementing a specific definition for octals because they have their custom suffixes: either "
o
" or "q
" (the "q
" variant was introduced in Fasm v1.71.56). This is the octals RegEx I used in my Highlight definition file:\b[0-7_']+[oOqQ]\b
.I would love to contribute these fixes myself with a PR, but I'm not sure hwo to handle the
Assembly x86 Intel.tmLanguage
file — I've never worked on ST packages before, and I don't understand the role of this XML file, it seems a variant of the JSON file but I wouldn't know how to make changes reflect correctly in both files. I'll do some research, and if I work it out I'll try to make a PR linked to this issue.This is my Fasm language definition for Highlight, if you want to cross-compare:
It's fully commented, and all keywords are grouped by categories. Of course, it's not for live editing, so performance is not an issue there, and I didn't need to worry about RegEx performance hits too much.
The text was updated successfully, but these errors were encountered: