aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/compiler/default/cache.lux
blob: 1770b4a8247f6dd5f09f73b4a83a6c259c0cd73f (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)))