diff src/pseudo.c @ 63:d85ba47b1e8f

Moved symbol registration so symbols that are in skipped code do not get registered and so EQU/SET can do their own registration
author lost
date Mon, 05 Jan 2009 01:17:23 +0000
parents 035b95a3690f
children aaddd47219b4
line wrap: on
line diff
--- a/src/pseudo.c	Mon Jan 05 00:57:37 2009 +0000
+++ b/src/pseudo.c	Mon Jan 05 01:17:23 2009 +0000
@@ -354,7 +354,6 @@
 
 OPFUNC(pseudo_equ)
 {
-	lwasm_expr_stack_t *s;
 	int rval;
 
 	// equ is not needed to be processed on pass 2	
@@ -367,27 +366,19 @@
 		return;
 	}
 
-	s = lwasm_evaluate_expr(as, l, *p, NULL);
-	
-	if (!s)
-	{
-		register_error(as, l, 1, "Bad expression");
+	if (lwasm_expr_result(as, l, p, EXPR_PASS1CONST, &rval) < 0)
 		rval = 0;
-	}
-	else
-	{
-		if (!lwasm_expr_is_constant(s))
-			register_error(as, l, 1, "Invalid incomplete reference (pass 1)");
-		rval = lwasm_expr_get_value(s);
-		lwasm_expr_stack_free(s);
-	}
+
 	l -> symaddr = rval & 0xFFFF;
 	l -> addrset = 2;
-	if (strchr(l -> sym, '@') || strchr(l -> sym, '?'))
-		lwasm_set_symbol(as, l -> sym, as -> context, l -> symaddr);
-	else
-		lwasm_set_symbol(as, l -> sym, -1, l -> symaddr);
+	
+	lwasm_register_symbol(as, l, l -> sym, rval);
 }
+
+OPFUNC(pseudo_set)
+{
+}
+
 /*
 void pseudo_set(asmstate_t *as, sourceline_t *cl, char **optr)
 {