diff lwasm/pseudo.c @ 379:d791d47afc48

Add m80ext pragma for Macro-80C compatibility and ignore END in includes For compatibility with Macro-80C source, add pragma for it. Also implement ignoring END in include files rather than treating it as the total end of assembly. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:59:02 -0600
parents 8e25147c2aa8
children e3f4aaa2a4e8
line wrap: on
line diff
--- a/lwasm/pseudo.c	Mon Jul 13 20:56:48 2015 -0600
+++ b/lwasm/pseudo.c	Mon Jul 13 20:59:02 2015 -0600
@@ -95,9 +95,13 @@
 {
 	lw_expr_t addr;
 	
-	as -> endseen = 1;
 	l -> len = 0;
-	
+
+	if (CURPRAGMA(l, PRAGMA_M80EXT) && input_isinclude(as))
+		return;	/* ignore END inside includes */
+
+	as->endseen = 1;
+
 	if (as -> output_format != OUTPUT_DECB)
 	{
 		skip_operand(p);
@@ -123,7 +127,10 @@
 EMITFUNC(pseudo_emit_end)
 {
 	lw_expr_t addr;
-	
+
+	if (CURPRAGMA(l, PRAGMA_M80EXT) && input_isinclude(as))
+		return;	/* ignore END inside includes */
+
 	addr = lwasm_fetch_expr(l, 0);
 	
 	if (addr)