Skip to content

Commit 3c5916e

Browse files
committed
Perl_valid_identifier_pve: Use parse_ident
Instead of rolling its own version, incompletely.
1 parent 36797cb commit 3c5916e

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
@@ -14104,34 +14104,8 @@ Perl_valid_identifier_pve(pTHX_ const char *s, const char *end, U32 flags)
1410414104
if(end <= s)
1410514105
return false;
1410614106

14107-
if(flags & SVf_UTF8) {
14108-
if(!isIDFIRST_utf8_safe((U8 *)s, (U8 *)end))
14109-
return false;
14110-
14111-
while(s < end) {
14112-
s += UTF8SKIP((U8 *)s);
14113-
if(s == end)
14114-
break;
14115-
if(!isIDCONT_utf8_safe((U8 *)s, (U8 *)end))
14116-
return false;
14117-
}
14118-
return true;
14119-
}
14120-
else {
14121-
if(!isIDFIRST(s[0]))
14122-
return false;
14123-
14124-
while(s < end) {
14125-
s += 1;
14126-
if(s == end)
14127-
break;
14128-
if(!isIDCONT(s[0]))
14129-
return false;
14130-
}
14131-
return true;
14132-
}
14133-
14134-
return false;
14107+
return end == parse_ident_no_copy(s, end, cBOOL(flags & SVf_UTF8),
14108+
IDFIRST_ONLY);
1413514109
}
1413614110

1413714111
/*

0 commit comments

Comments
 (0)