Михаил Капелько 6 months ago
parent
commit
0607a03172
2 changed files with 14 additions and 8 deletions
  1. +4
    -4
      v3/memory.cpp
  2. +10
    -4
      v3/tPythonC++/CPP.py

+ 4
- 4
v3/memory.cpp View File

@@ -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;
}


+ 10
- 4
v3/tPythonC++/CPP.py View File

@@ -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)


Loading…
Cancel
Save