aboutsummaryrefslogtreecommitdiff
path: root/src/lux/analyser/module.clj
diff options
context:
space:
mode:
authorEduardo Julian2015-05-03 08:54:50 -0400
committerEduardo Julian2015-05-03 08:54:50 -0400
commit6d803df4bdb4a68bba80cbbc4eeed02170813e96 (patch)
treeae9571ee2bea8774b3219e52782d4a59d1485fce /src/lux/analyser/module.clj
parent1c0ddbcf3833ff28aa2f71bc1da74c466a23281c (diff)
- The type syntax is finally complete ^_^
- Finally, the "case" macro has been implemented ^_^ - The macro-expand function is also alive! - Corrected the field-access special forms so they take their field as a symbol instead of text. - Macros are no longer stored inside the CompilerState as (Maybe Macro), but as Macro. - Void is implemented as - Fixed an error when parsing escaped characters in text. - Fixed an error in the reader in which parsing regex2 gave back a 2-vector instead of a 2-tuple.
Diffstat (limited to 'src/lux/analyser/module.clj')
-rw-r--r--src/lux/analyser/module.clj24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/lux/analyser/module.clj b/src/lux/analyser/module.clj
index b9a92c120..921417c17 100644
--- a/src/lux/analyser/module.clj
+++ b/src/lux/analyser/module.clj
@@ -70,7 +70,7 @@
(fn [state*]
(return* (&/update$ &/$MODULES
(fn [$modules]
- (&/|put module (&/|put name (&/V "lux;MacroD" (&/V "lux;Some" macro)) $module)
+ (&/|put module (&/|put name (&/V "lux;MacroD" macro) $module)
$modules))
state*)
nil)))
@@ -83,25 +83,3 @@
(fail* (str "[Analyser Error] Definition doesn't have macro type: " module ";" name)))
(fail* (str "[Analyser Error] Definition doesn't exist: " (str module &/+name-separator+ name))))
(fail* (str "[Analyser Error] Module doesn't exist: " module)))))
-
-(defn install-macro [module name macro]
- (fn [state]
- (if-let [$module (->> state (&/get$ &/$MODULES) (&/|get module))]
- (if-let [$def (&/|get name $module)]
- (matchv ::M/objects [$def]
- [["lux;MacroD" ["lux;None" _]]]
- (return* (&/update$ &/$MODULES
- (fn [$modules]
- (&/|put module (&/|put name (&/V "lux;MacroD" (&/V "lux;Some" macro)) $module)
- $modules))
- state)
- nil)
-
- [["lux;MacroD" ["lux;Some" _]]]
- (fail* (str "[Analyser Error] Can't re-install a macro: " (str module &/+name-separator+ name)))
-
- [_]
- (fail* (str "[Analyser Error] Can't install a non-macro: " (str module &/+name-separator+ name))))
- (fail* (str "[Analyser Error] Definition doesn't exist: " (str module &/+name-separator+ name))))
- (fail* (str "[Analyser Error] Module doesn't exist: " module)))
- ))