diff options
author | Eduardo Julian | 2017-10-16 23:24:21 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-16 23:24:21 -0400 |
commit | 6ffd0692d840298850307497f5275c44d0ff8f5d (patch) | |
tree | 0f93440bfc7aea35ba4583fa23828cac782bbdbc /stdlib/source/lux/meta/syntax.lux | |
parent | b5e5cceb9f985a31581a76d71301b393d88f34a8 (diff) |
- Re-named "Lux" type to "Meta".
- Moved lux/type/* under lux/meta/*.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/meta/syntax.lux (renamed from stdlib/source/lux/macro/syntax.lux) | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/meta/syntax.lux index a31eb8c6e..c92db5191 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/meta/syntax.lux @@ -1,6 +1,6 @@ (;module: lux - (lux [macro #+ with-gensyms] + (lux [meta #+ with-gensyms] (control [monad #+ do Monad] [eq #+ Eq] ["p" parser]) @@ -171,9 +171,9 @@ (def: #export (on compiler action) {#;doc "Run a Lux operation as if it was a Syntax parser."} - (All [a] (-> Compiler (Lux a) (Syntax a))) + (All [a] (-> Compiler (Meta a) (Syntax a))) (function [input] - (case (macro;run compiler action) + (case (meta;run compiler action) (#E;Error error) (#E;Error error) @@ -208,7 +208,7 @@ (macro: #export (syntax: tokens) {#;doc (doc "A more advanced way to define macros than macro:." "The inputs to the macro can be parsed in complex ways through the use of syntax parsers." - "The macro body is also (implicitly) run in the Monad<Lux>, to save some typing." + "The macro body is also (implicitly) run in the Monad<Meta>, to save some typing." "Also, the compiler state can be accessed through the *compiler* binding." (syntax: #export (object [#let [imports (class-imports *compiler*)]] [#let [class-vars (list)]] @@ -247,9 +247,9 @@ (case ?parts (#;Some [name args meta body]) (with-gensyms [g!tokens g!body g!msg] - (do macro;Monad<Lux> + (do meta;Monad<Meta> [vars+parsers (monad;map @ - (: (-> Code (Lux [Code Code])) + (: (-> Code (Meta [Code Code])) (function [arg] (case arg (^ [_ (#;Tuple (list var parser))]) @@ -259,7 +259,7 @@ (wrap [(code;symbol var-name) (` any)]) _ - (macro;fail "Syntax pattern expects tuples or symbols.")))) + (meta;fail "Syntax pattern expects tuples or symbols.")))) args) #let [g!state (code;symbol ["" "*compiler*"]) g!end (code;symbol ["" ""]) @@ -277,11 +277,11 @@ (~ meta) (function [(~ g!state)] (;_lux_case (;;_run_ (~ g!tokens) - (: (Syntax (Lux (List Code))) + (: (Syntax (Meta (List Code))) (do ;;_Monad<Parser>_ [(~@ (join-pairs vars+parsers)) (~ g!end) ;;end!] - ((~' wrap) (do macro;Monad<Lux> + ((~' wrap) (do meta;Monad<Meta> [] (~ body)))))) (#E;Success [(~ g!tokens) (~ g!body)]) @@ -291,4 +291,4 @@ (#E;Error (text.join-with ": " (list (~ error-msg) (~ g!msg)))))))))))) _ - (macro;fail "Wrong syntax for syntax:")))) + (meta;fail "Wrong syntax for syntax:")))) |