mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Added recognition of 'l' or 'L' as long integer suffix
This commit is contained in:
parent
6a1f54c09c
commit
f023c463d7
1 changed files with 23 additions and 16 deletions
|
@ -435,16 +435,22 @@ tok_get(tok, p_start, p_end)
|
|||
c = tok_nextc(tok);
|
||||
}
|
||||
}
|
||||
if (c == 'l' || c == 'L')
|
||||
c = tok_nextc(tok);
|
||||
}
|
||||
else {
|
||||
/* Decimal */
|
||||
do {
|
||||
c = tok_nextc(tok);
|
||||
} while (isdigit(c));
|
||||
if (c == 'l' || c == 'L')
|
||||
c = tok_nextc(tok);
|
||||
else {
|
||||
/* Accept floating point numbers.
|
||||
XXX This accepts incomplete things like 12e or 1e+;
|
||||
worry about that at run-time.
|
||||
XXX Doesn't accept numbers starting with a dot */
|
||||
XXX This accepts incomplete things like
|
||||
XXX 12e or 1e+; worry run-time.
|
||||
XXX Doesn't accept numbers
|
||||
XXX starting with a dot */
|
||||
if (c == '.') {
|
||||
fraction:
|
||||
/* Fraction */
|
||||
|
@ -462,6 +468,7 @@ tok_get(tok, p_start, p_end)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tok_backup(tok, c);
|
||||
*p_end = tok->cur;
|
||||
return NUMBER;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue