aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/analyser/proc.lux
blob: 56b4ba3b3f5d51252724a4da0e53a47282e110a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(;module:
  lux
  (lux (control monad)
       (data [text]
             text/format
             (coll ["D" dict])
             maybe))
  (luxc ["&" base]
        (lang ["la" analysis #+ Analysis]))
  (. ["&&;" lux]))

(def: #export (analyse-proc analyse [proc-category proc-name] proc-args)
  (-> &;Analyser Ident (List Code) (Lux Analysis))
  (default (let [proc-description (format "[" (%t proc-category) " " (%t proc-name) "]")]
             (&;fail (format "Unknown procedure: " proc-description)))
    (do Monad<Maybe>
      [procs (D;get proc-category &&lux;procs)
       proc (D;get proc-name procs)]
      (wrap (proc analyse proc-args)))))