Skip to content

Commit 8e404c8

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 b4c14b7 commit 8e404c8

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
@@ -10574,17 +10574,11 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, bool chk_unary)
1057410574

1057510575
/* special case to handle ${10}, ${11} the same way we handle $1 etc */
1057610576
if (isDIGIT(*d)) {
10577-
bool is_zero = *d == '0';
10578-
char *digit_start= d;
10579-
while (s < PL_bufend && isDIGIT(*s)) {
10580-
d++;
10581-
if (d >= e)
10582-
croak("%s", ident_too_long);
10583-
*d= *s++;
10584-
}
10585-
if (is_zero && d - digit_start >= 1) /* d points at the last digit */
10586-
croak(ident_var_zero_multi_digit);
10587-
d[1] = '\0';
10577+
s = parse_ident(s - 1, PL_bufend, &d, e, is_utf8,
10578+
STOP_AT_FIRST_NON_DIGIT);
10579+
10580+
/* The code below is expecting d to point to the final digit */
10581+
d--;
1058810582
}
1058910583

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

0 commit comments

Comments
 (0)