Skip to content

Commit 9082b27

Browse files
committed
S_scan_ident: Replace redundant code with function call
The previous two commits moved some code into a function. This commit takes very similar code and replaces it with a call to that function.
1 parent f1e7c09 commit 9082b27

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

toke.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10567,17 +10567,11 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, bool chk_unary)
1056710567

1056810568
/* special case to handle ${10}, ${11} the same way we handle $1 etc */
1056910569
if (isDIGIT(*d)) {
10570-
bool is_zero = *d == '0';
10571-
char *digit_start= d;
10572-
while (s < PL_bufend && isDIGIT(*s)) {
10573-
d++;
10574-
if (d >= e)
10575-
croak("%s", ident_too_long);
10576-
*d= *s++;
10577-
}
10578-
if (is_zero && d - digit_start >= 1) /* d points at the last digit */
10579-
croak(ident_var_zero_multi_digit);
10580-
d[1] = '\0';
10570+
s = parse_ident(s - 1, PL_bufend, &d, e, is_utf8,
10571+
STOP_AT_FIRST_NON_DIGIT);
10572+
10573+
/* The code below is expecting d to point to the final digit */
10574+
d--;
1058110575
}
1058210576

1058310577
/* Convert $^F, ${^F} and the ^F of ${^FOO} to control characters */

0 commit comments

Comments
 (0)