From 0607a031722131972674eee16dc34d716e3e09f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 25 Apr 2024 22:55:21 +0300 Subject: [PATCH] d --- v3/memory.cpp | 8 ++++---- v3/tPythonC++/CPP.py | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) 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)