summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-11-03 18:04:07 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-11-03 18:04:07 +0100
commit5b3884e1850050dcf2c6928b5ee55b65ef6d989e (patch)
tree074180c2e0f29320ac7a2b3eb08a789eb67210d4 /src
parentc2cbe46aef61efee72bf5af7771a78d16472a4e2 (diff)
...
Diffstat (limited to 'src')
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/ComputationCompiler.java11
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/fate/v1/InstructionCompiler.java11
-rw-r--r--src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java1
3 files changed, 20 insertions, 3 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 0b316e1..30fe7b8 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
@@ -2170,7 +2170,16 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor
collection_size.get_value()
),
collection_size.get_value(),
- index_compiler.get_computation()
+ new IfElseComputation
+ (
+ Operation.less_than
+ (
+ index_compiler.get_computation(),
+ Constant.ZERO
+ ),
+ Constant.ZERO,
+ index_compiler.get_computation()
+ )
)
)
);
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 679fcea..438dde7 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
@@ -253,7 +253,16 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor
new Size(collection_compiler.get_address())
),
new Size(collection_compiler.get_address()),
- index_compiler.get_computation()
+ new IfElseComputation
+ (
+ Operation.less_than
+ (
+ index_compiler.get_computation(),
+ Constant.ZERO
+ ),
+ Constant.ZERO,
+ index_compiler.get_computation()
+ )
)
)
);
diff --git a/src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java b/src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java
index 71c4bc1..b01e007 100644
--- a/src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java
+++ b/src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java
@@ -74,7 +74,6 @@ public class InsertAt
value_of_index = new ValueOf(index);
-
/* (set .end collection_size) */
result.add(new SetValue(end.get_address(), collection_size));