From: Florian Ragwitz Date: Thu, 9 Apr 2009 00:35:42 +0000 (+0000) Subject: Don't issue the linestr callback if the const op comes from m//, s///, qr// or tr///. X-Git-Tag: 0.005000~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d96afb78ab58b0cd511077d97286175ff52692f;p=p5sagit%2FDevel-Declare.git Don't issue the linestr callback if the const op comes from m//, s///, qr// or tr///. --- diff --git a/Declare.xs b/Declare.xs index 37e0bdc..7e96835 100644 --- a/Declare.xs +++ b/Declare.xs @@ -340,6 +340,18 @@ STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) { if (dd_flags == -1) return o; + if (previous_op != NULL) { + switch (previous_op->op_type) { + case OP_QR: + case OP_MATCH: + case OP_SUBST: + case OP_TRANS: + return o; + break; + default: + break; + } + } dd_linestr_callback(aTHX_ "const", name); return o;