aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/macro/syntax/common/writer.lux
blob: 72e4a11eb64704f05641cbf8c64e897765e0e305 (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
(;module: {#;doc "Commons syntax writers."}
  lux
  (lux (data (coll [list "L/" Functor<List>])
             [product])
       (macro [code]))
  [.. #*])

## Exports
(def: #export (export ?el)
  (-> (Maybe Export) (List Code))
  (case ?el
    #;None
    (list)

    (#;Some #..;Exported)
    (list (' #export))

    (#;Some #..;Hidden)
    (list (' #hidden))))

## Annotations
(def: #export (annotations anns)
  (-> Annotations Code)
  (|> anns (L/map (product;both code;tag id)) code;record))