Skip to content

Commit af8590c

Browse files
committed
toke.c: S_parse_ident: simplify
The previous commit just moved some code and added comments. This commit takes advantage of the new place, and simplifies the code, using the paradigm from the isWORDCHAR_A clause just below.
1 parent 9b131b0 commit af8590c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

toke.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10397,16 +10397,15 @@ S_parse_ident(pTHX_ const char *s, const char * const send,
1039710397
else if (stop_at_first_non_digit && isDIGIT_A(*s)) {
1039810398
bool is_zero = *s == '0';
1039910399
char *digit_start= *d;
10400-
*(*d)++ = *s++;
1040110400

1040210401
/* Stop at the first non-digit */
10403-
while (s < send && isDIGIT(*s)) {
10402+
do {
10403+
*(*d)++ = *s++;
10404+
1040410405
if (*d >= e) {
1040510406
goto too_long;
1040610407
}
10407-
10408-
*(*d)++ = *s++;
10409-
}
10408+
} while (isDIGIT_A(*s));
1041010409

1041110410
/* Leading zeros are not permitted */
1041210411
if (is_zero && *d - digit_start > 1)

0 commit comments

Comments
 (0)