changeset 244:c8bcc396ec59 2.x

Allow symbols to appear after whitespace when terminated by :
author lost
date Wed, 16 Sep 2009 00:29:06 +0000
parents f9f01a499525
children eb499c146c0d
files ChangeLog lwasm/parse.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Sep 15 03:16:17 2009 +0000
+++ b/ChangeLog	Wed Sep 16 00:29:06 2009 +0000
@@ -17,6 +17,8 @@
     without an actual external reference - a zero-width external reference
     so to speak [LWASM,LWLINK]
 [+] Decode known incomplete expression flags [LWOBJDUMP]
+[+] Allow symbol to appear after whitespace if specified with a trailing :
+    to improve compatibility with gcc6809 output [LWASM]
 [b] Treat incomplete reference flags as specified in docs [LWLINK]
 
 Version 2.5
--- a/lwasm/parse.c	Tue Sep 15 03:16:17 2009 +0000
+++ b/lwasm/parse.c	Wed Sep 16 00:29:06 2009 +0000
@@ -70,6 +70,7 @@
 		return;
 	
 	// if we start with a non-space character, it's a symbol
+symbolagain:
 	if (!isspace(*p))
 	{
 		// we have a symbol specified here
@@ -113,6 +114,12 @@
 	memcpy(opc, p, p2 - p);
 	opc[p2 - p] = '\0';
 
+	if (strchr(opc, ':'))
+	{
+		lwasm_free(opc);
+		goto symbolagain;
+	}
+
 	l -> forceglobal = 0;
 	// if the opcode contains an =, treat it as "symbol = expr"
 	if (!sym && strchr(opc, '='))