summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-05-08 16:32:07 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-08 16:32:07 +0000
commitb3b48e3eb8f85caa6afab3dc95ab58c02450700f (patch)
treed9f052f43368551c55cf1a1539f48ba368f3a5db /toke.c
parent7fd134d9e547166a30ad904424bd09e784d058ce (diff)
downloadperl-b3b48e3eb8f85caa6afab3dc95ab58c02450700f.tar.gz
Don't forget to whine about \d__\d.
p4raw-id: //depot/perl@10038
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/toke.c b/toke.c
index 214e43912b..fe4069af3c 100644
--- a/toke.c
+++ b/toke.c
@@ -7189,29 +7189,21 @@ Perl_scan_num(pTHX_ char *start, YYSTYPE* lvalp)
lastub = s++;
}
- /* read off the first digit */
- if (isDIGIT(*s)) {
- if (d >= e)
- Perl_croak(aTHX_ number_too_long);
- *d++ = *s++;
- }
-
/* read digits of exponent */
while (isDIGIT(*s) || *s == '_') {
if (isDIGIT(*s)) {
if (d >= e)
Perl_croak(aTHX_ number_too_long);
- *d++ = *s;
+ *d++ = *s++;
}
else {
if (ckWARN(WARN_SYNTAX) &&
((lastub && s == lastub + 1) ||
- !isDIGIT(s[1])))
+ (!isDIGIT(s[1]) && s[1] != '_')))
Perl_warner(aTHX_ WARN_SYNTAX,
"Misplaced _ in number");
- lastub = s;
+ lastub = s++;
}
- s++;
}
}