aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 9 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index fa5609a649..d4e73e0072 100644
--- a/parse.y
+++ b/parse.y
@@ -7542,14 +7542,18 @@ parser_yylex(struct parser_params *parser)
if (seen_e) {
goto decode_num;
}
- tokadd(c);
- seen_e++;
- is_float++;
nondigit = c;
c = nextc();
- if (c != '-' && c != '+') continue;
+ if (c != '-' && c != '+' && !ISDIGIT(c)) {
+ pushback(c);
+ nondigit = 0;
+ goto decode_num;
+ }
+ tokadd(nondigit);
+ seen_e++;
+ is_float++;
tokadd(c);
- nondigit = c;
+ nondigit = (c == '-' || c == '+') ? c : 0;
break;
case '_': /* `_' in number just ignored */