From 14a5d4377431c7fc7a13b71cfbbaeb7baa116d29 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Jul 2022 18:04:30 -0400 Subject: Moved "lux/extension" to "lux/meta/extension". --- stdlib/source/library/lux/extension.lux | 70 ---------------------------- stdlib/source/library/lux/ffi/export.js.lux | 2 +- stdlib/source/library/lux/ffi/export.lua.lux | 2 +- stdlib/source/library/lux/ffi/export.py.lux | 2 +- stdlib/source/library/lux/ffi/export.rb.lux | 2 +- stdlib/source/library/lux/math.lux | 2 +- stdlib/source/library/lux/meta/extension.lux | 70 ++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 stdlib/source/library/lux/extension.lux create mode 100644 stdlib/source/library/lux/meta/extension.lux (limited to 'stdlib/source/library') diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux deleted file mode 100644 index 3ab53a44a..000000000 --- a/stdlib/source/library/lux/extension.lux +++ /dev/null @@ -1,70 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - ["[0]" monad]] - [control - ["<>" parser (.use "[1]#[0]" monad)]] - [data - ["[0]" product] - [collection - ["[0]" list (.use "[1]#[0]" functor)]]] - [meta - ["[0]" code (.only) - ["" \\parser (.only Parser)]] - [macro (.only with_symbols) - [syntax (.only syntax)]] - [compiler - ["[0]" phase] - [language - [lux - [analysis - ["" \\parser]] - [synthesis - ["" \\parser]]]]]]]]) - -(type Declaration - (Record - [#name Code - #label Text - #phase Text - #archive Text - #inputs (List Code)])) - -(def (declarationP default) - (-> Code (Parser Declaration)) - (.form (all <>.and - .any - .local - .local - .local - (.tuple (<>.some .any))))) - -(with_template [ ] - [(def .public - (syntax (_ [[name extension phase archive inputs] (..declarationP (` )) - body .any]) - (let [g!name (code.local extension) - g!phase (code.local phase) - g!archive (code.local archive)] - (with_symbols [g!handler g!inputs g!error g!_] - (in (list (` ( (, name) - (.function ((, g!handler) (, g!name) (, g!phase) (, g!archive) (, g!inputs)) - (.case ((,! ) - ((,! monad.do) (,! <>.monad) - [(,* inputs) - (, g!_) ] - (.at (,! <>.monad) (,' in) (, body))) - (, g!inputs)) - {.#Right (, g!_)} - (, g!_) - - {.#Left (, g!error)} - ((,! phase.failure) (, g!error))) - )))))))))] - - [.any .end .and .result "lux def analysis" analysis] - [.any .end .and .result "lux def synthesis" synthesis] - [.any .end .and .result "lux def generation" generation] - [.any .end .and .result "lux def declaration" declaration] - ) diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index bb725ed0c..66009f8ba 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - [extension (.only declaration)] [abstract ["[0]" monad (.only do)]] [control @@ -15,6 +14,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + [extension (.only declaration)] ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index c59c410ae..30af57aa4 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - [extension (.only declaration)] [abstract ["[0]" monad (.only do)]] [control @@ -15,6 +14,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + [extension (.only declaration)] ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index 70c5fc591..370ed7a9d 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - [extension (.only declaration)] [abstract ["[0]" monad (.only do)]] [control @@ -15,6 +14,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + [extension (.only declaration)] ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index df3ab6f85..1558aad67 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except global) - [extension (.only declaration)] [abstract ["[0]" monad (.only do)]] [control @@ -16,6 +15,7 @@ [math ["[0]" random]] ["[0]" meta (.only) + [extension (.only declaration)] ["[0]" static] ["[0]" type] ["[0]" code (.only) diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index bbad785af..486c7221a 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - [extension (.only analysis)] [abstract ["[0]" monad (.only do)]] [control @@ -14,6 +13,7 @@ [collection ["[0]" list (.use "[1]#[0]" mix)]]] [meta + [extension (.only analysis)] ["@" target] ["[0]" static] ["[0]" code diff --git a/stdlib/source/library/lux/meta/extension.lux b/stdlib/source/library/lux/meta/extension.lux new file mode 100644 index 000000000..3ab53a44a --- /dev/null +++ b/stdlib/source/library/lux/meta/extension.lux @@ -0,0 +1,70 @@ +(.require + [library + [lux (.except) + [abstract + ["[0]" monad]] + [control + ["<>" parser (.use "[1]#[0]" monad)]] + [data + ["[0]" product] + [collection + ["[0]" list (.use "[1]#[0]" functor)]]] + [meta + ["[0]" code (.only) + ["" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)]] + [compiler + ["[0]" phase] + [language + [lux + [analysis + ["" \\parser]] + [synthesis + ["" \\parser]]]]]]]]) + +(type Declaration + (Record + [#name Code + #label Text + #phase Text + #archive Text + #inputs (List Code)])) + +(def (declarationP default) + (-> Code (Parser Declaration)) + (.form (all <>.and + .any + .local + .local + .local + (.tuple (<>.some .any))))) + +(with_template [ ] + [(def .public + (syntax (_ [[name extension phase archive inputs] (..declarationP (` )) + body .any]) + (let [g!name (code.local extension) + g!phase (code.local phase) + g!archive (code.local archive)] + (with_symbols [g!handler g!inputs g!error g!_] + (in (list (` ( (, name) + (.function ((, g!handler) (, g!name) (, g!phase) (, g!archive) (, g!inputs)) + (.case ((,! ) + ((,! monad.do) (,! <>.monad) + [(,* inputs) + (, g!_) ] + (.at (,! <>.monad) (,' in) (, body))) + (, g!inputs)) + {.#Right (, g!_)} + (, g!_) + + {.#Left (, g!error)} + ((,! phase.failure) (, g!error))) + )))))))))] + + [.any .end .and .result "lux def analysis" analysis] + [.any .end .and .result "lux def synthesis" synthesis] + [.any .end .and .result "lux def generation" generation] + [.any .end .and .result "lux def declaration" declaration] + ) -- cgit v1.2.3