aboutsummaryrefslogtreecommitdiff
path: root/src/lux/analyser/module.clj
diff options
context:
space:
mode:
authorEduardo Julian2015-05-04 12:20:32 -0400
committerEduardo Julian2015-05-04 12:20:32 -0400
commit99a4eec5bce78ce5262f94a51f2b57ed2507ac46 (patch)
treeaf0696daa04f7ac154843ae60150567b8675fdb1 /src/lux/analyser/module.clj
parentda7d3d23227e6d162ff287c8b1ba3f466caafdff (diff)
- Added the LuxVar type to properly specify the type of environment bindings.
- Implemented "using". - Implemented jvm-program. - Corrected some primitive (un)wrapping errors in lux.compiler.host. - jvm-program is now scoped to enable local variables. - The types of definitions are now stored within the module dictionary. - Added a "main" method that just compiles program.lux.
Diffstat (limited to 'src/lux/analyser/module.clj')
-rw-r--r--src/lux/analyser/module.clj8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lux/analyser/module.clj b/src/lux/analyser/module.clj
index 83169b17d..de68f48aa 100644
--- a/src/lux/analyser/module.clj
+++ b/src/lux/analyser/module.clj
@@ -10,7 +10,7 @@
(def init-module
(&/|table))
-(defn define [module name def-data]
+(defn define [module name def-data type]
(fn [state]
(matchv ::M/objects [(&/get$ &/$ENVS state)]
[["lux;Cons" [?env ["lux;Nil" _]]]]
@@ -21,7 +21,7 @@
(&/set$ &/$ENVS (&/|list (&/update$ &/$LOCALS (fn [locals]
(&/update$ &/$MAPPINGS (fn [mappings]
(&/|put (str "" &/+name-separator+ name)
- (&/T (&/V "global" (&/T module name)) &type/$Void)
+ (&/T (&/V "lux;Global" (&/T module name)) type)
mappings))
locals))
?env))))
@@ -30,7 +30,7 @@
[_]
(fail* "[Analyser Error] Can't create a new global definition outside of a global environment."))))
-(defn def-alias [a-module a-name r-module r-name]
+(defn def-alias [a-module a-name r-module r-name type]
(fn [state]
;; (prn 'def-alias [a-module a-name] '=> [r-module r-name])
(matchv ::M/objects [(&/get$ &/$ENVS state)]
@@ -42,7 +42,7 @@
(&/set$ &/$ENVS (&/|list (&/update$ &/$LOCALS (fn [locals]
(&/update$ &/$MAPPINGS (fn [mappings]
(&/|put (str "" &/+name-separator+ a-name)
- (&/T (&/V "global" (&/T r-module r-name)) &type/$Void)
+ (&/T (&/V "lux;Global" (&/T r-module r-name)) type)
mappings))
locals))
?env))))