blob: 53ad8276cce8f19285c2de820c98cb93cc066996 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
(;module:
lux
(lux (control [monad #+ do])
(data [maybe]
[text]
text/format
(coll [dict])))
(luxc ["&" base]
(lang ["la" analysis]))
(. ["./;" common]
["./;" host]))
(def: procedures
./common;Bundle
(|> ./common;procedures
(dict;merge ./host;procedures)))
(def: #export (analyse-procedure analyse proc-name proc-args)
(-> &;Analyser Text (List Code) (Meta la;Analysis))
(<| (maybe;default (&;fail (format "Unknown procedure: " (%t proc-name))))
(do maybe;Monad<Maybe>
[proc (dict;get proc-name procedures)]
(wrap (proc analyse proc-args)))))
|