Make armasm2as.pl handle parentheses in macro IF conditions - Bug 3054 GCC_SURGE
authorMike Kinghan <mikek@symbian.org>
Mon, 21 Jun 2010 18:05:07 +0100
branchGCC_SURGE
changeset 52 949d0e782de1
parent 50 abc8110ed7af
child 53 d23856282806
Make armasm2as.pl handle parentheses in macro IF conditions - Bug 3054
sbsv1_os/e32toolp/e32util/armasm2as.pl
--- a/sbsv1_os/e32toolp/e32util/armasm2as.pl	Fri Jun 11 16:27:38 2010 +0100
+++ b/sbsv1_os/e32toolp/e32util/armasm2as.pl	Mon Jun 21 18:05:07 2010 +0100
@@ -9,6 +9,7 @@
 # Nokia Corporation - initial contribution.
 #
 # Contributors:
+# Mike Kinghan, mikek@symbian.org, for Symbian Foundation
 #
 # Description:
 # e32toolp\e32util\armasm2as.pl
@@ -288,7 +289,8 @@
 	$val =~ s/\{TRUE\}/(1)/g;
 	$val =~ s/\{FALSE\}/(0)/g;
 
-	my @lops = split( /(\s*\:LAND\:\s*|\s*\:LOR\:\s*|\s*\:LNOT\:\s*|\s*\:DEF\:\s*)/, $val );
+	my @lops = split( /(\s*\:LAND\:\s*|\s*\:LOR\:\s*|\s*\:LNOT\:\s*|\s*\:DEF\:\s*|\s*\(\s*|\s*\)\s*)/, $val );
+	my @lops2;
 	foreach (@lops) {
 		s/\s*\:LAND\:\s*/\:LAND\:/go;
 		s/\s*\:LOR\:\s*/\:LOR\:/go;
@@ -306,7 +308,7 @@
 				push @$outref, "\t.ifdef $sym\n\t.set __defined__$sym, 1\n\t.else\n\t.set __defined__$sym, 0\n\t.endif\n";
 				push @lops2, " __defined__$sym ";
 			} else {
-				die "Bad :DEF: operand\n";
+				die "Bad :DEF: operand $sym\n";
 			}
 		} elsif ($x eq ':LAND:') {
 			push @lops2, ' && ';