|
|
@@ -100,13 +100,18 @@ def translateStatement(s, state): |
|
|
|
|
|
|
|
# Keep "if not (" |
|
|
|
if ss == "if not (": |
|
|
|
state.isIf = True |
|
|
|
return f"{indentation}if !(" |
|
|
|
state.isIfNot = True |
|
|
|
return f"{indentation}if (!(" |
|
|
|
|
|
|
|
# ): -> } |
|
|
|
if ss == "):": |
|
|
|
state.isIf = False |
|
|
|
return f"{indentation}) {{" |
|
|
|
# if |
|
|
|
if state.isIf: |
|
|
|
state.isIf = False |
|
|
|
return f"{indentation}) {{" |
|
|
|
# if not |
|
|
|
state.isIfNot = False |
|
|
|
return f"{indentation})) {{" |
|
|
|
|
|
|
|
ending = ";" |
|
|
|
if state.isIf: |
|
|
@@ -132,6 +137,7 @@ class CPP: |
|
|
|
def __init__(self, fn): |
|
|
|
self.fn = fn |
|
|
|
self.isIf = False |
|
|
|
self.isIfNot = False |
|
|
|
|
|
|
|
def translate(self): |
|
|
|
returnType = translateType(self.fn.returnType) |
|
|
|