aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler.lux
blob: 138f2ccf970577fc30659831934891b0553005f5 (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
(.using
 [library
  [lux {"-" Module Code}
   [control
    ["[0]" try {"+" Try}]
    ["[0]" exception {"+" exception:}]]
   [data
    [binary {"+" Binary}]
    ["[0]" text]]
   [world
    ["[0]" file {"+" Path}]]]]
 [/
  [meta
   ["[0]" archive {"+" Output Archive}
    [key {"+" Key}]
    [module
     [descriptor {"+" Descriptor Module}]
     [document {"+" Document}]]]]])

(type: .public Code
  Text)

(type: .public Parameter
  Text)

(type: .public Input
  (Record
   [#module Module
    #file Path
    #hash Nat
    #code Code]))

(type: .public (Compilation s d o)
  (Record
   [#dependencies (List Module)
    #process (-> s Archive
                 (Try [s (Either (Compilation s d o)
                                 (archive.Entry Any))]))]))

(type: .public (Compiler s d o)
  (-> Input (Compilation s d o)))

(type: .public (Instancer s d o)
  (-> (Key d) (List Parameter) (Compiler s d o)))

(exception: .public (cannot_compile [module Module])
  (exception.report
   ["Module" module]))