diff src/expr.c @ 40:d2cee0c335e7

adjusted symbol rules to accept symbols starting with @ but not @<digit>
author lost
date Sat, 03 Jan 2009 19:41:39 +0000
parents efa19ec69df9
children 7eafdb3a8074
line wrap: on
line diff
--- a/src/expr.c	Sat Jan 03 19:20:44 2009 +0000
+++ b/src/expr.c	Sat Jan 03 19:41:39 2009 +0000
@@ -30,9 +30,7 @@
 
 #include "expr.h"
 #include "util.h"
-
-// this definition is in lwasm.h but we don't need the whole file here
-extern void debug_message(int level, const char *fmt, ...);
+#include "lwasm.h"
 
 lwasm_expr_stack_t *lwasm_expr_stack_create(void)
 {
@@ -365,7 +363,9 @@
 		lwasm_expr_term_free(t);
 		return 0;
 	}
-	else if (**p == '@')
+	// an @ followed by a digit is an octal number
+	// but if it's followed by anything else, it is a symbol
+	else if (**p == '@' && isdigit(*(*p + 1)))
 	{
 		// octal constant
 		int val = 0;