summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-09-19 21:22:48 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-09-19 21:22:48 +0200
commit6ac2d50fc176b0c77890b6ab6ec4b0db4e4d08a2 (patch)
tree1b1d23e15472f40293fb9b73aa0652534505eed2
parent74b263f6b679a3b1ddda0ffb2fc6938efede0721 (diff)
Still has issues.
File "/my/src/tonkadur-python-engine/tonkadur.py", line 266, in run result["content"] = self.compute(instruction['content']) File "/my/src/tonkadur-python-engine/tonkadur.py", line 78, in compute result['content'].append(self.compute(c)) File "/my/src/tonkadur-python-engine/tonkadur.py", line 176, in compute result['content'].append(self.compute(c)) File "/my/src/tonkadur-python-engine/tonkadur.py", line 176, in compute result['content'].append(self.compute(c)) File "/my/src/tonkadur-python-engine/tonkadur.py", line 203, in compute target = target[addr] TypeError: list indices must be integers or slices, not str I assume that somewhere, an address is being used instead of the value.
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java5
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java36
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/util/PopElement.java2
3 files changed, 41 insertions, 2 deletions
diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java
index 64f7220..25f48e8 100644
--- a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java
+++ b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java
@@ -1335,6 +1335,9 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor
r = reserve(TypeCompiler.compile(compiler, n.get_type()));
init_instructions.add(new Initialize(r.get_address()));
+
+ result_as_address = r.get_address();
+ result_as_computation = r.get_value();
}
@@ -2873,6 +2876,7 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor
throws Throwable
{
/* TODO */
+ System.err.println("[P] Using unimplemented SubListComputation.");
}
@Override
@@ -3085,6 +3089,7 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor
throws Throwable
{
/* TODO */
+ System.err.println("[P] Using unimplemented SortComputation.");
}
@Override
diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java
index 0f23a34..ada630b 100644
--- a/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java
+++ b/src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java
@@ -635,6 +635,7 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor
throws Throwable
{
/* TODO */
+ System.err.println("[P] Using unimplemented Sort.");
}
@Override
@@ -1050,6 +1051,7 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor
throws Throwable
{
/* TODO */
+ System.err.println("[P] Using unimplemented SubList.");
}
@Override
@@ -1127,7 +1129,39 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor
)
throws Throwable
{
- /* TODO */
+ final ComputationCompiler address_compiler, element_compiler;
+
+ address_compiler = new ComputationCompiler(compiler);
+ element_compiler = new ComputationCompiler(compiler);
+
+ n.get_collection().get_visited_by(address_compiler);
+
+ if (address_compiler.has_init())
+ {
+ result.add(address_compiler.get_init());
+ }
+
+ n.get_storage_pointer().get_visited_by(element_compiler);
+
+ if (element_compiler.has_init())
+ {
+ result.add(element_compiler.get_init());
+ }
+
+ result.add
+ (
+ PopElement.generate
+ (
+ compiler.registers(),
+ compiler.assembler(),
+ address_compiler.get_address(),
+ element_compiler.get_computation(),
+ n.is_from_left()
+ )
+ );
+
+ address_compiler.release_registers(result);
+ element_compiler.release_registers(result);
}
@Override
diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/util/PopElement.java b/src/core/src/tonkadur/wyrd/v1/compiler/util/PopElement.java
index 9e30aee..3da9a89 100644
--- a/src/core/src/tonkadur/wyrd/v1/compiler/util/PopElement.java
+++ b/src/core/src/tonkadur/wyrd/v1/compiler/util/PopElement.java
@@ -71,7 +71,7 @@ public class PopElement
new RelativeAddress
(
collection,
- target_index,
+ new Cast(target_index, Type.STRING),
((PointerType) element_holder.get_type()).get_target_type()
)
)