aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test
diff options
context:
space:
mode:
authorEduardo Julian2022-10-01 20:50:49 -0400
committerEduardo Julian2022-10-01 20:50:49 -0400
commitd82a9b1166902ecca9a9a6eb3e1bb2195c73d9b7 (patch)
treed94337412a0761e37b6a38f435d63e970071f4b6 /stdlib/source/test
parent0b2294bc184b1ed3e82dc00096e9971245239e2c (diff)
New format for extensions [part 2]
Diffstat (limited to 'stdlib/source/test')
-rw-r--r--stdlib/source/test/lux/meta/extension.lux52
1 files changed, 28 insertions, 24 deletions
diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux
index 44d884440..a7f585379 100644
--- a/stdlib/source/test/lux/meta/extension.lux
+++ b/stdlib/source/test/lux/meta/extension.lux
@@ -64,16 +64,11 @@
[\\library
["[0]" / (.only analysis synthesis generation declaration)]])))
-(def dummy_generation "dummy generation")
-
(with_template [<name>]
[(def <name>
Text
(`` (%.symbol (symbol (,, (template.symbol [.._ <name>]))))))]
- [my_analysis]
- [my_synthesis]
- [my_generation]
[my_declaration]
)
@@ -90,8 +85,10 @@
(these))
... Analysis
- (analysis (..my_analysis self phase archive [pass_through <code>.any])
- (phase archive pass_through))
+ (def my_analysis
+ Analysis
+ (analysis (_ self phase archive [pass_through <code>.any])
+ (phase archive pass_through)))
... Synthesis
(def my_synthesis|synthesis
@@ -99,11 +96,13 @@
(synthesis (_ self phase archive [pass_through <analysis>.any])
(phase archive pass_through)))
- (analysis (..my_synthesis self phase archive [parameters (<>.some <code>.any)])
- (let [! phase.monad]
- (|> parameters
- (monad.each ! (phase archive))
- (at ! each (|>> {analysis.#Extension (symbol ..my_synthesis|synthesis)})))))
+ (def my_synthesis
+ Analysis
+ (analysis (_ self phase archive [parameters (<>.some <code>.any)])
+ (let [! phase.monad]
+ (|> parameters
+ (monad.each ! (phase archive))
+ (at ! each (|>> {analysis.#Extension (symbol ..my_synthesis|synthesis)}))))))
... Generation
(def my_generation|generation
@@ -119,16 +118,18 @@
(monad.each ! (phase archive))
(at ! each (|>> {synthesis.#Extension (symbol ..my_generation|generation)}))))))
- (analysis (..my_generation self phase archive [parameters (<>.some <code>.any)])
- (let [! phase.monad]
- (|> parameters
- (monad.each ! (phase archive))
- (at ! each (|>> {analysis.#Extension (symbol ..my_generation|synthesis)})))))
+ (def my_generation
+ Analysis
+ (analysis (_ self phase archive [parameters (<>.some <code>.any)])
+ (let [! phase.monad]
+ (|> parameters
+ (monad.each ! (phase archive))
+ (at ! each (|>> {analysis.#Extension (symbol ..my_generation|synthesis)}))))))
(def dummy_generation|generation
Generation
(generation (_ self phase archive [])
- (let [self ..dummy_generation]
+ (let [[_ self] (symbol ..dummy_generation)]
(at phase.monad in
(for @.jvm (jvm.string self)
@.js (js.string self)
@@ -143,8 +144,10 @@
(synthesis (_ self phase archive [])
(at phase.monad in {synthesis.#Extension (symbol ..dummy_generation|generation) (list)})))
- (analysis (..dummy_generation self phase archive [])
- (at phase.monad in {analysis.#Extension (symbol ..dummy_generation|synthesis) (list)}))
+ (def dummy_generation
+ Analysis
+ (analysis (_ self phase archive [])
+ (at phase.monad in {analysis.#Extension (symbol ..dummy_generation|synthesis) (list)})))
... Declaration
(declaration (..my_declaration self phase archive [expression <code>.any])
@@ -208,16 +211,17 @@
[(_.coverage [<macro>]
(for @.old false
(n.= expected
- (`` ((,, (static <extension>)) expected)))))]
+ (<extension> 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))))))))
+ (..my_generation expected))
+ (let [[_ expected] (symbol ..dummy_generation)]
+ (text#= expected
+ (..dummy_generation))))))
(_.coverage [/.declaration]
true)
)))))