aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/parser/tree.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/control/parser/tree.lux24
1 files changed, 13 insertions, 11 deletions
diff --git a/stdlib/source/lux/control/parser/tree.lux b/stdlib/source/lux/control/parser/tree.lux
index 3dbc5522d..5ca642b75 100644
--- a/stdlib/source/lux/control/parser/tree.lux
+++ b/stdlib/source/lux/control/parser/tree.lux
@@ -4,25 +4,26 @@
["." try (#+ Try)]
["." exception (#+ exception:)]]
[data
- [tree (#+ Tree)
- ["." zipper (#+ Zipper)]]]]
+ [collection
+ [tree (#+ Tree)
+ ["." zipper (#+ Zipper)]]]]]
["." //])
(type: #export (Parser t a)
(//.Parser (Zipper t) a))
-(def: #export (run-zipper zipper parser)
- (All [t a] (-> (Zipper t) (Parser t a) (Try a)))
- (case (//.run zipper parser)
+(def: #export (run' parser zipper)
+ (All [t a] (-> (Parser t a) (Zipper t) (Try a)))
+ (case (//.run parser zipper)
(#try.Success [zipper output])
(#try.Success output)
(#try.Failure error)
(#try.Failure error)))
-(def: #export (run tree parser)
- (All [t a] (-> (Tree t) (Parser t a) (Try a)))
- (run-zipper (zipper.zip tree) parser))
+(def: #export (run parser tree)
+ (All [t a] (-> (Parser t a) (Tree t) (Try a)))
+ (run' parser (zipper.zip tree)))
(def: #export value
(All [t] (Parser t t))
@@ -40,13 +41,14 @@
(exception.throw cannot-move-further [])
(#try.Success [next []])))))]
- [up zipper.up]
[down zipper.down]
- [left zipper.left]
+ [up zipper.up]
[right zipper.right]
- [root zipper.root]
+ [left zipper.left]
[rightmost zipper.rightmost]
[leftmost zipper.leftmost]
[next zipper.next]
[prev zipper.prev]
+ [end zipper.end]
+ [start zipper.start]
)