From 14a5d4377431c7fc7a13b71cfbbaeb7baa116d29 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Jul 2022 18:04:30 -0400 Subject: Moved "lux/extension" to "lux/meta/extension". --- stdlib/source/test/lux.lux | 41 +++--- stdlib/source/test/lux/extension.lux | 206 ------------------------------ stdlib/source/test/lux/meta.lux | 3 + stdlib/source/test/lux/meta/extension.lux | 206 ++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+), 228 deletions(-) delete mode 100644 stdlib/source/test/lux/extension.lux create mode 100644 stdlib/source/test/lux/meta/extension.lux (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 0f03b346d..04d1ca0f9 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -56,7 +56,6 @@ ["[1][0]" world] ["[1][0]" ffi] - ["[1][0]" extension] ]))) (def for_bit @@ -1193,27 +1192,25 @@ (def test Test (<| (_.covering /._) - (`` (`` (_.in_parallel - (list ..test|lux - - /abstract.test - /control.test - /data.test - /debug.test - - /documentation.test - /math.test - - /meta.test - /program.test - /test.test - - /world.test - - /ffi.test - (,, (for @.old (,, (these)) - (,, (these /extension.test)))) - )))))) + (_.in_parallel + (list ..test|lux + + /abstract.test + /control.test + /data.test + /debug.test + + /documentation.test + /math.test + + /meta.test + /program.test + /test.test + + /world.test + + /ffi.test + )))) (program: args (let [times (for @.old 100 diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux deleted file mode 100644 index 8be85f9c0..000000000 --- a/stdlib/source/test/lux/extension.lux +++ /dev/null @@ -1,206 +0,0 @@ -(.`` (.`` (.require - [library - [lux (.except) - ["_" test (.only Test)] - ["[0]" debug] - [abstract - ["[0]" monad (.only do)]] - [control - ["<>" parser] - ["[0]" try (.use "[1]#[0]" functor)]] - [data - ["[0]" product] - ["[0]" binary (.only) - ["[1]F" \\format]] - ["[0]" text (.use "[1]#[0]" equivalence) - ["%" \\format (.only format)]] - [collection - ["[0]" sequence] - ["[0]" list (.use "[1]#[0]" functor)]]] - [math - ["[0]" random] - [number - ["n" nat]]] - [meta - ["[0]" code - ["<[1]>" \\parser]] - [macro - ["[0]" template]] - ["@" target (.only) - ["[0]" js] - ["[0]" python] - ["[0]" lua] - ["[0]" ruby] - ["[0]" php] - ["[0]" scheme] - ["[0]" jvm - (.,, (.for "JVM" (.,, (.these ["[1]" bytecode] - ["[0]" class] - ["[0]" version] - [encoding - ["[0]" name]])) - (.,, (.these))))]] - [compiler - ["[0]" phase] - [meta - [archive - ["[0]" unit]]] - [language - [lux - ["[0]" generation] - ["[0]" declaration] - ["[0]" analysis (.only) - ["[0]" type] - ["<[1]>" \\parser]] - ["[0]" synthesis (.only) - ["<[1]>" \\parser]] - [phase - [generation - (.,, (.for "JVM" (.,, (.these ["[0]" jvm - ["[1]/[0]" runtime]])) - (.,, (.these))))]]]]]]]] - [\\library - ["[0]" / (.only analysis synthesis generation declaration)]]))) - -(def dummy_generation "dummy generation") - -(with_template [] - [(def - Text - (`` (%.symbol (symbol (,, (template.symbol [.._ ]))))))] - - [my_analysis] - [my_synthesis] - [my_generation] - [my_declaration] - ) - -... Generation -(for @.old - (these) - - (these - (for @.python - ... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. - (analysis ("dummy dum dum" self phase archive []) - (undefined)) - - (these)) - - ... Analysis - (analysis (..my_analysis self phase archive [pass_through .any]) - (phase archive pass_through)) - - ... Synthesis - (analysis (..my_synthesis self phase archive [parameters (<>.some .any)]) - (let [! phase.monad] - (|> parameters - (monad.each ! (phase archive)) - (at ! each (|>> {analysis.#Extension self}))))) - - (synthesis (..my_synthesis self phase archive [pass_through .any]) - (phase archive pass_through)) - - ... Generation - (analysis (..my_generation self phase archive [parameters (<>.some .any)]) - (let [! phase.monad] - (|> parameters - (monad.each ! (phase archive)) - (at ! each (|>> {analysis.#Extension self}))))) - - (synthesis (..my_generation self phase archive [parameters (<>.some .any)]) - (let [! phase.monad] - (|> parameters - (monad.each ! (phase archive)) - (at ! each (|>> {synthesis.#Extension self}))))) - - (generation (..my_generation self phase archive [pass_through .any]) - (phase archive pass_through)) - - (analysis (..dummy_generation self phase archive []) - (at phase.monad in {analysis.#Extension self (list)})) - - (synthesis (..dummy_generation self phase archive []) - (at phase.monad in {synthesis.#Extension self (list)})) - - (generation (..dummy_generation self phase archive []) - (at phase.monad in - (for @.jvm (jvm.string self) - @.js (js.string self) - @.python (python.unicode self) - @.lua (lua.string self) - @.ruby (ruby.string self) - @.php (php.string self) - @.scheme (scheme.string self)))) - - ... Declaration - (declaration (..my_declaration self phase archive [expression .any]) - (do [! phase.monad] - [analysis_phase declaration.analysis - expressionA (<| declaration.lifted_analysis - (type.expecting .Any) - (analysis_phase archive expression)) - - synthesis_phase declaration.synthesis - expressionS (declaration.lifted_synthesis - (synthesis_phase archive expressionA)) - - generation_phase declaration.generation - expressionG (declaration.lifted_generation - (generation_phase archive expressionS)) - - _ (declaration.lifted_generation - (generation.with_new_context archive unit.none - (do ! - [[module_id artifact_id] (generation.context archive) - .let [commentary (format "Successfully installed declaration " (%.text self) "!")] - _ (generation.save! artifact_id {.#None} - (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] - (<| [$class] - (try.else (binary.empty 0)) - (try#each (binaryF.result class.format)) - (class.class version.v6_0 class.public - (name.internal $class) - {.#None} - (name.internal "java.lang.Object") - (list) - (list) - (list) - sequence.empty))) - @.js (js.comment commentary - (js.statement (js.string commentary))) - @.python (python.comment commentary - (python.statement (python.string commentary))) - @.lua (lua.comment commentary - (lua.statement expressionG)) - @.ruby (ruby.comment commentary - (ruby.statement (ruby.string commentary)))))] - (generation.log! commentary))))] - (in declaration.no_requirements))) - - (`` ((,, (static ..my_declaration)) (n.* 2 3))) - )) - -(def .public test - Test - (<| (_.covering /._) - (do random.monad - [expected random.nat] - (`` (all _.and - (,, (with_template [ ] - [(_.coverage [] - (for @.old false - (n.= expected - (`` ((,, (static )) expected)))))] - - [/.analysis ..my_analysis] - [/.synthesis ..my_synthesis])) - (_.coverage [/.generation] - (for @.old false - (and (n.= expected - (`` ((,, (static ..my_generation)) expected))) - (text#= ..dummy_generation - (`` ((,, (static ..dummy_generation)))))))) - (_.coverage [/.declaration] - true) - ))))) diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 4a7159fe5..7bcecdd8a 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -42,6 +42,7 @@ ["[1][0]" type] ["[1][0]" macro] ["[1][0]" static] + ["[1][0]" extension] ["[1][0]" target (.only) (.,, (.for "{old}" (.,, (.these ["[1]/[0]" jvm])) "JVM" (.,, (.these ["[1]/[0]" jvm])) @@ -1066,6 +1067,8 @@ @.lua (,, (these /target/lua.test)) @.python (,, (these /target/python.test)) @.ruby (,, (these /target/ruby.test)))) + (,, (for @.old (,, (these)) + (,, (these /extension.test)))) /compiler/arity.test /compiler/version.test diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux new file mode 100644 index 000000000..8be85f9c0 --- /dev/null +++ b/stdlib/source/test/lux/meta/extension.lux @@ -0,0 +1,206 @@ +(.`` (.`` (.require + [library + [lux (.except) + ["_" test (.only Test)] + ["[0]" debug] + [abstract + ["[0]" monad (.only do)]] + [control + ["<>" parser] + ["[0]" try (.use "[1]#[0]" functor)]] + [data + ["[0]" product] + ["[0]" binary (.only) + ["[1]F" \\format]] + ["[0]" text (.use "[1]#[0]" equivalence) + ["%" \\format (.only format)]] + [collection + ["[0]" sequence] + ["[0]" list (.use "[1]#[0]" functor)]]] + [math + ["[0]" random] + [number + ["n" nat]]] + [meta + ["[0]" code + ["<[1]>" \\parser]] + [macro + ["[0]" template]] + ["@" target (.only) + ["[0]" js] + ["[0]" python] + ["[0]" lua] + ["[0]" ruby] + ["[0]" php] + ["[0]" scheme] + ["[0]" jvm + (.,, (.for "JVM" (.,, (.these ["[1]" bytecode] + ["[0]" class] + ["[0]" version] + [encoding + ["[0]" name]])) + (.,, (.these))))]] + [compiler + ["[0]" phase] + [meta + [archive + ["[0]" unit]]] + [language + [lux + ["[0]" generation] + ["[0]" declaration] + ["[0]" analysis (.only) + ["[0]" type] + ["<[1]>" \\parser]] + ["[0]" synthesis (.only) + ["<[1]>" \\parser]] + [phase + [generation + (.,, (.for "JVM" (.,, (.these ["[0]" jvm + ["[1]/[0]" runtime]])) + (.,, (.these))))]]]]]]]] + [\\library + ["[0]" / (.only analysis synthesis generation declaration)]]))) + +(def dummy_generation "dummy generation") + +(with_template [] + [(def + Text + (`` (%.symbol (symbol (,, (template.symbol [.._ ]))))))] + + [my_analysis] + [my_synthesis] + [my_generation] + [my_declaration] + ) + +... Generation +(for @.old + (these) + + (these + (for @.python + ... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. + (analysis ("dummy dum dum" self phase archive []) + (undefined)) + + (these)) + + ... Analysis + (analysis (..my_analysis self phase archive [pass_through .any]) + (phase archive pass_through)) + + ... Synthesis + (analysis (..my_synthesis self phase archive [parameters (<>.some .any)]) + (let [! phase.monad] + (|> parameters + (monad.each ! (phase archive)) + (at ! each (|>> {analysis.#Extension self}))))) + + (synthesis (..my_synthesis self phase archive [pass_through .any]) + (phase archive pass_through)) + + ... Generation + (analysis (..my_generation self phase archive [parameters (<>.some .any)]) + (let [! phase.monad] + (|> parameters + (monad.each ! (phase archive)) + (at ! each (|>> {analysis.#Extension self}))))) + + (synthesis (..my_generation self phase archive [parameters (<>.some .any)]) + (let [! phase.monad] + (|> parameters + (monad.each ! (phase archive)) + (at ! each (|>> {synthesis.#Extension self}))))) + + (generation (..my_generation self phase archive [pass_through .any]) + (phase archive pass_through)) + + (analysis (..dummy_generation self phase archive []) + (at phase.monad in {analysis.#Extension self (list)})) + + (synthesis (..dummy_generation self phase archive []) + (at phase.monad in {synthesis.#Extension self (list)})) + + (generation (..dummy_generation self phase archive []) + (at phase.monad in + (for @.jvm (jvm.string self) + @.js (js.string self) + @.python (python.unicode self) + @.lua (lua.string self) + @.ruby (ruby.string self) + @.php (php.string self) + @.scheme (scheme.string self)))) + + ... Declaration + (declaration (..my_declaration self phase archive [expression .any]) + (do [! phase.monad] + [analysis_phase declaration.analysis + expressionA (<| declaration.lifted_analysis + (type.expecting .Any) + (analysis_phase archive expression)) + + synthesis_phase declaration.synthesis + expressionS (declaration.lifted_synthesis + (synthesis_phase archive expressionA)) + + generation_phase declaration.generation + expressionG (declaration.lifted_generation + (generation_phase archive expressionS)) + + _ (declaration.lifted_generation + (generation.with_new_context archive unit.none + (do ! + [[module_id artifact_id] (generation.context archive) + .let [commentary (format "Successfully installed declaration " (%.text self) "!")] + _ (generation.save! artifact_id {.#None} + (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] + (<| [$class] + (try.else (binary.empty 0)) + (try#each (binaryF.result class.format)) + (class.class version.v6_0 class.public + (name.internal $class) + {.#None} + (name.internal "java.lang.Object") + (list) + (list) + (list) + sequence.empty))) + @.js (js.comment commentary + (js.statement (js.string commentary))) + @.python (python.comment commentary + (python.statement (python.string commentary))) + @.lua (lua.comment commentary + (lua.statement expressionG)) + @.ruby (ruby.comment commentary + (ruby.statement (ruby.string commentary)))))] + (generation.log! commentary))))] + (in declaration.no_requirements))) + + (`` ((,, (static ..my_declaration)) (n.* 2 3))) + )) + +(def .public test + Test + (<| (_.covering /._) + (do random.monad + [expected random.nat] + (`` (all _.and + (,, (with_template [ ] + [(_.coverage [] + (for @.old false + (n.= expected + (`` ((,, (static )) expected)))))] + + [/.analysis ..my_analysis] + [/.synthesis ..my_synthesis])) + (_.coverage [/.generation] + (for @.old false + (and (n.= expected + (`` ((,, (static ..my_generation)) expected))) + (text#= ..dummy_generation + (`` ((,, (static ..dummy_generation)))))))) + (_.coverage [/.declaration] + true) + ))))) -- cgit v1.2.3