changeset 259:0c4b3e8b4d0b

Fix pragma nosymbolcase interaction with -D Actually make --pragma=nosymbolcase flag symbols defined subsequently on the command line as not being case sensitive. Otherwise, things don't behave quite as expected. There is still a gotcha in that if the -D appears before the --pragma option, the symbol will still be case sensitive.
author William Astle <lost@l-w.ca>
date Fri, 01 Feb 2013 00:04:19 -0700
parents ebda5c96665e
children c5b1dd523ac4
files lwasm/pragma.c lwasm/symbol.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pragma.c	Thu Jan 31 19:34:54 2013 -0700
+++ b/lwasm/pragma.c	Fri Feb 01 00:04:19 2013 -0700
@@ -73,6 +73,7 @@
 	while (np)
 	{
 		p = lw_token(np, ',', &np);
+		debug_message(as, 200, "Setting pragma %s", p);
 		for (i = 0; set_pragmas[i].setstr; i++)
 		{
 			if (!strcasecmp(p, set_pragmas[i].setstr))
--- a/lwasm/symbol.c	Thu Jan 31 19:34:54 2013 -0700
+++ b/lwasm/symbol.c	Fri Feb 01 00:04:19 2013 -0700
@@ -185,6 +185,10 @@
 	{
 		nse -> flags |= symbol_flag_nocase;
 	}
+	if (!cl && (as -> pragmas & PRAGMA_SYMBOLNOCASE))
+	{
+		nse -> flags |= symbol_flag_nocase;
+	}
 	nse -> value = lw_expr_copy(val);
 	nse -> symbol = lw_strdup(sym);
 	nse -> right = NULL;