From ca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 6 Apr 2018 08:32:41 -0400 Subject: - Adapted new-luxc's code to latest stdlib changes. --- new-luxc/source/luxc/lang/translation.lux | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation.lux') 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 [] + [(exception: #export ( {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 [this macro.current-module] (wrap (|> this (get@ #.module-aliases) (dict.from-list text.Hash) (: 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) -- cgit v1.2.3