mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
numeric literal fix
This commit is contained in:
parent
be0c8590bf
commit
ea2b77b323
3 changed files with 14 additions and 5 deletions
|
|
@ -13,7 +13,7 @@ inline bool is_cmd_identifier_part(char c, bool allowColon) {
|
|||
}
|
||||
|
||||
inline bool is_cmd_identifier_start(char c) {
|
||||
return is_identifier_start(c) || c == '.' || c == '$';
|
||||
return (is_identifier_start(c) || c == '.' || c == '$');
|
||||
}
|
||||
|
||||
class CommandParser : BasicParser {
|
||||
|
|
@ -75,9 +75,13 @@ public:
|
|||
nextChar();
|
||||
return parseString(c);
|
||||
}
|
||||
if (c == '+' || c == '-' || is_digit(c)) {
|
||||
if (c == '+' || c == '-') {
|
||||
nextChar();
|
||||
return parseNumber(c == '-' ? -1 : 1);
|
||||
}
|
||||
if (is_digit(c)) {
|
||||
return parseNumber(1);
|
||||
}
|
||||
throw error("invalid character '"+std::string({c})+"'");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue