diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-27 21:07:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-27 21:07:29 +0000 |
commit | 1c3923b3a96ff7f6cc3c12f9f8554b36d12daf1b (patch) | |
tree | dd1a34668db53ec127da52a0c2d831fa9340c2cc /toke.c | |
parent | 88c74d4bc751d901cc16d8775bf5f51c45cc0228 (diff) | |
download | perl-1c3923b3a96ff7f6cc3c12f9f8554b36d12daf1b.tar.gz |
autoquote barewords followed by newline and arrow properly
(variant of fix suggested by Rick Delaney and M.J.T. Guy)
p4raw-id: //depot/perl@5977
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -3619,7 +3619,7 @@ Perl_yylex(pTHX) tmp = keyword(PL_tokenbuf, len); /* Is this a word before a => operator? */ - if (strnEQ(d,"=>",2)) { + if (*d == '=' && d[1] == '>') { CLINE; yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(PL_tokenbuf,0)); yylval.opval->op_private = OPpCONST_BARE; @@ -3774,10 +3774,18 @@ Perl_yylex(pTHX) } } - /* If followed by a paren, it's certainly a subroutine. */ PL_expect = XOPERATOR; s = skipspace(s); + + /* Is this a word before a => operator? */ + if (*s == '=' && s[1] == '>') { + CLINE; + sv_setpv(((SVOP*)yylval.opval)->op_sv, PL_tokenbuf); + TERM(WORD); + } + + /* If followed by a paren, it's certainly a subroutine. */ if (*s == '(') { CLINE; if (gv && GvCVu(gv)) { |