From 0b2294bc184b1ed3e82dc00096e9971245239e2c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 1 Oct 2022 18:39:48 -0400 Subject: New format for extensions [part 1] --- stdlib/source/test/lux/meta/extension.lux | 45 ++++++++++++++++++------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux index 419570970..44d884440 100644 --- a/stdlib/source/test/lux/meta/extension.lux +++ b/stdlib/source/test/lux/meta/extension.lux @@ -94,14 +94,16 @@ (phase archive pass_through)) ... Synthesis + (def my_synthesis|synthesis + Synthesis + (synthesis (_ self phase archive [pass_through .any]) + (phase archive pass_through))) + (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)) + (at ! each (|>> {analysis.#Extension (symbol ..my_synthesis|synthesis)}))))) ... Generation (def my_generation|generation @@ -109,17 +111,19 @@ (generation (_ self phase archive [pass_through .any]) (phase archive pass_through))) - (analysis (..my_generation self phase archive [parameters (<>.some .any)]) - (let [! phase.monad] - (|> parameters - (monad.each ! (phase archive)) - (at ! each (|>> {analysis.#Extension self}))))) + (def my_generation|synthesis + Synthesis + (synthesis (_ self phase archive [parameters (<>.some .any)]) + (let [! phase.monad] + (|> parameters + (monad.each ! (phase archive)) + (at ! each (|>> {synthesis.#Extension (symbol ..my_generation|generation)})))))) - (synthesis (..my_generation self phase archive [parameters (<>.some .any)]) + (analysis (..my_generation self phase archive [parameters (<>.some .any)]) (let [! phase.monad] (|> parameters (monad.each ! (phase archive)) - (at ! each (|>> {synthesis.#Extension (symbol ..my_generation|generation)}))))) + (at ! each (|>> {analysis.#Extension (symbol ..my_generation|synthesis)}))))) (def dummy_generation|generation Generation @@ -134,11 +138,13 @@ @.php (php.string self) @.scheme (scheme.string self)))))) - (analysis (..dummy_generation self phase archive []) - (at phase.monad in {analysis.#Extension self (list)})) + (def dummy_generation|synthesis + Synthesis + (synthesis (_ self phase archive []) + (at phase.monad in {synthesis.#Extension (symbol ..dummy_generation|generation) (list)}))) - (synthesis (..dummy_generation 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)})) ... Declaration (declaration (..my_declaration self phase archive [expression .any]) @@ -148,13 +154,14 @@ (type.expecting .Any) (analysis_phase archive expression)) - synthesis_phase declaration.synthesis - expressionS (declaration.lifted_synthesis - (synthesis_phase archive expressionA)) - lux (<| declaration.lifted_analysis extension.lifted meta.compiler_state) + + synthesis_phase declaration.synthesis + expressionS (declaration.lifted_synthesis + (synthesis_phase lux archive expressionA)) + generation_phase declaration.generation expressionG (declaration.lifted_generation (generation_phase lux archive expressionS)) -- cgit v1.2.3