@@ -2263,7 +2263,7 @@ S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack)
2263
2263
if ( isIDFIRST_lazy_if_safe (s , PL_bufend , UTF )
2264
2264
|| (allow_pack && * s == ':' && s [1 ] == ':' ) )
2265
2265
{
2266
- s = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , allow_pack , & len , allow_pack );
2266
+ s = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , allow_pack , & len , allow_pack );
2267
2267
if (check_keyword ) {
2268
2268
char * s2 = PL_tokenbuf ;
2269
2269
STRLEN len2 = len ;
@@ -4675,7 +4675,7 @@ S_intuit_method(pTHX_ char *start, SV *ioname, CV *cv)
4675
4675
return * s == '(' ? METHCALL : METHCALL0 ;
4676
4676
}
4677
4677
4678
- s = scan_word (s , tmpbuf , sizeof tmpbuf , TRUE, & len , FALSE);
4678
+ s = scan_word6 (s , tmpbuf , sizeof tmpbuf , TRUE, & len , FALSE);
4679
4679
/* start is the beginning of the possible filehandle/object,
4680
4680
* and s is the end of it
4681
4681
* tmpbuf is a copy of it (but with single quotes as double colons)
@@ -5303,7 +5303,7 @@ yyl_dollar(pTHX_ char *s)
5303
5303
} while (isSPACE (* t ));
5304
5304
if (isIDFIRST_lazy_if_safe (t , PL_bufend , UTF )) {
5305
5305
STRLEN len ;
5306
- t = scan_word (t , tmpbuf , sizeof tmpbuf , TRUE,
5306
+ t = scan_word6 (t , tmpbuf , sizeof tmpbuf , TRUE,
5307
5307
& len , TRUE);
5308
5308
while (isSPACE (* t ))
5309
5309
t ++ ;
@@ -5337,7 +5337,7 @@ yyl_dollar(pTHX_ char *s)
5337
5337
char tmpbuf [sizeof PL_tokenbuf ];
5338
5338
int t2 ;
5339
5339
STRLEN len ;
5340
- scan_word (s , tmpbuf , sizeof tmpbuf , TRUE, & len , FALSE);
5340
+ scan_word6 (s , tmpbuf , sizeof tmpbuf , TRUE, & len , FALSE);
5341
5341
if ((t2 = keyword (tmpbuf , len , 0 ))) {
5342
5342
/* binary operators exclude handle interpretations */
5343
5343
switch (t2 ) {
@@ -5408,7 +5408,7 @@ yyl_sub(pTHX_ char *s, const int key)
5408
5408
{
5409
5409
5410
5410
PL_expect = XATTRBLOCK ;
5411
- d = scan_word (s , tmpbuf , sizeof PL_tokenbuf - 1 , TRUE,
5411
+ d = scan_word6 (s , tmpbuf , sizeof PL_tokenbuf - 1 , TRUE,
5412
5412
& len , TRUE);
5413
5413
if (key == KEY_format )
5414
5414
format_name = S_newSV_maybe_utf8 (aTHX_ s , d - s );
@@ -5993,7 +5993,7 @@ yyl_colon(pTHX_ char *s)
5993
5993
I32 tmp ;
5994
5994
SV * sv ;
5995
5995
STRLEN len ;
5996
- char * d = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
5996
+ char * d = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
5997
5997
if (isLOWER (* s ) && (tmp = keyword (PL_tokenbuf , len , 0 ))) {
5998
5998
if (tmp < 0 ) tmp = - tmp ;
5999
5999
switch (tmp ) {
@@ -6175,7 +6175,7 @@ yyl_leftcurly(pTHX_ char *s, const U8 formbrack)
6175
6175
}
6176
6176
if (d < PL_bufend && isIDFIRST_lazy_if_safe (d , PL_bufend , UTF )) {
6177
6177
STRLEN len ;
6178
- d = scan_word (d , PL_tokenbuf + 1 , sizeof PL_tokenbuf - 1 ,
6178
+ d = scan_word6 (d , PL_tokenbuf + 1 , sizeof PL_tokenbuf - 1 ,
6179
6179
FALSE, & len , FALSE);
6180
6180
while (d < PL_bufend && SPACE_OR_TAB (* d ))
6181
6181
d ++ ;
@@ -7022,7 +7022,7 @@ yyl_foreach(pTHX_ char *s)
7022
7022
/* skip optional package name, as in "for my abc $x (..)" */
7023
7023
if (UNLIKELY (isIDFIRST_lazy_if_safe (p , PL_bufend , UTF ))) {
7024
7024
STRLEN len ;
7025
- p = scan_word (p , PL_tokenbuf , sizeof PL_tokenbuf , TRUE, & len , TRUE);
7025
+ p = scan_word6 (p , PL_tokenbuf , sizeof PL_tokenbuf , TRUE, & len , TRUE);
7026
7026
p = skipspace (p );
7027
7027
paren_is_valid = FALSE;
7028
7028
}
@@ -7053,7 +7053,7 @@ yyl_do(pTHX_ char *s, I32 orig_keyword)
7053
7053
char * d ;
7054
7054
STRLEN len ;
7055
7055
* PL_tokenbuf = '&' ;
7056
- d = scan_word (s , PL_tokenbuf + 1 , sizeof PL_tokenbuf - 1 ,
7056
+ d = scan_word6 (s , PL_tokenbuf + 1 , sizeof PL_tokenbuf - 1 ,
7057
7057
1 , & len , TRUE);
7058
7058
if (len && memNEs (PL_tokenbuf + 1 , len , "CORE" )
7059
7059
&& !keyword (PL_tokenbuf + 1 , len , 0 )) {
@@ -7089,7 +7089,7 @@ yyl_my(pTHX_ char *s, I32 my)
7089
7089
s = skipspace (s );
7090
7090
if (isIDFIRST_lazy_if_safe (s , PL_bufend , UTF )) {
7091
7091
STRLEN len ;
7092
- s = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , TRUE, & len , TRUE);
7092
+ s = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , TRUE, & len , TRUE);
7093
7093
if (memEQs (PL_tokenbuf , len , "sub" ))
7094
7094
return yyl_sub (aTHX_ s , my );
7095
7095
PL_in_my_stash = find_in_my_stash (PL_tokenbuf , len );
@@ -7561,7 +7561,7 @@ yyl_just_a_word(pTHX_ char *s, STRLEN len, I32 orig_keyword, struct code c)
7561
7561
7562
7562
if (* s == '\'' || (* s == ':' && s [1 ] == ':' )) {
7563
7563
STRLEN morelen ;
7564
- s = scan_word (s , PL_tokenbuf + len , sizeof PL_tokenbuf - len ,
7564
+ s = scan_word6 (s , PL_tokenbuf + len , sizeof PL_tokenbuf - len ,
7565
7565
TRUE, & morelen , TRUE);
7566
7566
if (no_op_error ) {
7567
7567
no_op ("Bareword" ,s );
@@ -8311,7 +8311,7 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct
8311
8311
s = skipspace (s );
8312
8312
if (isIDFIRST_lazy_if_safe (s , PL_bufend , UTF )) {
8313
8313
const char * t ;
8314
- char * d = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8314
+ char * d = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8315
8315
for (t = d ; isSPACE (* t );)
8316
8316
t ++ ;
8317
8317
if ( * t && memCHRs ("|&*+-=!?:." , * t ) && ckWARN_d (WARN_PRECEDENCE )
@@ -8759,7 +8759,7 @@ yyl_key_core(pTHX_ char *s, STRLEN len, struct code c)
8759
8759
STRLEN olen = len ;
8760
8760
char * d = s ;
8761
8761
s += 2 ;
8762
- s = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8762
+ s = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8763
8763
if ((* s == ':' && s [1 ] == ':' )
8764
8764
|| (!(key = keyword (PL_tokenbuf , len , 1 )) && * s == '\'' ))
8765
8765
{
@@ -8838,7 +8838,7 @@ yyl_keylookup(pTHX_ char *s, GV *gv)
8838
8838
c .gv = gv ;
8839
8839
8840
8840
PL_bufptr = s ;
8841
- s = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8841
+ s = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & len , FALSE);
8842
8842
8843
8843
/* Some keywords can be followed by any delimiter, including ':' */
8844
8844
anydelim = word_takes_any_delimiter (PL_tokenbuf , len );
@@ -10247,22 +10247,30 @@ S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
10247
10247
10248
10248
/* Returns a NUL terminated string, with the length of the string written to
10249
10249
*slp
10250
+
10251
+ scan_word6() may be removed once ' in names is removed.
10250
10252
*/
10251
10253
char *
10252
- Perl_scan_word (pTHX_ char * s , char * dest , STRLEN destlen , int allow_package , STRLEN * slp , bool warn_tick )
10254
+ Perl_scan_word6 (pTHX_ char * s , char * dest , STRLEN destlen , int allow_package , STRLEN * slp , bool warn_tick )
10253
10255
{
10254
10256
char * d = dest ;
10255
10257
char * const e = d + destlen - 3 ; /* two-character token, ending NUL */
10256
10258
bool is_utf8 = cBOOL (UTF );
10257
10259
10258
- PERL_ARGS_ASSERT_SCAN_WORD ;
10260
+ PERL_ARGS_ASSERT_SCAN_WORD6 ;
10259
10261
10260
10262
parse_ident (& s , & d , e , allow_package , is_utf8 , TRUE, warn_tick );
10261
10263
* d = '\0' ;
10262
10264
* slp = d - dest ;
10263
10265
return s ;
10264
10266
}
10265
10267
10268
+ char *
10269
+ Perl_scan_word (pTHX_ char * s , char * dest , STRLEN destlen , int allow_package , STRLEN * slp )
10270
+ {
10271
+ PERL_ARGS_ASSERT_SCAN_WORD ;
10272
+ return scan_word6 (s , dest , destlen , allow_package , slp , FALSE);
10273
+ }
10266
10274
10267
10275
/* scan s and extract an identifier ($var) from it if possible
10268
10276
* into dest.
@@ -13723,7 +13731,7 @@ Perl_parse_label(pTHX_ U32 flags)
13723
13731
t = s = PL_bufptr ;
13724
13732
if (!isIDFIRST_lazy_if_safe (s , PL_bufend , UTF ))
13725
13733
goto no_label ;
13726
- t = scan_word (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & wlen , FALSE);
13734
+ t = scan_word6 (s , PL_tokenbuf , sizeof PL_tokenbuf , FALSE, & wlen , FALSE);
13727
13735
if (word_takes_any_delimiter (s , wlen ))
13728
13736
goto no_label ;
13729
13737
bufptr_pos = s - SvPVX (PL_linestr );
0 commit comments