aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2021-10-31 22:04:59 -0400
committerEduardo Julian2021-10-31 22:04:59 -0400
commit0952b1d1ca71089a092fde7758481ba4de71e151 (patch)
tree10df078a5796cb9aaeaf3ad6e78cc4c33cad3adb /stdlib/source
parentda89da48cbe538521790f8a1bdc64ffae21161b5 (diff)
Properly inheriting the default profile in Aedifex.
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/program/aedifex.lux1
-rw-r--r--stdlib/source/program/aedifex/cli.lux2
-rw-r--r--stdlib/source/program/aedifex/input.lux2
-rw-r--r--stdlib/source/test/lux/extension.lux67
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:]