From 0952b1d1ca71089a092fde7758481ba4de71e151 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 31 Oct 2021 22:04:59 -0400 Subject: Properly inheriting the default profile in Aedifex. --- stdlib/commands.md | 16 ++++---- stdlib/project.lux | 14 +++---- stdlib/source/program/aedifex.lux | 1 - stdlib/source/program/aedifex/cli.lux | 2 +- stdlib/source/program/aedifex/input.lux | 2 +- stdlib/source/test/lux/extension.lux | 67 ++++++++++++++++++++++++--------- 6 files changed, 67 insertions(+), 35 deletions(-) diff --git a/stdlib/commands.md b/stdlib/commands.md index 27d476e1b..8f1ad95e5 100644 --- a/stdlib/commands.md +++ b/stdlib/commands.md @@ -17,11 +17,11 @@ cd ~/lux/stdlib/ \ cd ~/lux/stdlib/ \ && lux clean \ -&& lux with python with bibliotheca auto test +&& lux with lua with bibliotheca auto test cd ~/lux/stdlib/ \ && lux clean \ -&& lux with lua with bibliotheca auto test +&& lux with python with bibliotheca auto test cd ~/lux/stdlib/ \ && lux clean \ @@ -70,18 +70,18 @@ cd ~/lux/stdlib/ \ && lux with js with scriptum build \ && node ~/lux/stdlib/target/program.js > ~/lux/documentation/library/standard/js.md -### Python -cd ~/lux/stdlib/ \ -&& lux clean \ -&& lux with python with scriptum build \ -&& python3 ~/lux/stdlib/target/program.py > ~/lux/documentation/library/standard/python.md - ### Lua cd ~/lux/stdlib/ \ && lux clean \ && lux with lua with scriptum build \ && ~/lua-5.4.2/install/bin/lua ~/lux/stdlib/target/program.lua > ~/lux/documentation/library/standard/lua.md +### Python +cd ~/lux/stdlib/ \ +&& lux clean \ +&& lux with python with scriptum build \ +&& python3 ~/lux/stdlib/target/program.py > ~/lux/documentation/library/standard/python.md + ### Ruby cd ~/lux/stdlib/ \ && lux clean \ diff --git a/stdlib/project.lux b/stdlib/project.lux index 70692c928..0644065ff 100644 --- a/stdlib/project.lux +++ b/stdlib/project.lux @@ -57,20 +57,20 @@ ... "js" ["node" "--stack_size=8192"] ] - "python" - ["compiler" ["com.github.luxlang" "lux-python" "0.6.3" "jar"] - ... The OS command to use when running Python tests. The default is described below. - ... "python" ["python3"] - ] - "lua" ["compiler" ["com.github.luxlang" "lux-lua" "0.6.3" "jar"] ... The OS command to use when running Lua tests. The default is described below. ... "lua" ["lua"] ] + "python" + ["compiler" ["com.github.luxlang" "lux-python" "0.6.3" "jar"] + ... The OS command to use when running Python tests. The default is described below. + ... "python" ["python3"] + ] + "ruby" - ["compiler" ["com.github.luxlang" "lux-ruby" "0.6.3" "jar"] + ["compiler" ["com.github.luxlang" "lux-ruby" "0.6.4-SNAPSHOT" "jar"] ... The OS command to use when running Ruby tests. The default is described below. ... "ruby" ["ruby"] ] diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index 9017c8c19..e61b08397 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -45,7 +45,6 @@ ["[1][0]" action {"+" Action}] ["[1][0]" project {"+" Project}] ["[1][0]" input] - ["[1][0]" parser] ["[1][0]" pom] ["[1][0]" cli] ["[1][0]" dependency "_" diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux index dc91daff0..2bcf90338 100644 --- a/stdlib/source/program/aedifex/cli.lux +++ b/stdlib/source/program/aedifex/cli.lux @@ -98,6 +98,6 @@ [head cli.any [tail command] command] (in [{.#Item head tail} command]))) - (# <>.monad each (|>> [(list /.default)]) + (# <>.monad each (|>> [(list)]) ..command') )))) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index 669ef3aa8..c824e7497 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -58,5 +58,5 @@ (do [! try.monad] [it it it (..project_parser it) - it (monad.each ! (//project.profile it) profiles)] + it (monad.each ! (//project.profile it) (list& //profile.default profiles))] (in (mix.with_monoid //profile.monoid list.mix it))))))) diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 63f3b0d5d..8a4d58f25 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -25,6 +25,8 @@ [collection ["[0]" sequence] ["[0]" list ("[1]#[0]" functor)]]] + [macro + ["[0]" template]] [math ["[0]" random] [number @@ -36,6 +38,7 @@ [lux ["[0]" analysis] ["[0]" synthesis] + ["[0]" generation] ["[0]" directive] [phase [analysis @@ -44,11 +47,18 @@ [\\library ["[0]" / {"+" analysis: synthesis: generation: directive:}]]) -(def: my_analysis "my analysis") -(def: my_synthesis "my synthesis") -(def: my_generation "my generation") (def: dummy_generation "dummy generation") -(def: my_directive "my directive") + +(template [] + [(def: + Text + (`` (%.symbol (symbol (~~ (template.symbol [.._ ]))))))] + + [analysis] + [synthesis] + [generation] + [directive] + ) ... Generation (for [@.old @@ -62,33 +72,33 @@ (as_is)) ... Analysis - (analysis: (..my_analysis self phase archive [pass_through .any]) + (analysis: (..analysis self phase archive [pass_through .any]) (phase archive pass_through)) ... Synthesis - (analysis: (..my_synthesis self phase archive [parameters (<>.some .any)]) + (analysis: (..synthesis self phase archive [parameters (<>.some .any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {analysis.#Extension self}))))) - (synthesis: (..my_synthesis self phase archive [pass_through .any]) + (synthesis: (..synthesis self phase archive [pass_through .any]) (phase archive pass_through)) ... Generation - (analysis: (..my_generation self phase archive [parameters (<>.some .any)]) + (analysis: (..generation self phase archive [parameters (<>.some .any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {analysis.#Extension self}))))) - (synthesis: (..my_generation self phase archive [parameters (<>.some .any)]) + (synthesis: (..generation self phase archive [parameters (<>.some .any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {synthesis.#Extension self}))))) - (generation: (..my_generation self phase archive [pass_through .any]) + (generation: (..generation self phase archive [pass_through .any]) (for [@.jvm (# phase.monad each (|>> {jvm.#Embedded} sequence.sequence) (phase archive pass_through))] @@ -113,12 +123,35 @@ @.scheme (scheme.string self)]))) ... Directive - (directive: (..my_directive self phase archive [parameters (<>.some .any)]) - (do phase.monad - [.let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]] + (directive: (..directive self phase archive [expression .any]) + (do [! phase.monad] + [analysis_phase directive.analysis + expressionA (directive.lifted_analysis + (type.with_type .Any + (analysis_phase archive expression))) + + synthesis_phase directive.synthesis + expressionS (directive.lifted_synthesis + (synthesis_phase archive expressionA)) + + generation_phase directive.generation + expressionG (directive.lifted_generation + (generation_phase archive expressionS)) + + _ (directive.lifted_generation + (generation.with_new_context archive + (do ! + [[module_id artifact_id] (generation.context archive) + .let [commentary (format "Successfully installed directive " (%.text self) "!")] + _ (generation.save! artifact_id {.#None} + (for [@.js (js.comment commentary + (js.statement (js.string commentary))) + @.ruby (ruby.comment commentary + (ruby.statement (ruby.string commentary)))]))] + (generation.log! commentary))))] (in directive.no_requirements))) - (`` ((~~ (static ..my_directive)))) + (`` ((~~ (static ..directive)) (n.* 2 3))) )) (def: .public test @@ -134,13 +167,13 @@ (n.= expected (`` ((~~ (static )) expected)))))] - [/.analysis: ..my_analysis] - [/.synthesis: ..my_synthesis])) + [/.analysis: ..analysis] + [/.synthesis: ..synthesis])) (_.cover [/.generation:] (for [@.old false] (and (n.= expected - (`` ((~~ (static ..my_generation)) expected))) + (`` ((~~ (static ..generation)) expected))) (text#= ..dummy_generation (`` ((~~ (static ..dummy_generation)))))))) (_.cover [/.directive:] -- cgit v1.2.3