diff lwasm/expr.c @ 226:c8787fad0f9f

Added && and || to lwasm
author lost
date Fri, 12 Jun 2009 00:06:13 +0000
parents bae1e3ecdce1
children 1bdb4e256fc9
line wrap: on
line diff
--- a/lwasm/expr.c	Thu Jun 11 23:29:15 2009 +0000
+++ b/lwasm/expr.c	Fri Jun 12 00:06:13 2009 +0000
@@ -626,6 +626,11 @@
 		{ LWASM_OPER_MOD, "%", 150 },
 		{ LWASM_OPER_INTDIV, "\\", 150 },
 		
+		// boolean AND/OR
+		{ LWASM_OPER_AND, "&&", 25 },
+		{ LWASM_OPER_OR, "||", 25 },
+		
+		// bitwise ops
 		{ LWASM_OPER_BWAND, "&", 50 },
 		{ LWASM_OPER_BWOR, "|", 50 },
 		
@@ -652,7 +657,7 @@
 	// expecting an operator here
 	for (opern = 0; operators[opern].opernum != LWASM_OPER_NONE; opern++)
 	{
-		for (i = 0; (*p)[i] && operators[opern].operstr[i] && (*p[i] == operators[opern].operstr[i]); i++)
+		for (i = 0; (*p)[i] && operators[opern].operstr[i] && ((*p)[i] == operators[opern].operstr[i]); i++)
 			/* do nothing */ ;
 		if (operators[opern].operstr[i] == '\0')
 			break;