Skip to content

Commit 5f37df6

Browse files
committed
Perl_valid_identifier_pve: Use parse_ident
Instead of rolling its own version, incompletely.
1 parent 9f33655 commit 5f37df6

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

toke.c

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14110,34 +14110,8 @@ Perl_valid_identifier_pve(pTHX_ const char *s, const char *end, U32 flags)
1411014110
if(end <= s)
1411114111
return false;
1411214112

14113-
if(flags & SVf_UTF8) {
14114-
if(!isIDFIRST_utf8_safe((U8 *)s, (U8 *)end))
14115-
return false;
14116-
14117-
while(s < end) {
14118-
s += UTF8SKIP((U8 *)s);
14119-
if(s == end)
14120-
break;
14121-
if(!isIDCONT_utf8_safe((U8 *)s, (U8 *)end))
14122-
return false;
14123-
}
14124-
return true;
14125-
}
14126-
else {
14127-
if(!isIDFIRST(s[0]))
14128-
return false;
14129-
14130-
while(s < end) {
14131-
s += 1;
14132-
if(s == end)
14133-
break;
14134-
if(!isIDCONT(s[0]))
14135-
return false;
14136-
}
14137-
return true;
14138-
}
14139-
14140-
return false;
14113+
return end == parse_ident_no_copy(s, end, cBOOL(flags & SVf_UTF8),
14114+
IDFIRST_ONLY);
1414114115
}
1414214116

1414314117
/*

0 commit comments

Comments
 (0)