diff options
author | Eduardo Julian | 2017-05-29 22:05:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-29 22:05:57 -0400 |
commit | 953f49d5a46209f2d75e67b50edea378261108cd (patch) | |
tree | b2f1c4e08fbbbfa84c5b918ce68e4acbae08efa1 /new-luxc/source/luxc/analyser/procedure.lux | |
parent | 9ca82858b0e15800972ca7b2a776190a8d4b371c (diff) |
- Fixes for pattern-matching (case) analysis.
- Small refactorings.
- Improved common procedures analysis.
- Can now handle tagged structures (variants & records).
- Tests for pattern-matching, functions (definition & application), and common procedures.
Diffstat (limited to 'new-luxc/source/luxc/analyser/procedure.lux')
-rw-r--r-- | new-luxc/source/luxc/analyser/procedure.lux | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/analyser/procedure.lux b/new-luxc/source/luxc/analyser/procedure.lux new file mode 100644 index 000000000..d8778844f --- /dev/null +++ b/new-luxc/source/luxc/analyser/procedure.lux @@ -0,0 +1,17 @@ +(;module: + lux + (lux (control monad) + (data [text] + text/format + (coll ["D" dict]) + maybe)) + (luxc ["&" base] + (lang ["la" analysis #+ Analysis])) + (. ["&&;" common])) + +(def: #export (analyse-procedure analyse proc-name proc-args) + (-> &;Analyser Text (List Code) (Lux Analysis)) + (default (&;fail (format "Unknown procedure: " (%t proc-name))) + (do Monad<Maybe> + [proc (D;get proc-name &&common;procedures)] + (wrap (proc analyse proc-args))))) |