diff lwasm/pass1.c @ 375:71f507f404f1

Add "testmode" pragma Add a pragma to allow testing more easily. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:35:16 -0600
parents 8e25147c2aa8
children 80d615a6642c
line wrap: on
line diff
--- a/lwasm/pass1.c	Mon Jul 13 20:31:56 2015 -0600
+++ b/lwasm/pass1.c	Mon Jul 13 20:35:16 2015 -0600
@@ -263,6 +263,14 @@
 		}
 		if (*tok)
 		{
+			if (CURPRAGMA(cl, PRAGMA_TESTMODE))
+			{
+				/* in test mode, terminate the line here so we don't affect the parsers */
+				/* (cl -> ltext retains the full, unmodified string) */
+				char *t = strstr(p1, ";.");
+				if (t) *t = 0;
+			}
+
 			// look up operation code
 			lw_free(sym);
 			sym = lw_strndup(tok, p1 - tok);