aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/analyser/procedure.lux
blob: 064a28e9b0be1bccbe7460f95ef58d54aafd9146 (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 [text]
             text/format
             (coll ["d" dict])
             [maybe]))
  (luxc ["&" base]
        (lang ["la" analysis #+ Analysis]))
  (. ["./;" common]
     ["./;" host]))

(def: procedures
  ./common;Bundle
  (|> ./common;procedures
      (d;merge ./host;procedures)))

(def: #export (analyse-procedure analyse proc-name proc-args)
  (-> &;Analyser Text (List Code) (Lux Analysis))
  (default (&;fail (format "Unknown procedure: " (%t proc-name)))
           (do maybe;Monad<Maybe>
             [proc (d;get proc-name procedures)]
             (wrap (proc analyse proc-args)))))