diff options
author | Eduardo Julian | 2017-11-06 22:03:42 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-06 22:03:42 -0400 |
commit | 0cb55507c100f6817225e644c2d19e73940edad6 (patch) | |
tree | 8e99d826fc51f052b086f0398b257176dcac11cc /new-luxc/source/luxc/lang/analysis/procedure.lux | |
parent | 69d3bdf98a5be8dd7aacc0b37bdbfcbf226faf62 (diff) |
- Fixed some bugs.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/procedure.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/procedure.lux | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/procedure.lux b/new-luxc/source/luxc/lang/analysis/procedure.lux index 225fb7b23..9f5f61d59 100644 --- a/new-luxc/source/luxc/lang/analysis/procedure.lux +++ b/new-luxc/source/luxc/lang/analysis/procedure.lux @@ -1,6 +1,7 @@ (;module: lux - (lux (control [monad #+ do]) + (lux (control [monad #+ do] + ["ex" exception #+ exception:]) (data [maybe] [text] text/format @@ -10,6 +11,8 @@ (. ["./;" common] ["./;" host])) +(exception: #export Unknown-Procedure) + (def: procedures ./common;Bundle (|> ./common;procedures @@ -17,7 +20,7 @@ (def: #export (analyse-procedure analyse eval proc-name proc-args) (-> &;Analyser &;Eval Text (List Code) (Meta la;Analysis)) - (<| (maybe;default (&;fail (format "Unknown procedure: " (%t proc-name)))) + (<| (maybe;default (&;throw Unknown-Procedure proc-name)) (do maybe;Monad<Maybe> [proc (dict;get proc-name procedures)] - (wrap (proc analyse eval proc-args))))) + (wrap ((proc proc-name) analyse eval proc-args))))) |