changeset 411:cac204676434

Allow symbols to start with digits if they contain $, ?, or @; numbered locals
author lost@l-w.ca
date Mon, 09 Aug 2010 00:10:24 -0600
parents acaafc70044b
children 35a0b086bf4a
files lwasm/pass1.c lwasm/symbol.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pass1.c	Sun Aug 08 23:47:16 2010 -0600
+++ b/lwasm/pass1.c	Mon Aug 09 00:10:24 2010 -0600
@@ -151,6 +151,8 @@
 				p1++;
 			if (!*p1 && !isspace(*p1))
 				p1 = line;
+			else if (*p1 && !isspace(*p1))
+				p1 = line;
 			else if (*p1 && isspace(*p1))
 				p1++;
 		}
--- a/lwasm/symbol.c	Sun Aug 08 23:47:16 2010 -0600
+++ b/lwasm/symbol.c	Mon Aug 09 00:10:24 2010 -0600
@@ -88,7 +88,12 @@
 
 	if (!(flags & symbol_flag_nocheck))
 	{
-		if (*sym < 0x80 && !strchr(SSYMCHARS, *sym))
+		if (!sym || !*sym)
+		{
+			lwasm_register_error(as, cl, "Bad symbol (%s)", sym);
+			return NULL;
+		}
+		if (*sym < 0x80 && (!strchr(SSYMCHARS, *sym) && !strchr(sym + 1, '$') && !strchr(sym + 1, '@') && !strchr(sym + 1, '?')))
 		{
 			lwasm_register_error(as, cl, "Bad symbol (%s)", sym);
 			return NULL;