diff options
author | Eduardo Julian | 2022-07-28 17:39:01 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-28 17:39:01 -0400 |
commit | a4b64bf1cdf47160b6b615d2c6493039abfd7a94 (patch) | |
tree | 3fe8c149d9cad89bbf067c736d196260203d1a01 /stdlib/source/documentation/lux/data/collection/tree.lux | |
parent | a4847190df926d35f7ece97da50a2a8b1462a24f (diff) |
Extracted unit-testing machinery into its own module.
Diffstat (limited to 'stdlib/source/documentation/lux/data/collection/tree.lux')
-rw-r--r-- | stdlib/source/documentation/lux/data/collection/tree.lux | 141 |
1 files changed, 74 insertions, 67 deletions
diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux index 139d88ca3..ef03b419c 100644 --- a/stdlib/source/documentation/lux/data/collection/tree.lux +++ b/stdlib/source/documentation/lux/data/collection/tree.lux @@ -1,10 +1,12 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" monoid)]]]]] ["[0]" \\parser] [\\library ["[0]" /]] @@ -12,78 +14,83 @@ ["[1][0]" finger] ["[1][0]" zipper]]) -(`` (.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.cannot_move_further) +(`` (def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") - ($.definition (\\parser.Parser it) - "A parser of arbitrary trees.") + ($.definition \\parser.cannot_move_further) - ($.definition \\parser.result' - "Applies the parser against a tree zipper." - [(result' parser zipper)]) + ($.definition (\\parser.Parser it) + "A parser of arbitrary trees.") - ($.definition \\parser.result - "Applies the parser against a tree." - [(result parser tree)]) + ($.definition \\parser.result' + "Applies the parser against a tree zipper." + [(result' parser zipper)]) - ($.definition \\parser.value - "Yields the value inside the current tree node.") + ($.definition \\parser.result + "Applies the parser against a tree." + [(result parser tree)]) - (,, (with_template [<name> <doc>] - [($.definition <name> - <doc>)] + ($.definition \\parser.value + "Yields the value inside the current tree node.") - [\\parser.down "Move down."] - [\\parser.up "Move up."] + (,, (with_template [<name> <doc>] + [($.definition <name> + <doc>)] - [\\parser.right "Move to the right."] - [\\parser.rightmost "Move to the rightmost node."] + [\\parser.down "Move down."] + [\\parser.up "Move up."] - [\\parser.left "Move to the left."] - [\\parser.leftmost "Move to the leftmost node."] - - [\\parser.next "Move to the next node."] - [\\parser.end "Move to the last node."] - - [\\parser.previous "Move to the previous node."] - [\\parser.start "Move to the root node."] - ))] - []))) + [\\parser.right "Move to the right."] + [\\parser.rightmost "Move to the rightmost node."] + + [\\parser.left "Move to the left."] + [\\parser.leftmost "Move to the leftmost node."] + + [\\parser.next "Move to the next node."] + [\\parser.end "Move to the last node."] + + [\\parser.previous "Move to the previous node."] + [\\parser.start "Move to the root node."] + )) + ))) (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.equivalence) - ($.definition /.functor) - ($.definition /.mix) - - ($.definition (/.Tree it) - "A generic tree data-structure.") - - ($.definition /.flat - "All the leaf values of the tree, in order." - [(flat tree)]) - - ($.definition /.leaf - "" - [(leaf value)]) - - ($.definition /.branch - "" - [(branch value children)]) - - ($.definition /.tree - "Tree literals." - [(is (Tree Nat) - (tree 12 - {34 {} - 56 {} - 78 {90 {}}}))])] - [..\\parser - - /finger.documentation - /zipper.documentation])) + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.equivalence) + ($.definition /.functor) + ($.definition /.mix) + + ($.definition (/.Tree it) + "A generic tree data-structure.") + + ($.definition /.flat + "All the leaf values of the tree, in order." + [(flat tree)]) + + ($.definition /.leaf + "" + [(leaf value)]) + + ($.definition /.branch + "" + [(branch value children)]) + + ($.definition /.tree + "Tree literals." + [(is (Tree Nat) + (tree 12 + {34 {} + 56 {} + 78 {90 {}}}))]) + + (all list#composite + ..\\parser + /finger.documentation + /zipper.documentation + ) + )) |