about summary refs log tree commit diff
path: root/Src/Zle/zle.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle.h')
-rw-r--r--Src/Zle/zle.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Src/Zle/zle.h b/Src/Zle/zle.h
index f23d7aa2c..ff4d81b47 100644
--- a/Src/Zle/zle.h
+++ b/Src/Zle/zle.h
@@ -279,3 +279,16 @@ enum {
     ZSL_COPY = 1,		/* Copy the argument, don't modify it */
     ZSL_TOEND = 2,		/* Go to the end of the new line */
 };
+
+#ifdef DEBUG
+#define STRINGIFY_LITERAL(x)	# x
+#define STRINGIFY(x)		STRINGIFY_LITERAL(x)
+#define ERRMSG(x)		(__FILE__ ":" STRINGIFY(__LINE__) ": " x)
+#define METACHECK()		\
+	DPUTS(zlemetaline == NULL, ERRMSG("line not metafied"))
+#define UNMETACHECK()		\
+	DPUTS(zlemetaline != NULL, ERRMSG("line metafied"))
+#else
+#define METACHECK()
+#define UNMETACHECK()
+#endif