aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2021-10-24 21:38:07 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2021-10-24 21:38:07 +0200
commit54cccfd693939f0f01b0b36767690097cc1c5f90 (patch)
treeafbb1823a6b44e3f602e447dcc1d256c1c23393e
parenta322d9bdbdd497fdcc515964a033af40a7893659 (diff)
downloadtonkadur-python-interpreter-54cccfd693939f0f01b0b36767690097cc1c5f90.zip
tonkadur-python-interpreter-54cccfd693939f0f01b0b36767690097cc1c5f90.tar.bz2
Commits forgotten changes.
-rw-r--r--tonkadur.py17
-rw-r--r--tonkadur_ui.py2
2 files changed, 14 insertions, 5 deletions
diff --git a/tonkadur.py b/tonkadur.py
index 7353c87..970a362 100644
--- a/tonkadur.py
+++ b/tonkadur.py
@@ -177,7 +177,16 @@ class Tonkadur:
result['effect'] = None
result['content'] = []
for c in computation['content']:
- result['content'].append(self.compute(c))
+ cc = self.compute(c)
+
+ if (
+ (type(cc) is dict)
+ and ('effect' in cc)
+ and cc['effect'] == None
+ ):
+ result['content'].extend(cc['content'])
+ else:
+ result['content'].append(cc)
return result
elif (computation_category == "newline"):
@@ -187,7 +196,7 @@ class Tonkadur:
return result
elif (computation_category == "extra_computation"):
- print("[E] Unhandled extra computation " + computation['name'])
+ print("[E] Unhandled extra computation " + str(computation))
return None
elif (computation_category == "size"):
@@ -206,8 +215,8 @@ class Tonkadur:
access = self.compute(computation['reference'])
#print("(value_of " + str(access) + ")")
for addr in access:
- # print("Reading " + str(addr) + " of " + str(target))
- # print("addr = " + str(addr))
+ #print("Reading " + str(addr) + " of " + str(target))
+ #print("addr = " + str(addr))
target = target[addr]
# if (isinstance(target, list)):
# print("That's a list.")
diff --git a/tonkadur_ui.py b/tonkadur_ui.py
index 2dc563e..6fb5b5b 100644
--- a/tonkadur_ui.py
+++ b/tonkadur_ui.py
@@ -99,7 +99,7 @@ try:
current_choice = 0;
for choice in result['options']:
- if (choice["category"] == "option"):
+ if (choice["category"] == "text_option"):
print(
str(current_choice)
+ ". "