diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-23 05:00:55 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-23 05:00:55 +0000 |
commit | a9ef352ac26829339bf17aa20568b3bde2fb1dd0 (patch) | |
tree | 54b04807040fe503636ae6878863bd59d2b058ee /toke.c | |
parent | de030af3419d6a4e465a5bde7cc2bada20a15fe8 (diff) | |
download | perl-a9ef352ac26829339bf17aa20568b3bde2fb1dd0.tar.gz |
remove redundant part of change#1169 superseded by change#2061;
avoid "future reserved word" warning on prototypical bearwords
p4raw-link: @2061 on //depot/perl: bf8481137c02593eb36f8d0e234a2ec41a1c92e4
p4raw-link: @1169 on //depot/perl: 2a841d1398ee9bbf30a942905192cc2591b3e92a
p4raw-id: //depot/perl@3446
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -3154,11 +3154,8 @@ int yylex(PERL_YYLEX_PARAM_DECL) PL_oldoldbufptr < PL_bufptr && (PL_oldoldbufptr == PL_last_lop || PL_oldoldbufptr == PL_last_uni) && /* NO SKIPSPACE BEFORE HERE! */ - (PL_expect == XREF - || ((PL_opargs[PL_last_lop_op] >> OASHIFT)& 7) == OA_FILEREF - || (PL_last_lop_op == OP_ENTERSUB - && PL_last_proto - && PL_last_proto[PL_last_proto[0] == ';' ? 1 : 0] == '*')) ) + (PL_expect == XREF || + ((PL_opargs[PL_last_lop_op] >> OASHIFT)& 7) == OA_FILEREF)) { bool immediate_paren = *s == '('; @@ -3174,8 +3171,10 @@ int yylex(PERL_YYLEX_PARAM_DECL) /* (But it's an indir obj regardless for sort.) */ if ((PL_last_lop_op == OP_SORT || - (!immediate_paren && (!gv || !GvCVu(gv))) ) && - (PL_last_lop_op != OP_MAPSTART && PL_last_lop_op != OP_GREPSTART)){ + (!immediate_paren && (!gv || !GvCVu(gv)))) && + (PL_last_lop_op != OP_MAPSTART && + PL_last_lop_op != OP_GREPSTART)) + { PL_expect = (PL_last_lop == PL_oldoldbufptr) ? XTERM : XOPERATOR; goto bareword; } @@ -3187,6 +3186,7 @@ int yylex(PERL_YYLEX_PARAM_DECL) s = skipspace(s); if (*s == '(') { CLINE; + PL_last_proto = Nullch; if (gv && GvCVu(gv)) { CV *cv; if ((cv = GvCV(gv)) && SvPOK(cv)) @@ -3227,6 +3227,7 @@ int yylex(PERL_YYLEX_PARAM_DECL) PL_tokenbuf, PL_tokenbuf); PL_last_lop = PL_oldbufptr; PL_last_lop_op = OP_ENTERSUB; + PL_last_proto = Nullch; /* Check for a constant sub */ cv = GvCV(gv); if ((sv = cv_const_sv(cv))) { @@ -3253,24 +3254,28 @@ int yylex(PERL_YYLEX_PARAM_DECL) sv_setpv(PL_subname,"__ANON__"); PREBLOCK(LSTOPSUB); } - } else - PL_last_proto = NULL; + } PL_nextval[PL_nexttoke].opval = yylval.opval; PL_expect = XTERM; force_next(WORD); TOKEN(NOAMP); } + /* It could be a prototypical bearword. */ + if (PL_last_lop_op == OP_ENTERSUB && PL_last_proto && + PL_last_proto[PL_last_proto[0] == ';' ? 1 : 0] == '*') + { + PL_last_proto = Nullch; + TOKEN(WORD); + } + if (PL_hints & HINT_STRICT_SUBS && lastchar != '-' && strnNE(s,"->",2) && PL_last_lop_op != OP_TRUNCATE && /* S/F prototype in opcode.pl */ PL_last_lop_op != OP_ACCEPT && PL_last_lop_op != OP_PIPE_OP && - PL_last_lop_op != OP_SOCKPAIR && - !(PL_last_lop_op == OP_ENTERSUB - && PL_last_proto - && PL_last_proto[PL_last_proto[0] == ';' ? 1 : 0] == '*')) + PL_last_lop_op != OP_SOCKPAIR) { warn( "Bareword \"%s\" not allowed while \"strict subs\" in use", |