-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix is_valid_float
, Variant
parser, Expression
parser, script highlighter, and TextServer
not handing capital E in scientific notation.
#102396
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.
Seems fine.
I wonder if we should also support uppercase 0x
and 0b
which some of those parsers handle.
C standard seems to allow both upper and lower case, so probably yes. |
Would make sense to add a test for this, wouldn't it? |
Should the check be added in syntax_highlighter.cpp too? |
Yes, missed it. Will update in a moment. |
Done, also added few tests. |
static bool isflt[] = { true, true, true, false, true, true, false, false, false, false, false, false, false, true, true }; | ||
static bool isaid[] = { false, false, false, false, false, false, false, false, true, true, false, false, false, false, false }; | ||
static bool isuid[] = { false, false, false, false, false, false, false, false, true, true, false, false, true, false, false }; | ||
for (unsigned int i = 0; i < sizeof(data) / sizeof(data[0]); i++) { |
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.
This is not important, but for the future, you can use std::size(data)
instead of sizeof(data) / sizeof(data[0])
:)
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.
Isn't it C++20 only thing.
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.
Nop, I was wrong it's C++17 (and compiler support is reasonable) so it can be used. Might good cleanup for ~70 currently used cases of sizeof / sizeof
.
Needs a rebase |
…ighlighter, and `TextServer` not handing capital E in scientific notation.
Thanks! |
Fixes #102363