Skip to content

Commit e75a2dc

Browse files
committed
Perl_valid_identifier_pve: Use parse_ident
Instead of rolling its own version, incompletely.
1 parent bd4c0d1 commit e75a2dc

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
@@ -14352,34 +14352,8 @@ Perl_valid_identifier_pve(pTHX_ const char *s, const char *end, U32 flags)
1435214352
if(end <= s)
1435314353
return false;
1435414354

14355-
if(flags & SVf_UTF8) {
14356-
if(!isIDFIRST_utf8_safe((U8 *)s, (U8 *)end))
14357-
return false;
14358-
14359-
while(s < end) {
14360-
s += UTF8SKIP((U8 *)s);
14361-
if(s == end)
14362-
break;
14363-
if(!isIDCONT_utf8_safe((U8 *)s, (U8 *)end))
14364-
return false;
14365-
}
14366-
return true;
14367-
}
14368-
else {
14369-
if(!isIDFIRST(s[0]))
14370-
return false;
14371-
14372-
while(s < end) {
14373-
s += 1;
14374-
if(s == end)
14375-
break;
14376-
if(!isIDCONT(s[0]))
14377-
return false;
14378-
}
14379-
return true;
14380-
}
14381-
14382-
return false;
14355+
return end == parse_ident_no_copy(s, end, cBOOL(flags & SVf_UTF8),
14356+
IDFIRST_ONLY);
1438314357
}
1438414358

1438514359
/*

0 commit comments

Comments
 (0)