Skip to content

Commit 23f586a

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 7b37a60 commit 23f586a

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

1081610816
/* special case to handle ${10}, ${11} the same way we handle $1 etc */
1081710817
if (isDIGIT(*d)) {
10818-
bool is_zero = *d == '0';
10819-
char *digit_start= d;
10820-
while (s < PL_bufend && isDIGIT(*s)) {
10821-
d++;
10822-
if (d >= e)
10823-
croak("%s", ident_too_long);
10824-
*d= *s++;
10825-
}
10826-
if (is_zero && d - digit_start >= 1) /* d points at the last digit */
10827-
croak(ident_var_zero_multi_digit);
10828-
d[1] = '\0';
10818+
s = parse_ident(s - 1, PL_bufend, &d, e, is_utf8,
10819+
STOP_AT_FIRST_NON_DIGIT);
10820+
10821+
/* The code below is expecting d to point to the final digit */
10822+
d--;
1082910823
}
1083010824

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

0 commit comments

Comments
 (0)