diff options
author | Eduardo Julian | 2018-07-21 22:58:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-21 22:58:54 -0400 |
commit | 2746f1a2d7606e3295e12e9c2e6833663658ffa8 (patch) | |
tree | ab578e1caf50a57d65c514b173be57311459786c /new-luxc | |
parent | 7061c56c7b038a633389c35eccb4a2cfef5098d0 (diff) |
Re-named "Symbol" to "Identifier".
Diffstat (limited to 'new-luxc')
38 files changed, 236 insertions, 236 deletions
diff --git a/new-luxc/source/luxc/lang/extension/statement.lux b/new-luxc/source/luxc/lang/extension/statement.lux index 9b7b9da52..7ee6b898d 100644 --- a/new-luxc/source/luxc/lang/extension/statement.lux +++ b/new-luxc/source/luxc/lang/extension/statement.lux @@ -54,7 +54,7 @@ (def: (ensure-valid-alias def-name annotations value) (-> Text Code Code (Meta Any)) (case [annotations value] - (^multi [[_ (#.Record pairs)] [_ (#.Symbol _)]] + (^multi [[_ (#.Record pairs)] [_ (#.Identifier _)]] (|> pairs list.size (n/= +1))) (:: macro.Monad<Meta> wrap []) @@ -65,13 +65,13 @@ (-> Text //.Statement) (function (_ inputsC+) (case inputsC+ - (^ (list [_ (#.Symbol ["" def-name])] valueC annotationsC)) + (^ (list [_ (#.Identifier ["" def-name])] valueC annotationsC)) (hostL.with-context def-name (lang.with-fresh-type-env (do macro.Monad<Meta> [syntheses //.all-syntheses [annotationsI annotationsV] (process-annotations syntheses annotationsC)] - (case (macro.get-symbol-ann (ident-for #.alias) annotationsV) + (case (macro.get-identifier-ann (ident-for #.alias) annotationsV) (#.Some real-def) (do @ [_ (ensure-valid-alias def-name annotationsV valueC) @@ -103,7 +103,7 @@ (-> Text //.Statement) (function (_ inputsC+) (case inputsC+ - (^ (list [_ (#.Symbol ["" args])] programC)) + (^ (list [_ (#.Identifier ["" args])] programC)) (do macro.Monad<Meta> [[_ programA] (<| lang.with-scope (scopeL.with-local [args (type (List Text))]) diff --git a/new-luxc/source/luxc/lang/host/jvm.lux b/new-luxc/source/luxc/lang/host/jvm.lux index bbfc5e136..7e5abd6d4 100644 --- a/new-luxc/source/luxc/lang/host/jvm.lux +++ b/new-luxc/source/luxc/lang/host/jvm.lux @@ -105,17 +105,17 @@ (translation.Compiler ..Anchor Inst Definition)) ## [Values] -(syntax: (config: {type s.local-symbol} - {none s.local-symbol} - {++ s.local-symbol} - {options (s.tuple (p.many s.local-symbol))}) - (let [g!type (code.local-symbol type) - g!none (code.local-symbol none) +(syntax: (config: {type s.local-identifier} + {none s.local-identifier} + {++ s.local-identifier} + {options (s.tuple (p.many s.local-identifier))}) + (let [g!type (code.local-identifier type) + g!none (code.local-identifier none) g!tags+ (list/map code.local-tag options) - g!_left (code.local-symbol "_left") - g!_right (code.local-symbol "_right") + g!_left (code.local-identifier "_left") + g!_right (code.local-identifier "_right") g!options+ (list/map (function (_ option) - (` (def: (~' #export) (~ (code.local-symbol option)) + (` (def: (~' #export) (~ (code.local-identifier option)) (~ g!type) (|> (~ g!none) (set@ (~ (code.local-tag option)) #1))))) @@ -131,7 +131,7 @@ [tag (` #0)]) g!tags+))))) - (` (def: (~' #export) ((~ (code.local-symbol ++)) (~ g!_left) (~ g!_right)) + (` (def: (~' #export) ((~ (code.local-identifier ++)) (~ g!_left) (~ g!_right)) (-> (~ g!type) (~ g!type) (~ g!type)) (~ (code.record (list/map (function (_ tag) [tag (` (or (get@ (~ tag) (~ g!_left)) diff --git a/new-luxc/source/luxc/lang/host/jvm/inst.lux b/new-luxc/source/luxc/lang/host/jvm/inst.lux index 9426fabe3..463861798 100644 --- a/new-luxc/source/luxc/lang/host/jvm/inst.lux +++ b/new-luxc/source/luxc/lang/host/jvm/inst.lux @@ -24,9 +24,9 @@ (import: #long java/lang/Object) (import: #long java/lang/String) -(syntax: (declare {codes (p.many s.local-symbol)}) +(syntax: (declare {codes (p.many s.local-identifier)}) (|> codes - (list/map (function (_ code) (` ((~' #static) (~ (code.local-symbol code)) (~' int))))) + (list/map (function (_ code) (` ((~' #static) (~ (code.local-identifier code)) (~' int))))) wrap)) (`` (import: org/objectweb/asm/Opcodes @@ -141,8 +141,8 @@ [string Text id] ) -(syntax: (prefix {base s.local-symbol}) - (wrap (list (code.local-symbol (format "Opcodes::" base))))) +(syntax: (prefix {base s.local-identifier}) + (wrap (list (code.local-identifier (format "Opcodes::" base))))) (def: #export NULL Inst diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index 7c1de9883..158158c51 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -100,7 +100,7 @@ (&.with-type Macro (analyse macroC))) [_macroT _macroM _macroV] (case macroA - [_ (#.Symbol macro-name)] + [_ (#.Identifier macro-name)] (macro.find-def macro-name) _ diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux index d3761ff6b..45887cdae 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux @@ -57,7 +57,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux call" (~ functionS) (~+ argsS))) diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux index 8148bf0c6..ba2e0a8b4 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux @@ -61,11 +61,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux index fe0a620d9..3750bc674 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux @@ -55,19 +55,19 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (format prefix "__" (lang.normalize-name name)) $runtime (` (_.var (~ (code.text runtime)))) @runtime (` (@@ (~ $runtime))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name (format "LRV__") code.text (~) (_.var) (`)) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` _.Expression))) _.Expression))] @@ -93,11 +93,11 @@ (_.defun (~ $runtime) (list (~+ argsLC+)) (~ definition)))))))))))) -(syntax: #export (with-vars {vars (s.tuple (p.many s.local-symbol))} +(syntax: #export (with-vars {vars (s.tuple (p.many s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars (list/map (function (_ var) - (list (code.local-symbol var) + (list (code.local-identifier var) (` (_.var (~ (code.text (format "LRV__" (lang.normalize-name var))))))))) list/join))] (~ body)))))) @@ -320,7 +320,7 @@ (_.progn (list (_.setq! process//incoming (_.list (list))) (_.map/3 _.nil (_.lambda (_.poly (list process)) - (_.funcall (list ..unit) (@@ process))) + (_.funcall (list ..unit) (@@ process))) (@@ queue)) (process//loop ..unit))))) ..unit)) diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux index 549142f3f..74bf3d118 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux index 544dd1eca..0adc4255c 100644 --- a/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux @@ -58,7 +58,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux index a2b30390d..4c3b0afe8 100644 --- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux @@ -60,11 +60,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux index fca27344e..c5d85eb0d 100644 --- a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux @@ -55,8 +55,8 @@ (-> Text (-> Text Expression) Statement) (format "var " name " = " (definition name) ";\n")) -(syntax: (runtime-implementation-name {runtime-name s.local-symbol}) - (wrap (list (code.local-symbol (format "__" runtime-name))))) +(syntax: (runtime-implementation-name {runtime-name s.local-identifier}) + (wrap (list (code.local-identifier (format "__" runtime-name))))) (template: (runtime: <lux-name> <js-name> <js-definition>) (def: #export <lux-name> Text (runtime-name <js-name>)) diff --git a/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux index 317193691..fddc8e045 100644 --- a/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux index 0bf625624..6447ec20a 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux @@ -75,11 +75,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) $.Inst) $.Inst) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux index 81b60e1ce..3ed9a8ebc 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux @@ -41,7 +41,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module def-name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux index 0fefcc8ba..5d6b073fc 100644 --- a/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux @@ -58,7 +58,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux index c750bbaf4..cfbe7f0ac 100644 --- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux @@ -60,11 +60,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g_ ) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux index 7c45f0786..8121b2c9d 100644 --- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux @@ -52,16 +52,16 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (code.text (format "__" prefix "__" (lang.normalize-name name))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name code.text) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` lua.Lua))) lua.Lua))] diff --git a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux index 8ff9c1ccd..4fb814f6c 100644 --- a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux index b7f9661e7..3d7d652bf 100644 --- a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux @@ -50,7 +50,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux index eea8682d3..9638ec9bf 100644 --- a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux @@ -61,11 +61,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux index 7feb0033c..ac04df255 100644 --- a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux @@ -54,18 +54,18 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (format "__" prefix "__" (lang.normalize-name name)) @runtime (` (_.global (~ (code.text runtime)))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name code.text (~) (_.var) (`)) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` _.Expression))) _.Computation))] @@ -87,11 +87,11 @@ ((~! list/map) _.parameter (list (~+ argsLC+))) (~ definition)))))))))))) -(syntax: (with-vars {vars (s.tuple (p.many s.local-symbol))} +(syntax: (with-vars {vars (s.tuple (p.many s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars (list/map (function (_ var) - (list (code.local-symbol var) + (list (code.local-identifier var) (` (_.var (~ (code.text (lang.normalize-name var)))))))) list/join))] (~ body)))))) diff --git a/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux index 70a39a575..d4b4a03a8 100644 --- a/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux index 62be95f27..0bbfb2f2c 100644 --- a/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux @@ -57,7 +57,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux index 2dece65c5..f7cdf044a 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux @@ -61,11 +61,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux index 68af2d630..275eea636 100644 --- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux @@ -54,19 +54,19 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (format "__" prefix "__" (lang.normalize-name name)) $runtime (` (python.var (~ (code.text runtime)))) @runtime (` (@@ (~ $runtime))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name code.text (~) (python.var) (`)) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` python.Expression))) python.Expression))] @@ -88,11 +88,11 @@ (list (~+ argsLC+)) (~ definition)))))))))))) -(syntax: (with-vars {vars (s.tuple (p.many s.local-symbol))} +(syntax: (with-vars {vars (s.tuple (p.many s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars (list/map (function (_ var) - (list (code.local-symbol var) + (list (code.local-identifier var) (` (python.var (~ (code.text (lang.normalize-name var)))))))) list/join))] (~ body)))))) diff --git a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux index c241afa8a..0d8321470 100644 --- a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux index 2e30b4999..d838bc332 100644 --- a/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux @@ -58,7 +58,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux index 00f04e49f..eab139f33 100644 --- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux @@ -61,11 +61,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux index 3ea37ae85..fd4adfb1a 100644 --- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux @@ -82,19 +82,19 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (format prefix "__" (lang.normalize-name name)) $runtime (` (r.var (~ (code.text runtime)))) @runtime (` (@@ (~ $runtime))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name (format "LRV__") code.text (~) (r.var) (`)) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` r.Expression))) r.Expression))] @@ -121,11 +121,11 @@ (r.function (list (~+ argsLC+)) (~ definition))))))))))))) -(syntax: #export (with-vars {vars (s.tuple (p.many s.local-symbol))} +(syntax: #export (with-vars {vars (s.tuple (p.many s.local-identifier))} body) (wrap (list (` (let [(~+ (|> vars (list/map (function (_ var) - (list (code.local-symbol var) + (list (code.local-identifier var) (` (r.var (~ (code.text (format "LRV__" (lang.normalize-name var))))))))) list/join))] (~ body)))))) diff --git a/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux index e09410f40..a5515efdc 100644 --- a/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux index e68cf8a8f..6023f3a82 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux @@ -55,7 +55,7 @@ (^ [_ (#.Form (list [_ (#.Int var)]))]) (referenceT.translate-variable var) - [_ (#.Symbol definition)] + [_ (#.Identifier definition)] (referenceT.translate-definition definition) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux index 7100cf9a4..bed68a0a0 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux @@ -60,11 +60,11 @@ "Expected: " (|> expected .int %i) "\n" " Actual: " (|> actual .int %i))) -(syntax: (arity: {name s.local-symbol} {arity s.nat}) +(syntax: (arity: {name s.local-identifier} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + (wrap (list (` (def: #export ((~ (code.local-identifier name)) (~ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) (function ((~ g!_) (~ g!name)) diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux index 4ab5417a1..49f5d9d79 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux @@ -52,16 +52,16 @@ (def: declaration (s.Syntax [Text (List Text)]) - (p.either (p.seq s.local-symbol (p/wrap (list))) - (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) + (p.either (p.seq s.local-identifier (p/wrap (list))) + (s.form (p.seq s.local-identifier (p.some s.local-identifier))))) (syntax: (runtime: {[name args] declaration} definition) - (let [implementation (code.local-symbol (format "@@" name)) + (let [implementation (code.local-identifier (format "@@" name)) runtime (code.text (format "__" prefix "__" (lang.normalize-name name))) - argsC+ (list/map code.local-symbol args) + argsC+ (list/map code.local-identifier args) argsLC+ (list/map (|>> lang.normalize-name code.text) args) - declaration (` ((~ (code.local-symbol name)) + declaration (` ((~ (code.local-identifier name)) (~+ argsC+))) type (` (-> (~+ (list.repeat (list.size argsC+) (` ruby.Ruby))) ruby.Ruby))] diff --git a/new-luxc/source/luxc/lang/translation/ruby/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/statement.jvm.lux index 83792921d..a1b2a9e6f 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux index aa1411c18..8c5bdc797 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux @@ -15,7 +15,7 @@ (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] - (case (macro.get-symbol-ann (ident-for #.alias) metaV) + (case (macro.get-identifier-ann (ident-for #.alias) metaV) (#.Some real-def) (do @ [[realT realA realV] (macro.find-def real-def) diff --git a/new-luxc/test/test/luxc/common.lux b/new-luxc/test/test/luxc/common.lux index 44bd85fd9..b181004f7 100644 --- a/new-luxc/test/test/luxc/common.lux +++ b/new-luxc/test/test/luxc/common.lux @@ -1,72 +1,80 @@ (.module: - lux - (lux (control [monad #+ do]) - [io #+ IO] - (data ["e" error]) - [macro] - (macro [code]) - ["//" lang] - (lang ["//." init] - ["//." module] - ["//." synthesis #+ Synthesis])) - (luxc (lang ["&." host] - (translation (jvm [".T_jvm" expression] - [".T_jvm" eval] - [".T_jvm" runtime] - [".T_jvm" statement]) - ## [js] - ## (js [".T_js" expression] - ## [".T_js" eval] - ## [".T_js" runtime] - ## [".T_js" statement]) - ## [lua] - ## (lua [".T_lua" expression] - ## [".T_lua" eval] - ## [".T_lua" runtime] - ## [".T_lua" statement]) - ## [ruby] - ## (ruby [".T_ruby" expression] - ## [".T_ruby" eval] - ## [".T_ruby" runtime] - ## [".T_ruby" statement]) - ## [python] - ## (python [".T_python" expression] - ## [".T_python" eval] - ## [".T_python" runtime] - ## [".T_python" statement]) - ## [r] - ## (r [".T_r" expression] - ## [".T_r" eval] - ## [".T_r" runtime] - ## [".T_r" statement]) - ## [scheme] - ## (scheme [".T_scheme" expression] - ## [".T_scheme" eval] - ## [".T_scheme" runtime] - ## [".T_scheme" statement]) - ## [common-lisp] - ## (common-lisp [".T_common-lisp" expression] - ## [".T_common-lisp" eval] - ## [".T_common-lisp" runtime] - ## [".T_common-lisp" statement]) - ## [php] - ## (php [".T_php" expression] - ## [".T_php" eval] - ## [".T_php" runtime] - ## [".T_php" statement]) - )))) + [lux #* + [control + [monad (#+ do)]] + [io (#+ IO)] + [data + [error (#+ Error)]] + ["." macro + [code]] + ["." language + [compiler + [init] + [analysis + [module]] + [synthesis (#+ Synthesis)]]]] + [luxc + [lang + [translation + ["." jvm + ["._jvm" expression] + ## ["._jvm" eval] + ## ["._jvm" runtime] + ## ["._jvm" statement] + ] + ## [js] + ## (js ["._js" expression] + ## ["._js" eval] + ## ["._js" runtime] + ## ["._js" statement]) + ## [lua] + ## (lua ["._lua" expression] + ## ["._lua" eval] + ## ["._lua" runtime] + ## ["._lua" statement]) + ## [ruby] + ## (ruby ["._ruby" expression] + ## ["._ruby" eval] + ## ["._ruby" runtime] + ## ["._ruby" statement]) + ## [python] + ## (python ["._python" expression] + ## ["._python" eval] + ## ["._python" runtime] + ## ["._python" statement]) + ## [r] + ## (r ["._r" expression] + ## ["._r" eval] + ## ["._r" runtime] + ## ["._r" statement]) + ## [scheme] + ## (scheme ["._scheme" expression] + ## ["._scheme" eval] + ## ["._scheme" runtime] + ## ["._scheme" statement]) + ## [common-lisp] + ## (common-lisp ["._common-lisp" expression] + ## ["._common-lisp" eval] + ## ["._common-lisp" runtime] + ## ["._common-lisp" statement]) + ## [php] + ## (php ["._php" expression] + ## ["._php" eval] + ## ["._php" runtime] + ## ["._php" statement]) + ]]]) -(type: #export Runner (-> Synthesis (e.Error Any))) -(type: #export Definer (-> Ident Synthesis (e.Error Any))) +(type: #export Runner (-> Synthesis (Error Any))) +(type: #export Definer (-> Ident Synthesis (Error Any))) (do-template [<name> <host>] [(def: #export <name> (IO Lux) (do io.Monad<IO> [host <host>] - (wrap (//init.compiler host))))] + (wrap (init.compiler host))))] - [init-jvm &host.init-host] + [init-jvm jvm.init] ## [init-js js.init] ## [init-lua lua.init] ## [init-ruby ruby.init] @@ -85,7 +93,7 @@ [_ translate-runtime sampleO (translate-expression synthesis)] (eval sampleO)) - (//.with-current-module "") + (language.with-current-module "") (macro.run (io.run init))))) (def: (definer translate-runtime translate-expression eval init translate-def) @@ -96,36 +104,36 @@ (|> (do macro.Monad<Meta> [_ translate-runtime valueO (translate-expression synthesis) - _ (//module.with-module +0 module-name + _ (module.with-module +0 module-name (translate-def def-name Any valueO (' {}))) - sampleO (translate-expression (code.symbol [module-name def-name]))] + sampleO (translate-expression (code.identifier [module-name def-name]))] (eval sampleO)) - (//.with-current-module "") + (language.with-current-module "") (macro.run (io.run init))))) -(def: #export run-jvm (runner runtimeT_jvm.translate expressionT_jvm.translate evalT_jvm.eval init-jvm)) -(def: #export def-jvm (definer runtimeT_jvm.translate expressionT_jvm.translate evalT_jvm.eval init-jvm statementT_jvm.translate-def)) +(def: #export run-jvm (runner runtime_jvm.translate expression_jvm.translate eval_jvm.eval init-jvm)) +(def: #export def-jvm (definer runtime_jvm.translate expression_jvm.translate eval_jvm.eval init-jvm statement_jvm.translate-def)) -## (def: #export run-js (runner runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js)) -## (def: #export def-js (definer runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js statementT_js.translate-def)) +## (def: #export run-js (runner runtime_js.translate expression_js.translate eval_js.eval init-js)) +## (def: #export def-js (definer runtime_js.translate expression_js.translate eval_js.eval init-js statement_js.translate-def)) -## (def: #export run-lua (runner runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua)) -## (def: #export def-lua (definer runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua statementT_lua.translate-def)) +## (def: #export run-lua (runner runtime_lua.translate expression_lua.translate eval_lua.eval init-lua)) +## (def: #export def-lua (definer runtime_lua.translate expression_lua.translate eval_lua.eval init-lua statement_lua.translate-def)) -## (def: #export run-ruby (runner runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby)) -## (def: #export def-ruby (definer runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby statementT_ruby.translate-def)) +## (def: #export run-ruby (runner runtime_ruby.translate expression_ruby.translate eval_ruby.eval init-ruby)) +## (def: #export def-ruby (definer runtime_ruby.translate expression_ruby.translate eval_ruby.eval init-ruby statement_ruby.translate-def)) -## (def: #export run-python (runner runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python)) -## (def: #export def-python (definer runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python statementT_python.translate-def)) +## (def: #export run-python (runner runtime_python.translate expression_python.translate eval_python.eval init-python)) +## (def: #export def-python (definer runtime_python.translate expression_python.translate eval_python.eval init-python statement_python.translate-def)) -## (def: #export run-r (runner runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r)) -## (def: #export def-r (definer runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r statementT_r.translate-def)) +## (def: #export run-r (runner runtime_r.translate expression_r.translate eval_r.eval init-r)) +## (def: #export def-r (definer runtime_r.translate expression_r.translate eval_r.eval init-r statement_r.translate-def)) -## (def: #export run-scheme (runner runtimeT_scheme.translate expressionT_scheme.translate evalT_scheme.eval init-scheme)) -## (def: #export def-scheme (definer runtimeT_scheme.translate expressionT_scheme.translate evalT_scheme.eval init-scheme statementT_scheme.translate-def)) +## (def: #export run-scheme (runner runtime_scheme.translate expression_scheme.translate eval_scheme.eval init-scheme)) +## (def: #export def-scheme (definer runtime_scheme.translate expression_scheme.translate eval_scheme.eval init-scheme statement_scheme.translate-def)) -## (def: #export run-common-lisp (runner runtimeT_common-lisp.translate expressionT_common-lisp.translate evalT_common-lisp.eval init-common-lisp)) -## (def: #export def-common-lisp (definer runtimeT_common-lisp.translate expressionT_common-lisp.translate evalT_common-lisp.eval init-common-lisp statementT_common-lisp.translate-def)) +## (def: #export run-common-lisp (runner runtime_common-lisp.translate expression_common-lisp.translate eval_common-lisp.eval init-common-lisp)) +## (def: #export def-common-lisp (definer runtime_common-lisp.translate expression_common-lisp.translate eval_common-lisp.eval init-common-lisp statement_common-lisp.translate-def)) -## (def: #export run-php (runner runtimeT_php.translate expressionT_php.translate evalT_php.eval init-php)) -## (def: #export def-php (definer runtimeT_php.translate expressionT_php.translate evalT_php.eval init-php statementT_php.translate-def)) +## (def: #export run-php (runner runtime_php.translate expression_php.translate eval_php.eval init-php)) +## (def: #export def-php (definer runtime_php.translate expression_php.translate eval_php.eval init-php statement_php.translate-def)) diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux index 14a887873..1c4236913 100644 --- a/new-luxc/test/test/luxc/lang/translation/primitive.lux +++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux @@ -1,42 +1,47 @@ (.module: - lux - (lux [io #+ IO] - (control [monad #+ do] - pipe) - (data text/format - ["e" error] - [bit "bit/" Eq<Bit>] - [text "text/" Eq<Text>]) - ["r" math/random] - (lang ["//." synthesis]) - test) - (luxc (lang [".L" host])) - (test/luxc common)) + [lux #* + [control + [monad (#+ do)] + pipe] + [data + [error] + [bit ("bit/" Equivalence<Bit>)] + [text ("text/" Equivalence<Text>) + format]] + [math + ["r" random]] + [language + [compiler + [synthesis]]] + test] + [test + [luxc + common]]) (def: (spec run) (-> Runner Test) (do r.Monad<Random> - [%bit% r.bit - %nat% r.nat - %int% r.int - %rev% r.rev - %frac% r.frac - %text% (r.ascii +5)] + [|bit| r.bit + |nat| r.nat + |int| r.int + |rev| r.rev + |frac| r.frac + |text| (r.ascii +5)] (`` ($_ seq (~~ (do-template [<desc> <type> <synthesis> <sample> <test>] [(test (format "Can translate " <desc> ".") (|> (run (<synthesis> <sample>)) - (case> (#e.Success valueT) + (case> (#error.Success valueT) (<test> <sample> (:coerce <type> valueT)) - (#e.Error error) + (#error.Error error) (exec (log! error) #0))))] - ["bit" Bit //synthesis.bit %bit% bit/=] - ["int" Int //synthesis.i64 %int% i/=] - ["frac" Frac //synthesis.f64 %frac% f/=] - ["text" Text //synthesis.text %text% text/=])) + ["bit" Bit synthesis.bit |bit| bit/=] + ["int" Int synthesis.i64 |int| i/=] + ["frac" Frac synthesis.f64 |frac| f/=] + ["text" Text synthesis.text |text| text/=])) )))) (context: "[JVM] Primitives." diff --git a/new-luxc/test/tests.lux b/new-luxc/test/tests.lux index b6e6f3ca8..09b95c6b2 100644 --- a/new-luxc/test/tests.lux +++ b/new-luxc/test/tests.lux @@ -1,41 +1,28 @@ (.module: - lux - (lux (control monad) - [io] - (concurrency [promise]) - [cli #+ program:] - [test]) - (test (luxc (lang (analysis ["_.A" primitive] - ["_.A" structure] - ["_.A" reference] - ["_.A" case] - ["_.A" function] - ["_.A" type] - (procedure ["_.A" common] - ["_.A" host])) - (synthesis ["_.S" primitive] - ["_.S" structure] - (case ["_.S" special]) - ["_.S" function] - ["_.S" procedure] - ["_.S" loop]) - (translation ["_.T" primitive] - ["_.T" structure] - ["_.T" function] - ["_.T" reference] - ["_.T" case] - ["_.T" common] - ["_.T" jvm] - ## ["_.T" js] - ## ["_.T" lua] - ## ["_.T" ruby] - ## ["_.T" python] - ## ["_.T" r] - ## ["_.T" scheme] - ## ["_.T" common-lisp] - ## ["_.T" php] - )) - ))) + [lux + [cli (#+ program:)] + [test]] + [test + [luxc + [lang + [translation + ["_.T" primitive] + ## ["_.T" structure] + ## ["_.T" function] + ## ["_.T" reference] + ## ["_.T" case] + ## ["_.T" common] + ## ["_.T" jvm] + ## ["_.T" js] + ## ["_.T" lua] + ## ["_.T" ruby] + ## ["_.T" python] + ## ["_.T" r] + ## ["_.T" scheme] + ## ["_.T" common-lisp] + ## ["_.T" php] + ]]]] + ) (program: args (test.run)) |