mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
merge 3.4 (#21642)
This commit is contained in:
commit
3e439797ba
3 changed files with 24 additions and 5 deletions
|
@ -1603,15 +1603,24 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
|
|||
} while (isdigit(c));
|
||||
}
|
||||
if (c == 'e' || c == 'E') {
|
||||
exponent:
|
||||
int e;
|
||||
exponent:
|
||||
e = c;
|
||||
/* Exponent part */
|
||||
c = tok_nextc(tok);
|
||||
if (c == '+' || c == '-')
|
||||
if (c == '+' || c == '-') {
|
||||
c = tok_nextc(tok);
|
||||
if (!isdigit(c)) {
|
||||
tok->done = E_TOKEN;
|
||||
if (!isdigit(c)) {
|
||||
tok->done = E_TOKEN;
|
||||
tok_backup(tok, c);
|
||||
return ERRORTOKEN;
|
||||
}
|
||||
} else if (!isdigit(c)) {
|
||||
tok_backup(tok, c);
|
||||
return ERRORTOKEN;
|
||||
tok_backup(tok, e);
|
||||
*p_start = tok->start;
|
||||
*p_end = tok->cur;
|
||||
return NUMBER;
|
||||
}
|
||||
do {
|
||||
c = tok_nextc(tok);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue