summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y19
1 files changed, 15 insertions, 4 deletions
diff --git a/perly.y b/perly.y
index 9143341bae..e103db4350 100644
--- a/perly.y
+++ b/perly.y
@@ -1257,10 +1257,21 @@ term : termbinop
TOKEN_GETMAD($2,$$,'(');
TOKEN_GETMAD($4,$$,')');
}
- | PMFUNC '(' listexpr ')' /* m//, s///, tr/// */
- { $$ = pmruntime($1, $3, 1);
- TOKEN_GETMAD($2,$$,'(');
- TOKEN_GETMAD($4,$$,')');
+ | PMFUNC /* m//, s///, qr//, tr/// */
+ {
+ if ( $1->op_type != OP_TRANS
+ && $1->op_type != OP_TRANSR
+ && (((PMOP*)$1)->op_pmflags & PMf_HAS_CV))
+ {
+ $<ival>$ = start_subparse(FALSE, CVf_ANON);
+ SAVEFREESV(PL_compcv);
+ } else
+ $<ival>$ = 0;
+ }
+ '(' listexpr ')'
+ { $$ = pmruntime($1, $4, 1, $<ival>2);
+ TOKEN_GETMAD($3,$$,'(');
+ TOKEN_GETMAD($5,$$,')');
}
| WORD
| listop