From 5b3884e1850050dcf2c6928b5ee55b65ef6d989e Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 3 Nov 2020 18:04:07 +0100 Subject: ... --- .../wyrd/v1/compiler/fate/v1/ComputationCompiler.java | 11 ++++++++++- .../wyrd/v1/compiler/fate/v1/InstructionCompiler.java | 11 ++++++++++- src/core/src/tonkadur/wyrd/v1/compiler/util/InsertAt.java | 1 - 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'src/core') 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)); -- cgit v1.2.3-70-g09d2