Prohibit `r` suffix after scientific notation (e.g. `1e10`).

As CRuby does.
parent cc59860e
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment