aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/control/parser/tree.lux
blob: d200cdfe778c4263642033d14078b0b505c1fc7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(.using
 [library
  [lux (.except left right)
   ["$" documentation (.only documentation:)]
   [data
    [text (.only \n)
     ["%" format (.only format)]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]])

(documentation: (/.Parser it)
  "A parser of arbitrary trees.")

(documentation: /.result'
  "Applies the parser against a tree zipper."
  [(result' parser zipper)])

(documentation: /.result
  "Applies the parser against a tree."
  [(result parser tree)])

(documentation: /.value
  "Yields the value inside the current tree node.")

(template [<name> <doc>]
  [(documentation: <name>
     <doc>)]

  [/.down "Move down."]
  [/.up "Move up."]

  [/.right "Move to the right."]
  [/.rightmost "Move to the rightmost node."]

  [/.left "Move to the left."]
  [/.leftmost "Move to the leftmost node."]
  
  [/.next "Move to the next node."]
  [/.end "Move to the last node."]
  
  [/.previous "Move to the previous node."]
  [/.start "Move to the root node."]
  )

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..Parser
             ..result'
             ..result
             ..value

             ..down
             ..up

             ..right
             ..rightmost

             ..left
             ..leftmost
             
             ..next
             ..end
             
             ..previous
             ..start
             
             ($.default /.cannot_move_further)]
            []))