Browse Source

Fixed ++ and -- appearing in translated c++ code.

Mark Sibly 8 years ago
parent
commit
7509d289ee
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/mx2cc/translator_cpp.monkey2

+ 5 - 1
src/mx2cc/translator_cpp.monkey2

@@ -1871,7 +1871,11 @@ Class Translator_CPP Extends Translator
 
 
 		If etype t="int("+t+")"
 		If etype t="int("+t+")"
 		
 		
-		t=op+t
+		If (op="+" Or op="-") And t.StartsWith( op )	'deal with -- and ++
+			t=op+"("+t+")"
+		Else
+			t=op+t
+		Endif
 		
 		
 		If etype t=EnumName( etype )+"("+t+")"
 		If etype t=EnumName( etype )+"("+t+")"