shithub: scc

Download patch

ref: 3f1579403feed901243196776461d5f02035fac7
parent: 3394d4da4e02f25e0ffbafca52f7a41c49fd6ef0
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Apr 11 14:57:45 EDT 2014

Simplify bit logical functions

All these functions were using a comparasion and letter a
call to next, and basically this is the same than accept, so
it is changed.

--- a/expr.c
+++ b/expr.c
@@ -417,10 +417,8 @@
 	register Node *np;
 
 	np = eq();
-	while (yytoken == '&') {
-		next();
+	while (accept('&'))
 		np = bitlogic(OBAND, np, eq());
-	}
 	return np;
 }
 
@@ -430,10 +428,8 @@
 	register Node *np;
 
 	np = bit_and();
-	while (yytoken == '^') {
-		next();
+	while (accept('^'))
 		np = bitlogic(OBXOR,  np, bit_and());
-	}
 	return np;
 }
 
@@ -443,10 +439,8 @@
 	register Node *np;
 
 	np = bit_xor();
-	while (yytoken == '|') {
-		next();
+	while (accept('|'))
 		np = bitlogic(OBOR, np, bit_xor());
-	}
 	return np;
 }