diff options
author | Eduardo Julian | 2015-08-04 19:40:58 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-08-04 19:40:58 -0400 |
commit | a8ac885a008f519816d747eca0f894ec9794e938 (patch) | |
tree | 9199038b98adfcab2b6ec0b3796f4e06757f38da /source/lux/meta/lux.lux | |
parent | 8a78830404234dc6e766ed6b653905bd7c89fac2 (diff) |
- Renamed the Syntax type to AST.
- Created the lux/meta/ast module.
Diffstat (limited to '')
-rw-r--r-- | source/lux/meta/lux.lux | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/lux/meta/lux.lux b/source/lux/meta/lux.lux index e1d821ff0..bc859b823 100644 --- a/source/lux/meta/lux.lux +++ b/source/lux/meta/lux.lux @@ -7,7 +7,8 @@ ## You must not remove this notice, or any other, from this software. (;import lux - (.. macro) + (.. macro + ast) (lux/control (monoid #as m) (functor #as F) (monad #as M #refer (#only do)) @@ -119,7 +120,7 @@ (:: Lux/Monad (M;wrap ident)))) (def #export (macro-expand syntax) - (-> Syntax (Lux (List Syntax))) + (-> AST (Lux (List AST))) (case syntax (#;Meta [_ (#;FormS (#;Cons [(#;Meta [_ (#;SymbolS macro-name)]) args]))]) (do Lux/Monad @@ -139,7 +140,7 @@ (:: Lux/Monad (M;wrap (list syntax))))) (def #export (macro-expand-all syntax) - (-> Syntax (Lux (List Syntax))) + (-> AST (Lux (List AST))) (case syntax (#;Meta [_ (#;FormS (#;Cons [(#;Meta [_ (#;SymbolS macro-name)]) args]))]) (do Lux/Monad @@ -161,7 +162,7 @@ (do Lux/Monad [harg+ (macro-expand-all harg) targs+ (M;map% Lux/Monad macro-expand-all targs)] - (M;wrap (list (form$ (list:++ harg+ (:: List/Monad (M;join (: (List (List Syntax)) targs+)))))))) + (M;wrap (list (form$ (list:++ harg+ (:: List/Monad (M;join (: (List (List AST)) targs+)))))))) (#;Meta [_ (#;TupleS members)]) (do Lux/Monad @@ -172,7 +173,7 @@ (:: Lux/Monad (M;wrap (list syntax))))) (def #export (gensym prefix state) - (-> Text (Lux Syntax)) + (-> Text (Lux AST)) (#;Right [(update@ #;seed (i+ 1) state) (symbol$ ["__gensym__" (:: I;Int/Show (S;show (get@ #;seed state)))])])) @@ -189,7 +190,7 @@ (#;Left msg))) (def #export (macro-expand-1 token) - (-> Syntax (Lux Syntax)) + (-> AST (Lux AST)) (do Lux/Monad [token+ (macro-expand token)] (case token+ |