aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/compiler/default/cache.lux
blob: 1e264ec08c1e86714438db5a988aac4f1e1b847a (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
(.module:
  [lux #*
   [data
    [format
     ["_" binary (#+ Format)]]]])

(def: definition
  (Format Definition)
  ($_ _.and _.type _.code _.any))

(def: alias
  (Format [Text Text])
  (_.and _.text _.text))

## TODO: Remove #module-hash, #imports & #module-state ASAP.
## TODO: Not just from this parser, but from the lux.Module type.
(def: #export module
  (Format Module)
  ($_ _.and
      ## #module-hash
      (_.ignore |0)
      ## #module-aliases
      (_.list ..alias)
      ## #definitions
      (_.list (_.and _.text ..definition))
      ## #imports
      (_.list _.text)
      ## #tags
      (_.ignore (list))
      ## #types
      (_.ignore (list))
      ## #module-annotations
      (_.maybe _.code)
      ## #module-state
      (_.ignore #.Cached)))