add missing file from change#1943
[p5sagit/p5-mst-13.2.git] / cop.h
diff --git a/cop.h b/cop.h
index f15b1e1..98ae91f 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -199,7 +199,7 @@ struct block {
        pm               = cx->blk_oldpm,                               \
        gimme            = cx->blk_gimme;                               \
        DEBUG_l( PerlIO_printf(PerlIO_stderr(), "Leaving block %ld, type %s\n",         \
-                   (long)cxstack_ix+1,block_type[cx->cx_type]); )
+                   (long)cxstack_ix+1,block_type[CxTYPE(cx)]); )
 
 /* Continue a block elsewhere (NEXT and REDO). */
 #define TOPBLOCK(cx) cx  = &cxstack[cxstack_ix],                       \
@@ -262,12 +262,14 @@ struct subst {
        rxres_free(&cx->sb_rxres)
 
 struct context {
-    I32                cx_type;        /* what kind of context this is */
+    U32                cx_type;        /* what kind of context this is */
     union {
        struct block    cx_blk;
        struct subst    cx_subst;
     } cx_u;
 };
+
+#define CXTYPEMASK     0xff
 #define CXt_NULL       0
 #define CXt_SUB                1
 #define CXt_EVAL       2
@@ -275,6 +277,12 @@ struct context {
 #define CXt_SUBST      4
 #define CXt_BLOCK      5
 
+/* private flags for CXt_EVAL */
+#define CXp_REAL       0x00000100      /* truly eval'', not a lookalike */
+
+#define CxTYPE(c)      ((c)->cx_type & CXTYPEMASK)
+#define CxREALEVAL(c)  (((c)->cx_type & (CXt_EVAL|CXp_REAL)) == (CXt_EVAL|CXp_REAL))
+
 #define CXINC (cxstack_ix < cxstack_max ? ++cxstack_ix : (cxstack_ix = cxinc()))
 
 /* "gimme" values */