aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-31 00:47:50 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-31 00:47:50 +0200
commit156de860e579eef1289ae9320a2a0d9cff41c4c3 (patch)
tree2f8b5800671ac867b806b76c78d42aad182cdb1c
parent48f780650c7d92c945989b45dc781d415c85a21d (diff)
downloadtonkadur-python-interpreter-156de860e579eef1289ae9320a2a0d9cff41c4c3.zip
tonkadur-python-interpreter-156de860e579eef1289ae9320a2a0d9cff41c4c3.tar.bz2
...
-rw-r--r--tonkadur.py10
-rw-r--r--tonkadur_ui.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/tonkadur.py b/tonkadur.py
index 146bfe4..cf89976 100644
--- a/tonkadur.py
+++ b/tonkadur.py
@@ -188,15 +188,19 @@ class Tonkadur:
access = self.compute(computation['reference'])
for addr in access:
- target = target[addr]
+ if (not (addr in target)):
+ return 0
+ else:
+ target = target[addr]
return len(target)
elif (computation_category == "value_of"):
target = self.memory
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 f27efd7..b7a8f8e 100644
--- a/tonkadur_ui.py
+++ b/tonkadur_ui.py
@@ -30,7 +30,7 @@ def display_rich_text (rich_text):
str_content += display_rich_text(c)
if (not (rich_text['effect'] is None)):
- str_content = "}"
+ str_content += "}"
return str_content
args = parser.parse_args()