diff --git a/v3/memory.cpp b/v3/memory.cpp index 1870f46..53323cb 100644 --- a/v3/memory.cpp +++ b/v3/memory.cpp @@ -51,10 +51,10 @@ memory_Context memory_selectItem( memory_Context memory_shouldDeselectMismatchedItems( memory_Context c ) { - if !( - c.recentField == "selectedItems" && - c.selectedItems.size() == 2 - ) { + if (!( + c.recentField == "selectedItems" &&; + c.selectedItems.size() == 2; + )) { c.recentField = "none"; return c; } diff --git a/v3/tPythonC++/CPP.py b/v3/tPythonC++/CPP.py index cf2e746..6c8acb1 100644 --- a/v3/tPythonC++/CPP.py +++ b/v3/tPythonC++/CPP.py @@ -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)