changeset 85:8fa52c3f2970

Make *pragma work correctly
author lost@l-w.ca
date Wed, 25 May 2011 21:59:58 -0600
parents 16a72d9b6eb6
children 00ddfdc1e1e3
files lwasm/pass1.c lwasm/pragma.c
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pass1.c	Wed May 25 21:42:01 2011 -0600
+++ b/lwasm/pass1.c	Wed May 25 21:59:58 2011 -0600
@@ -195,8 +195,8 @@
 		else
 			stspace = 0;
 
-		if (*p1 == '*' || *p1 == ';' || *p1 == '#')
-			goto nextline;
+//		if (*p1 == '*' || *p1 == ';' || *p1 == '#')
+//			goto nextline;
 		if (!*p1)
 		{
 			// nothing but whitespace - context break
@@ -210,6 +210,8 @@
 		
 		if (*p1 == ':' || *p1 == '=' || stspace == 0)
 		{
+			if (*tok == '*' || *tok == ';' || *tok == '#')
+				goto nextline;
 			// have a symbol here
 			sym = lw_strndup(tok, p1 - tok);
 			if (*p1 == ':')
@@ -255,6 +257,9 @@
 					break;
 			}
 			
+			if (instab[opnum].opcode == NULL && (*tok == '*' || *tok == ';' || *tok == '#'))
+				goto nextline;
+			
 			// p1 points to the start of the operand
 			
 			// if we're inside a macro definition and not at ENDM,
--- a/lwasm/pragma.c	Wed May 25 21:42:01 2011 -0600
+++ b/lwasm/pragma.c	Wed May 25 21:59:58 2011 -0600
@@ -123,7 +123,7 @@
 PARSEFUNC(pseudo_parse_starpragma)
 {
 	char *ps, *t;
-	
+
 	for (t = *p; *t && !isspace(*t); t++)
 		/* do nothing */ ;