diff options
author | Eduardo Julian | 2017-10-31 23:39:49 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-31 23:39:49 -0400 |
commit | 15121222d570f8fe3c5a326208e4f0bad737e63c (patch) | |
tree | 88c93ed1f4965fd0e80677df5553a0d47e521963 /new-luxc/source/luxc/lang/analysis/primitive.lux | |
parent | a269ea72337852e8e57bd427773baed111ad6e92 (diff) |
- Re-organized analysis.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/primitive.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/primitive.lux | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/primitive.lux b/new-luxc/source/luxc/lang/analysis/primitive.lux new file mode 100644 index 000000000..c7f7243fd --- /dev/null +++ b/new-luxc/source/luxc/lang/analysis/primitive.lux @@ -0,0 +1,34 @@ +(;module: + lux + (lux (control monad) + [meta] + (meta [code] + (type ["tc" check]))) + (luxc ["&" base] + (lang ["la" analysis #+ Analysis]))) + +## [Analysers] +(do-template [<name> <type> <tag>] + [(def: #export (<name> value) + (-> <type> (Meta Analysis)) + (do meta;Monad<Meta> + [expected meta;expected-type + _ (&;with-type-env + (tc;check expected <type>))] + (wrap (<tag> value))))] + + [analyse-bool Bool code;bool] + [analyse-nat Nat code;nat] + [analyse-int Int code;int] + [analyse-deg Deg code;deg] + [analyse-frac Frac code;frac] + [analyse-text Text code;text] + ) + +(def: #export analyse-unit + (Meta Analysis) + (do meta;Monad<Meta> + [expected meta;expected-type + _ (&;with-type-env + (tc;check expected Unit))] + (wrap (` [])))) |