diff options
Diffstat (limited to 'stdlib/source')
-rw-r--r-- | stdlib/source/program/aedifex.lux | 1 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/cli.lux | 2 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/input.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/extension.lux | 67 |
4 files changed, 52 insertions, 20 deletions
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 [<name>] + [(def: <name> + Text + (`` (%.symbol (symbol (~~ (template.symbol [.._ <name>]))))))] + + [analysis] + [synthesis] + [generation] + [directive] + ) ... Generation (for [@.old @@ -62,33 +72,33 @@ (as_is)) ... Analysis - (analysis: (..my_analysis self phase archive [pass_through <code>.any]) + (analysis: (..analysis self phase archive [pass_through <code>.any]) (phase archive pass_through)) ... Synthesis - (analysis: (..my_synthesis self phase archive [parameters (<>.some <code>.any)]) + (analysis: (..synthesis self phase archive [parameters (<>.some <code>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {analysis.#Extension self}))))) - (synthesis: (..my_synthesis self phase archive [pass_through <analysis>.any]) + (synthesis: (..synthesis self phase archive [pass_through <analysis>.any]) (phase archive pass_through)) ... Generation - (analysis: (..my_generation self phase archive [parameters (<>.some <code>.any)]) + (analysis: (..generation self phase archive [parameters (<>.some <code>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {analysis.#Extension self}))))) - (synthesis: (..my_generation self phase archive [parameters (<>.some <analysis>.any)]) + (synthesis: (..generation self phase archive [parameters (<>.some <analysis>.any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) (# ! each (|>> {synthesis.#Extension self}))))) - (generation: (..my_generation self phase archive [pass_through <synthesis>.any]) + (generation: (..generation self phase archive [pass_through <synthesis>.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 <code>.any)]) - (do phase.monad - [.let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]] + (directive: (..directive self phase archive [expression <code>.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 <extension>)) 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:] |