Commit f023c463 authored by Guido van Rossum's avatar Guido van Rossum

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

parent 6a1f54c0
...@@ -435,16 +435,22 @@ tok_get(tok, p_start, p_end) ...@@ -435,16 +435,22 @@ tok_get(tok, p_start, p_end)
c = tok_nextc(tok); c = tok_nextc(tok);
} }
} }
if (c == 'l' || c == 'L')
c = tok_nextc(tok);
} }
else { else {
/* Decimal */ /* Decimal */
do { do {
c = tok_nextc(tok); c = tok_nextc(tok);
} while (isdigit(c)); } while (isdigit(c));
if (c == 'l' || c == 'L')
c = tok_nextc(tok);
else {
/* Accept floating point numbers. /* Accept floating point numbers.
XXX This accepts incomplete things like 12e or 1e+; XXX This accepts incomplete things like
worry about that at run-time. XXX 12e or 1e+; worry run-time.
XXX Doesn't accept numbers starting with a dot */ XXX Doesn't accept numbers
XXX starting with a dot */
if (c == '.') { if (c == '.') {
fraction: fraction:
/* Fraction */ /* Fraction */
...@@ -462,6 +468,7 @@ tok_get(tok, p_start, p_end) ...@@ -462,6 +468,7 @@ tok_get(tok, p_start, p_end)
} }
} }
} }
}
tok_backup(tok, c); tok_backup(tok, c);
*p_end = tok->cur; *p_end = tok->cur;
return NUMBER; return NUMBER;
......
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