diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/control/parser/tree.lux | 9 | ||||
-rw-r--r-- | stdlib/source/lux/data/collection/tree.lux (renamed from stdlib/source/lux/data/collection/tree/rose.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/data/collection/tree/zipper.lux (renamed from stdlib/source/lux/data/collection/tree/rose/zipper.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/macro/poly/equivalence.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection.lux | 9 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree.lux (renamed from stdlib/source/test/lux/data/collection/tree/rose.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/tree/zipper.lux (renamed from stdlib/source/test/lux/data/collection/tree/rose/zipper.lux) | 17 |
7 files changed, 18 insertions, 22 deletions
diff --git a/stdlib/source/lux/control/parser/tree.lux b/stdlib/source/lux/control/parser/tree.lux index 1c6e21f43..50c8c8a0e 100644 --- a/stdlib/source/lux/control/parser/tree.lux +++ b/stdlib/source/lux/control/parser/tree.lux @@ -1,12 +1,11 @@ (.module: [lux #* [control - ["ex" exception (#+ exception:)]] + ["." exception (#+ exception:)]] [data ["." error (#+ Error)] - [tree - [rose (#+ Tree) - ["." zipper (#+ Zipper)]]]]] + [tree (#+ Tree) + ["." zipper (#+ Zipper)]]]] ["." //]) (type: #export (Parser t a) @@ -38,7 +37,7 @@ (function (_ zipper) (let [next (<direction> zipper)] (if (is? zipper next) - (ex.throw cannot-move-further []) + (exception.throw cannot-move-further []) (#error.Success [next []])))))] [up zipper.up] diff --git a/stdlib/source/lux/data/collection/tree/rose.lux b/stdlib/source/lux/data/collection/tree.lux index ad64b72ed..ad64b72ed 100644 --- a/stdlib/source/lux/data/collection/tree/rose.lux +++ b/stdlib/source/lux/data/collection/tree.lux diff --git a/stdlib/source/lux/data/collection/tree/rose/zipper.lux b/stdlib/source/lux/data/collection/tree/zipper.lux index bac8961e3..bac8961e3 100644 --- a/stdlib/source/lux/data/collection/tree/rose/zipper.lux +++ b/stdlib/source/lux/data/collection/tree/zipper.lux diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux index 50dabcd16..b9bb1f335 100644 --- a/stdlib/source/lux/macro/poly/equivalence.lux +++ b/stdlib/source/lux/macro/poly/equivalence.lux @@ -24,8 +24,7 @@ ["." queue] ["." set] ["." dictionary (#+ Dictionary)] - [tree - ["." rose]]]] + ["." tree]]] [time ["." duration] ["." date] @@ -77,7 +76,7 @@ [array.Array (~! array.equivalence)] [queue.Queue (~! queue.equivalence)] [set.Set (~! set.equivalence)] - [rose.Tree (~! rose.equivalence)] + [tree.Tree (~! tree.equivalence)] )) (do @ [[_ _ valC] (<type>.apply ($_ p.and diff --git a/stdlib/source/test/lux/data/collection.lux b/stdlib/source/test/lux/data/collection.lux index ad86d3225..0d6cb1e64 100644 --- a/stdlib/source/test/lux/data/collection.lux +++ b/stdlib/source/test/lux/data/collection.lux @@ -14,9 +14,8 @@ ["#/." priority]] ["#." set ["#/." ordered]] - ["#." tree #_ - ["#/." rose - ["#/." zipper]]]]) + ["#." tree + ["#/." zipper]]]) (def: dictionary Test @@ -42,8 +41,8 @@ (def: tree Test ($_ _.and - /tree/rose.test - /tree/rose/zipper.test + /tree.test + /tree/zipper.test )) (def: #export test diff --git a/stdlib/source/test/lux/data/collection/tree/rose.lux b/stdlib/source/test/lux/data/collection/tree.lux index 65b46e382..65b46e382 100644 --- a/stdlib/source/test/lux/data/collection/tree/rose.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux diff --git a/stdlib/source/test/lux/data/collection/tree/rose/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux index e8f59a43a..f4b812420 100644 --- a/stdlib/source/test/lux/data/collection/tree/rose/zipper.lux +++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux @@ -11,14 +11,13 @@ [number ["." nat]] [collection - ["." list] - [tree - ["." rose]]]] + ["." list]]] [math ["r" random]]] ["." //] {1 - ["." / (#+ Zipper)]} + ["." / (#+ Zipper) + ["tree" //]]} ) (def: #export test @@ -31,7 +30,7 @@ new-val r.nat pre-val r.nat post-val r.nat - #let [(^open "tree@.") (rose.equivalence nat.equivalence) + #let [(^open "tree@.") (tree.equivalence nat.equivalence) (^open "list@.") (list.equivalence nat.equivalence)]] ($_ _.and (_.test "Trees can be converted to/from zippers." @@ -51,7 +50,7 @@ (|> zipper (/.prepend-child new-val) /.branch?))))) (do @ [branch-value r.nat - #let [zipper (|> (/.zip (rose.branch branch-value (list (rose.leaf mid-val)))) + #let [zipper (|> (/.zip (tree.branch branch-value (list (tree.leaf mid-val)))) (/.prepend-child pre-val) (/.append-child post-val))]] (_.test "Can prepend and append children." @@ -63,7 +62,7 @@ (|> zipper /.down /.rightmost /.value (is? post-val)))))) (do @ [branch-value r.nat - #let [zipper (/.zip (rose.branch branch-value (list (rose.leaf mid-val))))]] + #let [zipper (/.zip (tree.branch branch-value (list (tree.leaf mid-val))))]] (_.test "Can insert children around a node (unless it's start)." (and (let [zipper (|> zipper /.down @@ -90,7 +89,7 @@ (|> sample /.zip (/.set new-val) /.value (n/= new-val))) (_.test "Zipper traversal follows the outline of the tree depth-first." (let [root (/.zip sample)] - (list@= (rose.flatten sample) + (list@= (tree.flatten sample) (loop [zipper (/.start root)] (let [zipper' (/.next zipper)] (#.Cons (/.value zipper) @@ -99,7 +98,7 @@ (recur zipper')))))))) (_.test "Backwards zipper traversal yield reverse tree flatten." (let [root (/.zip sample)] - (list@= (list.reverse (rose.flatten sample)) + (list@= (list.reverse (tree.flatten sample)) (loop [zipper (/.end root)] (#.Cons (/.value zipper) (if (:: (/.equivalence nat.equivalence) = root zipper) |