| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-09 23:04:08 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-08-09 23:04:08 +0200 |
| commit | 00887ec8349cd51e3253dfb578fe72403abb1d41 (patch) | |
| tree | 5a802cc8cd9a49433e6dc0d6d2d527cfde4cae5e | |
| parent | dbcc7a573200a57600fa550c75201791903c4535 (diff) | |
Fixes aforementioned index_of issue.
3 files changed, 26 insertions, 24 deletions
diff --git a/data/tests/collections.fate b/data/tests/collections.fate index 871b122..1642e94 100644 --- a/data/tests/collections.fate +++ b/data/tests/collections.fate @@ -139,22 +139,15 @@ (assert (= 18 (size (var int_list_a))) FAILED: size list N) -;;(assert (= 2 (access int_list_a 0)) FAILED: size list M_BIS (access int_list_a 0)) -;;(assert (= 5 (access int_list_a 3)) FAILED: size list N_BIS (access int_list_a 3)) -;;(assert (= 2 (count 10 int_list_a)) FAILED: size list O) -;;(assert (= 0 (count 99 int_list_a)) FAILED: size list P) - -(assert (false) test a) -(index_of 3 int_list_a) -(assert (false) test b) -(index_of 3 int_list_a) -(assert (false) test c) -(index_of 3 int_list_a) - -;;(assert (= 1 (index_of 3 int_list_a)) FAILED: size list Q (index_of 2 int_list_a)) -;;(assert (= 1 (index_of 3 int_list_a)) FAILED: size list R (index_of 3 int_list_a)) -;;(assert (= -1 (index_of 333 int_list_a)) FAILED: size list S) -;;(assert (not (is_member 99 int_list_a)) FAILED: size list T) -;;(assert (is_member 10 int_list_a) FAILED: size list U) +(assert (= 2 (access int_list_a 0)) FAILED: size list M_BIS (access int_list_a 0)) +(assert (= 5 (access int_list_a 3)) FAILED: size list N_BIS (access int_list_a 3)) +(assert (= 2 (count 10 int_list_a)) FAILED: size list O) +(assert (= 0 (count 99 int_list_a)) FAILED: size list P) + +(assert (= 2 (access int_list_a (index_of 2 int_list_a))) FAILED: size list Q (index_of 2 int_list_a)) +(assert (= 3 (access int_list_a (index_of 3 int_list_a))) FAILED: size list R (index_of 3 int_list_a)) +(assert (= -1 (index_of 333 int_list_a)) FAILED: size list S) +(assert (not (is_member 99 int_list_a)) FAILED: size list T) +(assert (is_member 10 int_list_a) FAILED: size list U) (end) 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 2731e78..7a9d223 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 @@ -177,6 +177,8 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor n.get_parent().get_visited_by(cc); + assimilate(cc); + target_type = TypeCompiler.compile(compiler, n.get_type()); if (target_type.equals(cc.get_computation().get_type())) @@ -1324,10 +1326,16 @@ implements tonkadur.fate.v1.lang.meta.ComputationVisitor ) throws Throwable { - n.get_value().get_visited_by(this); + final ComputationCompiler cc; + + cc = new ComputationCompiler(compiler); + + n.get_value().get_visited_by(cc); + + assimilate(cc); result_as_computation = - new RichText(Collections.singletonList(get_computation())); + new RichText(Collections.singletonList(cc.get_computation())); } @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 3ae8a3a..3bbde05 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 @@ -194,7 +194,6 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor ae.get_collection().get_visited_by(reference_compiler); - collection_as_ref = reference_compiler.get_ref(); if (reference_compiler.has_init()) { @@ -206,6 +205,8 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor result.add(element_compiler.get_init()); } + collection_as_ref = reference_compiler.get_ref(); + result.add ( new SetValue @@ -320,13 +321,13 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor c.get_collection().get_visited_by(reference_compiler); - collection_ref = reference_compiler.get_ref(); - if (reference_compiler.has_init()) { result.add(reference_compiler.get_init()); } + collection_ref = reference_compiler.get_ref(); + result.add ( Clear.generate @@ -359,13 +360,13 @@ implements tonkadur.fate.v1.lang.meta.InstructionVisitor n.get_collection().get_visited_by(reference_compiler); - collection_ref = reference_compiler.get_ref(); - if (reference_compiler.has_init()) { result.add(reference_compiler.get_init()); } + collection_ref = reference_compiler.get_ref(); + result.add ( ReverseList.generate |


