mruby-compiler (parser_yylex): skip sign if bigint starts with +

To reserve memory (1 byte) and avoid error (fixed by 11cff8f).
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-10-22 14:37:53 +09:00
parent 11cff8fa7d
commit 51fd065722
+4 -1
View File
@@ -5762,10 +5762,13 @@ parser_yylex(parser_state *p)
is_float = seen_point = seen_e = nondigit = 0;
p->lstate = EXPR_END;
newtok(p);
if (c == '-' || c == '+') {
if (c == '-') {
tokadd(p, c);
c = nextc(p);
}
else if (c == '+') {
c = nextc(p);
}
if (c == '0') {
#define no_digits() do {yyerror(NULL, p,"numeric literal without digits"); return 0;} while (0)
int start = toklen(p);