summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-12-25 12:03:00 +0000
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:19:17 +0000
commitd9203e036f608afd529c54a69f854a528171f784 (patch)
tree5530eb517d91189f96c24c7a0c9d79e06c35ab14 /cop.h
parente4592eb4ea59b6f1cb2353097c028e1ce656ae9d (diff)
downloadperl-d9203e036f608afd529c54a69f854a528171f784.tar.gz
Document CxLVAL()
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/cop.h b/cop.h
index c9862f4655..6ffd514cc9 100644
--- a/cop.h
+++ b/cop.h
@@ -819,6 +819,18 @@ struct block_loop {
#define CxLABEL_len(c,len) (0 + CopLABEL_len((c)->blk_oldcop, len))
#define CxLABEL_len_flags(c,len,flags) (0 + CopLABEL_len_flags((c)->blk_oldcop, len, flags))
#define CxHASARGS(c) (((c)->cx_type & CXp_HASARGS) == CXp_HASARGS)
+
+/* CxLVAL(): the lval flags of the call site: the relevant flag bits from
+ * the op_private field of the calling pp_entersub (or its caller's caller
+ * if the caller's lvalue context isn't known):
+ * OPpLVAL_INTRO: sub used in lvalue context, e.g. f() = 1;
+ * OPpENTERSUB_INARGS (in conjunction with OPpLVAL_INTRO): the
+ * function is being used as a sub arg or as a referent, e.g.
+ * g(...,f(),...) or $r = \f()
+ * OPpDEREF: 2-bit mask indicating e.g. f()->[0].
+ * Note the contrast with CvLVALUE(), which is a property of the sub
+ * rather than the call site.
+ */
#define CxLVAL(c) (0 + ((c)->blk_u16 & 0xff))