aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/macro/syntax/input.lux
blob: b7ff83a597fe2bd681041598f8494ba238436a97 (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
(.module:
  [library
   [lux "*"
    [abstract
     [equivalence {"+" [Equivalence]}]]
    [control
     ["<>" parser
      ["<[0]>" code {"+" [Parser]}]]]
    [data
     ["[0]" product]]
    [macro
     ["[0]" code]]]])

(type: .public Input
  (Record
   [#binding Code
    #type Code]))

(def: .public equivalence
  (Equivalence Input)
  ($_ product.equivalence
      code.equivalence
      code.equivalence
      ))

(def: .public (format value)
  (-> Input Code)
  (code.record
   (list [(value@ #binding value)
          (value@ #type value)])))

(def: .public parser
  (Parser Input)
  (<code>.record
   ($_ <>.and
       <code>.any
       <code>.any
       )))