mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Prohibit r suffix after scientific notation (e.g. 1e10).
As CRuby does.
This commit is contained in:
@@ -5856,6 +5856,10 @@ parser_yylex(parser_state *p)
|
||||
errno = 0;
|
||||
}
|
||||
suffix = number_literal_suffix(p);
|
||||
if (seen_e && (suffix & NUM_SUFFIX_R)) {
|
||||
pushback(p, 'r');
|
||||
suffix &= ~NUM_SUFFIX_R;
|
||||
}
|
||||
pylval.nd = new_float(p, tok(p), suffix);
|
||||
return tFLOAT;
|
||||
#endif
|
||||
|
||||
@@ -11892,6 +11892,10 @@ parser_yylex(parser_state *p)
|
||||
errno = 0;
|
||||
}
|
||||
suffix = number_literal_suffix(p);
|
||||
if (seen_e && (suffix & NUM_SUFFIX_R)) {
|
||||
pushback(p, 'r');
|
||||
suffix &= ~NUM_SUFFIX_R;
|
||||
}
|
||||
pylval.nd = new_float(p, tok(p), suffix);
|
||||
return tFLOAT;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user