diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-06-07 19:39:51 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-06-07 19:39:51 (GMT) |
commit | 3e439797bad59948ff810aeaf7e992b23451ddd6 (patch) | |
tree | 130c4172e7d609f3965a814fc751705988c14da7 /Parser | |
parent | ce6c525762a91d249f9ff877be5697849a47168e (diff) | |
parent | c41616230211822e838634b84b445f8a124add08 (diff) | |
download | cpython-3e439797bad59948ff810aeaf7e992b23451ddd6.zip cpython-3e439797bad59948ff810aeaf7e992b23451ddd6.tar.gz cpython-3e439797bad59948ff810aeaf7e992b23451ddd6.tar.bz2 |
merge 3.4 (#21642)
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/tokenizer.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 6aaa4a9..ef7b19f 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -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); |