Kaydet (Commit) f023c463 authored tarafından Guido van Rossum's avatar Guido van Rossum

Added recognition of 'l' or 'L' as long integer suffix

üst 6a1f54c0
......@@ -435,30 +435,37 @@ 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));
/* 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 */
if (c == '.') {
fraction:
/* Fraction */
do {
c = tok_nextc(tok);
} while (isdigit(c));
}
if (c == 'e' || c == 'E') {
/* Exponent part */
if (c == 'l' || c == 'L')
c = tok_nextc(tok);
if (c == '+' || c == '-')
c = tok_nextc(tok);
while (isdigit(c)) {
else {
/* Accept floating point numbers.
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 */
do {
c = tok_nextc(tok);
} while (isdigit(c));
}
if (c == 'e' || c == 'E') {
/* Exponent part */
c = tok_nextc(tok);
if (c == '+' || c == '-')
c = tok_nextc(tok);
while (isdigit(c)) {
c = tok_nextc(tok);
}
}
}
}
......
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