diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation.lux | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index 8c42c2a71..8857a83d1 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -44,9 +44,14 @@ (&.Analyser) (expressionA.analyser &eval.eval)) -(exception: #export Macro-Expansion-Failed) -(exception: #export Unrecognized-Statement) -(exception: #export Invalid-Macro) +(do-template [<name>] + [(exception: #export (<name> {message Text}) + message)] + + [Macro-Expansion-Failed] + [Unrecognized-Statement] + [Invalid-Macro] + ) (def: (process-annotations annsC) (-> Code (Meta [## js.Expression @@ -63,7 +68,7 @@ (def: (switch-compiler new-compiler) (-> Compiler (Meta Aliases)) - (function [old-compiler] + (function (_ old-compiler) ((do macro.Monad<Meta> [this macro.current-module] (wrap (|> this (get@ #.module-aliases) (dict.from-list text.Hash<Text>) (: Aliases)))) @@ -102,7 +107,7 @@ _ (&.throw Invalid-Macro (%code code))) expansion (: (Meta (List Code)) - (function [compiler] + (function (_ compiler) (case (macroL.expand (:! Macro _macroV) argsC+ compiler) (#e.Error error) ((&.throw Macro-Expansion-Failed error) compiler) @@ -127,7 +132,7 @@ (def: (forgive-eof action) (-> (Meta Unit) (Meta Unit)) - (function [compiler] + (function (_ compiler) (case (action compiler) (#e.Error error) (if (ex.match? syntax.End-Of-File error) @@ -149,7 +154,7 @@ (def: (read current-module aliases) (-> Text Aliases (Meta Code)) - (function [compiler] + (function (_ compiler) (case (syntax.read current-module aliases (get@ #.source compiler)) (#e.Error error) (#e.Error error) |