summaryrefslogtreecommitdiffstats
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-05-05 20:16:20 (GMT)
committerGuido van Rossum <guido@python.org>1991-05-05 20:16:20 (GMT)
commitf023c463d77c8321dcea935a7225562411f97bd1 (patch)
treee871691d006f9684d6b377e34f47473a87a16b2d /Parser/tokenizer.c
parent6a1f54c09c6a94f5ac617e0f8c2329d73b329570 (diff)
downloadcpython-f023c463d77c8321dcea935a7225562411f97bd1.zip
cpython-f023c463d77c8321dcea935a7225562411f97bd1.tar.gz
cpython-f023c463d77c8321dcea935a7225562411f97bd1.tar.bz2
Added recognition of 'l' or 'L' as long integer suffix
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 86106b3..62a3da0 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -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);
+ }
}
}
}