From 51fd0657226248a99536f6c13f557f76d1c78f99 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 22 Oct 2024 14:37:53 +0900 Subject: [PATCH] mruby-compiler (parser_yylex): skip sign if bigint starts with `+` To reserve memory (1 byte) and avoid error (fixed by 11cff8f). --- mrbgems/mruby-compiler/core/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index b9b723112..8ec816a3b 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -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);