diff options
author | Zefram <zefram@fysh.org> | 2017-12-06 00:09:42 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-06 00:09:42 +0000 |
commit | f68519ee3f12e5ba41a022ef88ce3d6c3901807f (patch) | |
tree | d28e0491a89f13c137a35d52c17fb0f6e37af773 /toke.c | |
parent | 84ac76a7475419f4ac6e5a6935522f7b7ebb0e2c (diff) | |
download | perl-f68519ee3f12e5ba41a022ef88ce3d6c3901807f.tar.gz |
add "whereis"
"whereis" is like "whereso" except that it performs an implicit
smartmatch.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -8844,13 +8844,15 @@ Perl_yylex(pTHX) case KEY_vec: LOP(OP_VEC,XTERM); + case KEY_whereis: case KEY_whereso: if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_NONEXPR) return REPORT(0); - pl_yylval.ival = CopLINE(PL_curcop); + pl_yylval.ival = tmp == KEY_whereis; + /* diag_listed_as: whereso is experimental */ Perl_ck_warner_d(aTHX_ packWARN(WARN_EXPERIMENTAL__SMARTMATCH), - "whereso is experimental"); + "%" UTF8f " is experimental", UTF8fARG(UTF, len, PL_tokenbuf)); OPERATOR(WHERESO); case KEY_while: |