From 824482b2e8b13e42a524a5e4945ea3e172395c9e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 15 May 2017 22:19:14 -0400 Subject: WIP - Simplified the Analysis type, by removing all meta-data. - Added analysis of function calls. - Added analysis of common Lux procedures. - Lots of refactoring. --- new-luxc/source/luxc/analyser/primitive.lux | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 new-luxc/source/luxc/analyser/primitive.lux (limited to 'new-luxc/source/luxc/analyser/primitive.lux') diff --git a/new-luxc/source/luxc/analyser/primitive.lux b/new-luxc/source/luxc/analyser/primitive.lux new file mode 100644 index 000000000..26580a503 --- /dev/null +++ b/new-luxc/source/luxc/analyser/primitive.lux @@ -0,0 +1,34 @@ +(;module: + lux + (lux (control monad) + [macro #+ Monad] + (type ["TC" check])) + (luxc ["&" base] + (lang ["la" analysis #+ Analysis]))) + +## [Analysers] +(do-template [ ] + [(def: #export ( value) + (-> (Lux Analysis)) + (do Monad + [expected macro;expected-type + _ (&;within-type-env + (TC;check expected ))] + (wrap ( value))))] + + [analyse-bool Bool #la;Bool] + [analyse-nat Nat #la;Nat] + [analyse-int Int #la;Int] + [analyse-deg Deg #la;Deg] + [analyse-real Real #la;Real] + [analyse-char Char #la;Char] + [analyse-text Text #la;Text] + ) + +(def: #export analyse-unit + (Lux Analysis) + (do Monad + [expected macro;expected-type + _ (&;within-type-env + (TC;check expected Unit))] + (wrap #la;Unit))) -- cgit v1.2.3