-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve number highlighting for c #1752
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to support the l
and ll
suffix?
whoops, I'll fix that rq |
too many characters, send help
@@ -1,6 +1,11 @@ | |||
-- mod-version:3 | |||
local syntax = require "core.syntax" | |||
|
|||
-- integer suffix combinations as a regex | |||
local isuf = [[(?:[lL][uU]|ll[uU]|LL[uU]|[uU][lL]\b|[uU]ll|[uU]LL|[uU]|[lL]\b|ll|LL)?]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably simplify this by enabling case insensitiveness with like (?i:this IS case INSENSITIVE)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some odd reason, the two Ls in long long have to have the same case for the literal to be valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it can't be fixed easily, let's just keep this as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the \b
? Why is it needed only in some cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thacuber2a03 can you answer this question? I will merge if this conversation is resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yeah, sorry
about the \b
, I have it there to avoid having an l alongside another one with a different case be highlighted
which, honestly, I think it's overkill, but compilers actually don't compile programs with stuff like UlL
or Ll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in whatever case, I'm not sure whether I care that much anymore, so you can merge with or without that big ass regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takase1121 almost forgot the mention
Any updates on this PR? |
no, as far as I'm concerned, it's done |
* add unsigned suffix * add long suffixes * reorder octal literals and add suffix for hex numbers * fix integer and float suffixes too many characters, send help
0
at the beginning (seriously why the designers of the language thought prefixing an octal literal with 0 would be a good idea)in an off-topic note, why is language_c not in the plugins repo, and how long has it been since it was removed from there?