From 7e4c9ba2e02f06fa621ffe24bc0ca046536429ef Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 2 Jul 2022 16:32:00 -0400 Subject: Moved "lux/macro" to "lux/meta/macro". --- .../source/library/lux/abstract/monad/indexed.lux | 6 +- .../source/library/lux/control/concatenative.lux | 8 +- .../library/lux/control/concurrency/actor.lux | 4 +- .../library/lux/control/concurrency/async.lux | 4 +- .../source/library/lux/control/concurrency/stm.lux | 4 +- stdlib/source/library/lux/control/continuation.lux | 6 +- stdlib/source/library/lux/control/exception.lux | 12 +- .../library/lux/control/function/contract.lux | 4 +- .../source/library/lux/control/function/inline.lux | 8 +- .../source/library/lux/control/function/mutual.lux | 10 +- stdlib/source/library/lux/control/io.lux | 12 +- stdlib/source/library/lux/control/lazy.lux | 10 +- stdlib/source/library/lux/control/pipe.lux | 6 +- stdlib/source/library/lux/control/remember.lux | 14 +- .../library/lux/control/security/capability.lux | 15 +- .../library/lux/data/collection/dictionary.lux | 7 +- .../lux/data/collection/dictionary/ordered.lux | 7 +- .../library/lux/data/collection/sequence.lux | 8 +- stdlib/source/library/lux/data/collection/set.lux | 7 +- .../library/lux/data/collection/set/multi.lux | 4 +- .../source/library/lux/data/collection/stream.lux | 6 +- stdlib/source/library/lux/data/collection/tree.lux | 6 +- .../source/library/lux/data/format/css/class.lux | 4 +- stdlib/source/library/lux/data/format/css/id.lux | 4 +- .../library/lux/data/format/css/property.lux | 8 +- .../source/library/lux/data/format/css/query.lux | 6 +- .../library/lux/data/format/css/selector.lux | 4 +- .../source/library/lux/data/format/css/value.lux | 12 +- stdlib/source/library/lux/data/format/html.lux | 4 +- stdlib/source/library/lux/data/format/json.lux | 8 +- stdlib/source/library/lux/data/format/markdown.lux | 6 +- stdlib/source/library/lux/data/format/tar.lux | 12 +- stdlib/source/library/lux/data/text.lux | 7 +- stdlib/source/library/lux/data/text/encoding.lux | 4 +- stdlib/source/library/lux/data/text/escape.lux | 8 +- stdlib/source/library/lux/data/text/regex.lux | 8 +- stdlib/source/library/lux/debug.lux | 20 +- stdlib/source/library/lux/documentation.lux | 10 +- stdlib/source/library/lux/extension.lux | 6 +- stdlib/source/library/lux/ffi.jvm.lux | 16 +- stdlib/source/library/lux/ffi.lux | 12 +- stdlib/source/library/lux/ffi.old.lux | 10 +- stdlib/source/library/lux/ffi.php.lux | 8 +- stdlib/source/library/lux/ffi.scm.lux | 8 +- stdlib/source/library/lux/ffi/export.js.lux | 6 +- stdlib/source/library/lux/ffi/export.jvm.lux | 6 +- stdlib/source/library/lux/ffi/export.lua.lux | 6 +- stdlib/source/library/lux/ffi/export.py.lux | 6 +- stdlib/source/library/lux/ffi/export.rb.lux | 6 +- stdlib/source/library/lux/locale/language.lux | 4 +- stdlib/source/library/lux/locale/territory.lux | 4 +- stdlib/source/library/lux/macro.lux | 214 ----------------- stdlib/source/library/lux/macro/context.lux | 159 ------------- stdlib/source/library/lux/macro/local.lux | 144 ------------ stdlib/source/library/lux/macro/pattern.lux | 256 --------------------- stdlib/source/library/lux/macro/syntax.lux | 99 -------- stdlib/source/library/lux/macro/syntax/check.lux | 41 ---- .../library/lux/macro/syntax/declaration.lux | 44 ---- .../source/library/lux/macro/syntax/definition.lux | 97 -------- stdlib/source/library/lux/macro/syntax/export.lux | 37 --- stdlib/source/library/lux/macro/syntax/input.lux | 43 ---- .../library/lux/macro/syntax/type/variable.lux | 25 -- stdlib/source/library/lux/macro/template.lux | 185 --------------- stdlib/source/library/lux/math.lux | 12 +- stdlib/source/library/lux/math/infix.lux | 6 +- stdlib/source/library/lux/math/modular.lux | 6 +- stdlib/source/library/lux/math/modulus.lux | 10 +- stdlib/source/library/lux/math/number.lux | 5 +- stdlib/source/library/lux/math/number/complex.lux | 6 +- stdlib/source/library/lux/math/number/frac.lux | 5 +- stdlib/source/library/lux/math/number/int.lux | 5 +- stdlib/source/library/lux/math/number/nat.lux | 5 +- stdlib/source/library/lux/math/number/ratio.lux | 6 +- stdlib/source/library/lux/math/random.lux | 8 +- stdlib/source/library/lux/meta.lux | 13 +- stdlib/source/library/lux/meta/code.lux | 6 +- stdlib/source/library/lux/meta/configuration.lux | 6 +- stdlib/source/library/lux/meta/macro.lux | 213 +++++++++++++++++ stdlib/source/library/lux/meta/macro/context.lux | 159 +++++++++++++ stdlib/source/library/lux/meta/macro/local.lux | 144 ++++++++++++ stdlib/source/library/lux/meta/macro/pattern.lux | 256 +++++++++++++++++++++ stdlib/source/library/lux/meta/macro/syntax.lux | 99 ++++++++ .../source/library/lux/meta/macro/syntax/check.lux | 41 ++++ .../library/lux/meta/macro/syntax/declaration.lux | 44 ++++ .../library/lux/meta/macro/syntax/definition.lux | 97 ++++++++ .../library/lux/meta/macro/syntax/export.lux | 37 +++ .../source/library/lux/meta/macro/syntax/input.lux | 43 ++++ .../lux/meta/macro/syntax/type/variable.lux | 25 ++ stdlib/source/library/lux/meta/macro/template.lux | 184 +++++++++++++++ stdlib/source/library/lux/meta/type.lux | 8 +- stdlib/source/library/lux/meta/type/check.lux | 7 +- stdlib/source/library/lux/meta/type/dynamic.lux | 6 +- stdlib/source/library/lux/meta/type/implicit.lux | 6 +- stdlib/source/library/lux/meta/type/poly.lux | 8 +- stdlib/source/library/lux/meta/type/primitive.lux | 12 +- stdlib/source/library/lux/meta/type/quotient.lux | 6 +- stdlib/source/library/lux/meta/type/refinement.lux | 6 +- stdlib/source/library/lux/meta/type/resource.lux | 6 +- stdlib/source/library/lux/meta/type/unit.lux | 6 +- stdlib/source/library/lux/meta/type/unit/scale.lux | 6 +- stdlib/source/library/lux/meta/version.lux | 6 +- stdlib/source/library/lux/program.lux | 6 +- stdlib/source/library/lux/static.lux | 6 +- stdlib/source/library/lux/target/common_lisp.lux | 4 +- stdlib/source/library/lux/target/js.lux | 4 +- stdlib/source/library/lux/target/jvm/attribute.lux | 7 +- stdlib/source/library/lux/target/jvm/bytecode.lux | 9 +- .../lux/target/jvm/bytecode/instruction.lux | 4 +- stdlib/source/library/lux/target/jvm/constant.lux | 6 +- .../library/lux/target/jvm/encoding/signed.lux | 4 +- .../library/lux/target/jvm/encoding/unsigned.lux | 4 +- stdlib/source/library/lux/target/jvm/modifier.lux | 10 +- .../source/library/lux/target/jvm/reflection.lux | 7 +- .../library/lux/target/jvm/type/category.lux | 4 +- stdlib/source/library/lux/target/lua.lux | 12 +- stdlib/source/library/lux/target/php.lux | 12 +- stdlib/source/library/lux/target/python.lux | 12 +- stdlib/source/library/lux/target/r.lux | 12 +- stdlib/source/library/lux/target/ruby.lux | 12 +- stdlib/source/library/lux/target/scheme.lux | 4 +- stdlib/source/library/lux/test.lux | 12 +- stdlib/source/library/lux/time/day.lux | 9 +- stdlib/source/library/lux/time/month.lux | 9 +- .../library/lux/tool/compiler/default/init.lux | 3 +- .../lux/tool/compiler/language/lux/analysis.lux | 6 +- .../compiler/language/lux/analysis/coverage.lux | 9 +- .../compiler/language/lux/analysis/inference.lux | 6 +- .../tool/compiler/language/lux/analysis/macro.lux | 4 +- .../tool/compiler/language/lux/analysis/module.lux | 4 +- .../tool/compiler/language/lux/analysis/simple.lux | 7 +- .../tool/compiler/language/lux/analysis/type.lux | 7 +- .../lux/tool/compiler/language/lux/generation.lux | 8 +- .../tool/compiler/language/lux/phase/analysis.lux | 6 +- .../compiler/language/lux/phase/analysis/case.lux | 4 +- .../language/lux/phase/analysis/reference.lux | 6 +- .../tool/compiler/language/lux/phase/extension.lux | 5 +- .../language/lux/phase/extension/analysis/jvm.lux | 6 +- .../language/lux/phase/extension/analysis/lux.lux | 4 +- .../lux/phase/extension/declaration/jvm.lux | 8 +- .../lux/phase/extension/declaration/lux.lux | 6 +- .../lux/phase/extension/generation/js/common.lux | 5 +- .../lux/phase/extension/generation/jvm/host.lux | 7 +- .../lux/phase/extension/generation/lua/common.lux | 5 +- .../phase/extension/generation/python/common.lux | 5 +- .../lux/phase/extension/generation/ruby/common.lux | 5 +- .../language/lux/phase/generation/common_lisp.lux | 5 +- .../lux/phase/generation/common_lisp/case.lux | 5 +- .../lux/phase/generation/common_lisp/runtime.lux | 6 +- .../language/lux/phase/generation/extension.lux | 6 +- .../compiler/language/lux/phase/generation/js.lux | 5 +- .../language/lux/phase/generation/js/case.lux | 5 +- .../language/lux/phase/generation/js/runtime.lux | 6 +- .../compiler/language/lux/phase/generation/jvm.lux | 5 +- .../language/lux/phase/generation/jvm/case.lux | 5 +- .../lux/phase/generation/jvm/primitive.lux | 5 +- .../compiler/language/lux/phase/generation/lua.lux | 5 +- .../language/lux/phase/generation/lua/case.lux | 5 +- .../language/lux/phase/generation/lua/runtime.lux | 6 +- .../compiler/language/lux/phase/generation/php.lux | 5 +- .../language/lux/phase/generation/php/case.lux | 5 +- .../language/lux/phase/generation/php/runtime.lux | 6 +- .../language/lux/phase/generation/python.lux | 5 +- .../language/lux/phase/generation/python/case.lux | 5 +- .../lux/phase/generation/python/runtime.lux | 6 +- .../compiler/language/lux/phase/generation/r.lux | 5 +- .../language/lux/phase/generation/r/case.lux | 7 +- .../language/lux/phase/generation/r/runtime.lux | 6 +- .../language/lux/phase/generation/ruby.lux | 5 +- .../language/lux/phase/generation/ruby/case.lux | 5 +- .../language/lux/phase/generation/ruby/runtime.lux | 6 +- .../language/lux/phase/generation/scheme.lux | 5 +- .../language/lux/phase/generation/scheme/case.lux | 7 +- .../phase/generation/scheme/extension/common.lux | 6 +- .../lux/phase/generation/scheme/runtime.lux | 6 +- .../tool/compiler/language/lux/phase/synthesis.lux | 5 +- .../compiler/language/lux/phase/synthesis/case.lux | 7 +- .../language/lux/phase/synthesis/function.lux | 7 +- .../compiler/language/lux/phase/synthesis/loop.lux | 7 +- .../language/lux/phase/synthesis/variable.lux | 7 +- .../lux/tool/compiler/language/lux/syntax.lux | 8 +- .../lux/tool/compiler/language/lux/synthesis.lux | 7 +- .../compiler/language/lux/synthesis/simple.lux | 7 +- .../compiler/meta/archive/artifact/category.lux | 7 +- .../compiler/meta/archive/module/descriptor.lux | 5 +- .../lux/tool/compiler/meta/archive/registry.lux | 4 +- .../compiler/meta/cache/dependency/artifact.lux | 6 +- .../source/library/lux/tool/compiler/meta/cli.lux | 6 +- .../library/lux/tool/compiler/meta/io/archive.lux | 6 +- .../source/library/lux/tool/compiler/reference.lux | 6 +- .../lux/tool/compiler/reference/variable.lux | 7 +- stdlib/source/library/lux/world/db/jdbc.lux | 8 +- stdlib/source/library/lux/world/db/jdbc/input.lux | 4 +- stdlib/source/library/lux/world/db/jdbc/output.lux | 4 +- stdlib/source/library/lux/world/db/sql.lux | 5 +- stdlib/source/library/lux/world/environment.lux | 7 +- stdlib/source/library/lux/world/file.lux | 5 +- .../source/library/lux/world/net/http/client.lux | 8 +- .../source/library/lux/world/net/http/request.lux | 5 +- .../source/library/lux/world/net/http/response.lux | 2 +- stdlib/source/library/lux/world/net/http/route.lux | 5 +- 200 files changed, 1959 insertions(+), 1909 deletions(-) delete mode 100644 stdlib/source/library/lux/macro.lux delete mode 100644 stdlib/source/library/lux/macro/context.lux delete mode 100644 stdlib/source/library/lux/macro/local.lux delete mode 100644 stdlib/source/library/lux/macro/pattern.lux delete mode 100644 stdlib/source/library/lux/macro/syntax.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/check.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/declaration.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/definition.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/export.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/input.lux delete mode 100644 stdlib/source/library/lux/macro/syntax/type/variable.lux delete mode 100644 stdlib/source/library/lux/macro/template.lux create mode 100644 stdlib/source/library/lux/meta/macro.lux create mode 100644 stdlib/source/library/lux/meta/macro/context.lux create mode 100644 stdlib/source/library/lux/meta/macro/local.lux create mode 100644 stdlib/source/library/lux/meta/macro/pattern.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/check.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/declaration.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/definition.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/export.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/input.lux create mode 100644 stdlib/source/library/lux/meta/macro/syntax/type/variable.lux create mode 100644 stdlib/source/library/lux/meta/macro/template.lux (limited to 'stdlib/source/library') diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index f6dd6a461..c321b7c3d 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -6,11 +6,11 @@ [data [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] ["[0]" //]) (type .public (IxMonad m) diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index ac78d307a..d82d73232 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -11,9 +11,6 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" mix functor)]]] - ["[0]" macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] @@ -23,7 +20,10 @@ ["[0]" meta (.only) ["[0]" type] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]]]]] [// ["<>" parser (.use "[1]#[0]" monad)]]) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index f6141f32d..7d7d7ca93 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -11,9 +11,9 @@ [data ["[0]" bit] ["[0]" product]] - [macro - ["[0]" local]] [meta + [macro + ["[0]" local]] [type (.only sharing) [primitive (.only primitive representation abstraction)]]]]] [// diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux index 37ab82cbe..822627610 100644 --- a/stdlib/source/library/lux/control/concurrency/async.lux +++ b/stdlib/source/library/lux/control/concurrency/async.lux @@ -12,9 +12,9 @@ ["[0]" maybe (.use "[1]#[0]" functor)]] [data ["[0]" product]] - [macro - ["^" pattern]] [meta + [macro + ["^" pattern]] [type (.only sharing) [primitive (.except)] ["[0]" variance (.only Mutable)]]]]] diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 3beedf568..80a363c74 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -13,9 +13,9 @@ ["[0]" product] [collection ["[0]" list]]] - [macro - ["^" pattern]] [meta + [macro + ["^" pattern]] [type (.only sharing) [primitive (.except)] ["[0]" variance (.only Mutable)]]]]] diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index 756804d7d..b0cda3ba1 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -7,11 +7,11 @@ [monad (.only Monad do)]] [control ["[0]" function]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)]]]]]) (type .public (Cont i o) (-> (-> i o) o)) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index cf9c51105..f07793cbd 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -11,17 +11,17 @@ ["[0]" text (.use "[1]#[0]" monoid)] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - ["[0]" macro (.only) - [syntax (.only syntax) - ["|[0]|" input] - ["[0]" type - ["|[1]_[0]|" variable]]]] [math [number ["n" nat (.use "[1]#[0]" decimal)]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax) + ["|[0]|" input] + ["[0]" type + ["|[1]_[0]|" variable]]]]]]] [// ["//" try (.only Try)]]) diff --git a/stdlib/source/library/lux/control/function/contract.lux b/stdlib/source/library/lux/control/function/contract.lux index 7b093341f..88a27dd5e 100644 --- a/stdlib/source/library/lux/control/function/contract.lux +++ b/stdlib/source/library/lux/control/function/contract.lux @@ -6,12 +6,12 @@ [data [text ["%" \\format (.only format)]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [math [number ["i" int]]] [meta + [macro (.only with_symbols) + [syntax (.only syntax)]] ["[0]" code (.only) ["<[1]>" \\parser]]]]]) diff --git a/stdlib/source/library/lux/control/function/inline.lux b/stdlib/source/library/lux/control/function/inline.lux index 135674144..299e0165f 100644 --- a/stdlib/source/library/lux/control/function/inline.lux +++ b/stdlib/source/library/lux/control/function/inline.lux @@ -8,12 +8,12 @@ [data [collection ["[0]" list (.use "[1]#[0]" monad)]]] - ["[0]" macro (.only) - [syntax (.only syntax) - ["|[0]|" export]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax) + ["|[0]|" export]]]]]]) (def declaration (Parser [Text (List Code)]) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 0dcf766f5..150d0f49f 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -12,13 +12,13 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - ["[0]" macro (.only) - ["[0]" local] - [syntax (.only syntax) - ["[0]" declaration (.only Declaration)]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + ["[0]" local] + [syntax (.only syntax) + ["[0]" declaration (.only Declaration)]]]]]] ["[0]" //]) (type Mutual diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index 318c96682..a4789fe50 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -5,14 +5,14 @@ [functor (.only Functor)] [apply (.only Apply)] [monad (.only Monad do)]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] [meta - [type - [primitive (.except)]] ["[0]" code - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) (primitive .public (IO a) (-> Any a) diff --git a/stdlib/source/library/lux/control/lazy.lux b/stdlib/source/library/lux/control/lazy.lux index b280b48e0..aaf3aafe6 100644 --- a/stdlib/source/library/lux/control/lazy.lux +++ b/stdlib/source/library/lux/control/lazy.lux @@ -10,13 +10,13 @@ ["[0]" io] [concurrency ["[0]" atom]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [meta - [type (.only sharing) - [primitive (.except)]] ["[0]" code - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)]] + [type (.only sharing) + [primitive (.except)]]]]]) (primitive .public (Lazy a) (-> [] a) diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index b16b4a167..23990201d 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -10,15 +10,15 @@ ["[0]" identity] [collection ["[0]" list (.use "[1]#[0]" monad)]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [math [number ["n" nat] ["i" int]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)]]]]]) (def body (Parser (List Code)) diff --git a/stdlib/source/library/lux/control/remember.lux b/stdlib/source/library/lux/control/remember.lux index 5165e2800..2900ee735 100644 --- a/stdlib/source/library/lux/control/remember.lux +++ b/stdlib/source/library/lux/control/remember.lux @@ -11,15 +11,15 @@ [data ["[0]" text ["%" \\format (.only format)]]] - [time - ["[0]" instant] - ["[0]" date (.only Date) (.use "[1]#[0]" order)]] - [macro - [syntax (.only syntax)] - ["[0]" template]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)] + ["[0]" template]]] + [time + ["[0]" instant] + ["[0]" date (.only Date) (.use "[1]#[0]" order)]]]]) (exception .public (must_remember [deadline Date today Date diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index 1a2cb4ed3..434bb215c 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -13,16 +13,15 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [meta - [type - [primitive (.except)]]] - ["[0]" macro (.only) - [syntax (.only syntax) - ["|[0]|" export] - ["|[0]|" declaration]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax) + ["|[0]|" export] + ["|[0]|" declaration]]] + [type + [primitive (.except)]]]]]) (primitive .public (Capability brand input output) (-> input output) diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index cd14464e8..dcbaf5621 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -16,12 +16,13 @@ ["[0]" list (.use "[1]#[0]" mix functor monoid)] ["[0]" array ["[1]" \\unsafe (.only Array)]]]] - [macro - ["^" pattern]] [math ["[0]" number (.only) ["n" nat] - ["[0]" i64]]]]]) + ["[0]" i64]]] + [meta + [macro + ["^" pattern]]]]]) ... This implementation of Hash Array Mapped Trie (HAMT) is based on ... Clojure's PersistentHashMap implementation. diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index 77729c0b3..4f0254bbb 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -11,11 +11,12 @@ ["p" product] [collection ["[0]" list (.use "[1]#[0]" monoid mix)]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]]) + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]]) (def error_message "Invariant violation") diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index 93bea49d4..e24e762d2 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -25,16 +25,16 @@ ["[0]" list (.use "[1]#[0]" mix functor monoid)] ["[0]" array ["[1]" \\unsafe (.only Array)]]]] - [macro - [syntax (.only syntax)] - ["^" pattern]] [math [number ["n" nat] ["[0]" i64]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)] + ["^" pattern]]]]]) (type (Node a) (Variant diff --git a/stdlib/source/library/lux/data/collection/set.lux b/stdlib/source/library/lux/data/collection/set.lux index 049acac93..e3bf42911 100644 --- a/stdlib/source/library/lux/data/collection/set.lux +++ b/stdlib/source/library/lux/data/collection/set.lux @@ -11,11 +11,12 @@ [data [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // ["[1]" dictionary (.only Dictionary)]]) diff --git a/stdlib/source/library/lux/data/collection/set/multi.lux b/stdlib/source/library/lux/data/collection/set/multi.lux index 0b0f1735e..3b3e2039d 100644 --- a/stdlib/source/library/lux/data/collection/set/multi.lux +++ b/stdlib/source/library/lux/data/collection/set/multi.lux @@ -8,12 +8,12 @@ [control ["[0]" function] ["[0]" maybe]] - [macro - ["^" pattern]] [math [number ["n" nat]]] [meta + [macro + ["^" pattern]] [type ["[0]" primitive (.only primitive abstraction representation)]]]]] ["[0]" // (.only) diff --git a/stdlib/source/library/lux/data/collection/stream.lux b/stdlib/source/library/lux/data/collection/stream.lux index 67708962c..e0b2088ee 100644 --- a/stdlib/source/library/lux/data/collection/stream.lux +++ b/stdlib/source/library/lux/data/collection/stream.lux @@ -11,14 +11,14 @@ ["[0]" bit] [collection ["[0]" list (.use "[1]#[0]" monad)]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [math [number ["n" nat]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)]]]]]) (type .public (Stream a) (Cont [a (Stream a)])) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index 7bde19f24..4ac0e5bed 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -11,11 +11,11 @@ [data [collection ["[0]" list (.use "[1]#[0]" monad mix)]]] - [macro - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)]]]]]) (type .public (Tree a) (Record diff --git a/stdlib/source/library/lux/data/format/css/class.lux b/stdlib/source/library/lux/data/format/css/class.lux index 1ddfdfebd..b7bc2409e 100644 --- a/stdlib/source/library/lux/data/format/css/class.lux +++ b/stdlib/source/library/lux/data/format/css/class.lux @@ -7,10 +7,10 @@ [data ["[0]" text (.use "[1]#[0]" hash) ["%" \\format (.only format)]]] - [macro - [syntax (.only syntax)]] [meta ["[0]" code] + [macro + [syntax (.only syntax)]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/data/format/css/id.lux b/stdlib/source/library/lux/data/format/css/id.lux index 45746b427..637e9915e 100644 --- a/stdlib/source/library/lux/data/format/css/id.lux +++ b/stdlib/source/library/lux/data/format/css/id.lux @@ -7,10 +7,10 @@ [data ["[0]" text (.use "[1]#[0]" hash) ["%" \\format (.only format)]]] - [macro - [syntax (.only syntax)]] [meta ["[0]" code] + [macro + [syntax (.only syntax)]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux index 353efa6c5..c537a0a0e 100644 --- a/stdlib/source/library/lux/data/format/css/property.lux +++ b/stdlib/source/library/lux/data/format/css/property.lux @@ -3,13 +3,13 @@ [lux (.except All Location) [data ["[0]" text]] - [macro - [syntax (.only syntax)] - ["[0]" template] - ["[0]" code]] [meta [code ["s" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template] + ["[0]" code]] [type [primitive (.except)]]]]] [// diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux index 859eb7910..ab8d92644 100644 --- a/stdlib/source/library/lux/data/format/css/query.lux +++ b/stdlib/source/library/lux/data/format/css/query.lux @@ -4,12 +4,12 @@ [data ["[0]" text (.only) ["%" \\format (.only format)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [meta ["[0]" code (.only syntax) ["s" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] [type [primitive (.except)]]]]] ["[0]" // diff --git a/stdlib/source/library/lux/data/format/css/selector.lux b/stdlib/source/library/lux/data/format/css/selector.lux index a994398fd..b584c1a4a 100644 --- a/stdlib/source/library/lux/data/format/css/selector.lux +++ b/stdlib/source/library/lux/data/format/css/selector.lux @@ -8,9 +8,9 @@ [math [number ["i" int]]] - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]] ["[0]" // diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index 877e4f8e6..3845d2cb6 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -10,9 +10,6 @@ ["%" \\format (.only Format format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] @@ -20,10 +17,13 @@ ["r" rev] ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]] [world [net (.only URL)]]]] [// diff --git a/stdlib/source/library/lux/data/format/html.lux b/stdlib/source/library/lux/data/format/html.lux index ba8f5ab31..0bdc6984b 100644 --- a/stdlib/source/library/lux/data/format/html.lux +++ b/stdlib/source/library/lux/data/format/html.lux @@ -10,9 +10,9 @@ ["%" \\format (.only Format format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]] [target diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index 1af453bb9..a7aecfd6b 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -21,16 +21,16 @@ ["[0]" list (.use "[1]#[0]" mix functor)] ["[0]" sequence (.only Sequence sequence) (.use "[1]#[0]" monad)] ["[0]" dictionary (.only Dictionary)]]] - [macro - [syntax (.only syntax)] - ["^" pattern]] [math [number ["n" nat] ["f" frac (.use "[1]#[0]" decimal)]]] ["[0]" meta (.only monad) ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["^" pattern]]]]]) (with_template [ ] [(type .public diff --git a/stdlib/source/library/lux/data/format/markdown.lux b/stdlib/source/library/lux/data/format/markdown.lux index ad8a20186..4b8e1a4a2 100644 --- a/stdlib/source/library/lux/data/format/markdown.lux +++ b/stdlib/source/library/lux/data/format/markdown.lux @@ -6,11 +6,11 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [world - [net (.only URL)]] [meta [type - [primitive (.except)]]]]]) + [primitive (.except)]]] + [world + [net (.only URL)]]]]) ... https://www.markdownguide.org/basic-syntax/ diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 38746e8eb..32ec4bdaa 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -24,20 +24,20 @@ ["[0]" sequence (.only Sequence) (.use "[1]#[0]" mix)] [array [\\unsafe (.only)]]]] - [macro - ["^" pattern]] [math ["[0]" number (.only) ["n" nat] ["[0]" i64]]] + [meta + [macro + ["^" pattern]] + [type + [primitive (.except)]]] [time ["[0]" instant (.only Instant)] ["[0]" duration]] [world - ["[0]" file]] - [meta - [type - [primitive (.except)]]]]]) + ["[0]" file]]]]) (type Size Nat) diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux index 3ab11ff3a..b9e6d0d07 100644 --- a/stdlib/source/library/lux/data/text.lux +++ b/stdlib/source/library/lux/data/text.lux @@ -14,12 +14,13 @@ [data [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - ["^" pattern]] [math [number ["n" nat] - ["[0]" i64]]]]]) + ["[0]" i64]]] + [meta + [macro + ["^" pattern]]]]]) (type .public Char Nat) diff --git a/stdlib/source/library/lux/data/text/encoding.lux b/stdlib/source/library/lux/data/text/encoding.lux index 25b91cfc0..5906ebf3b 100644 --- a/stdlib/source/library/lux/data/text/encoding.lux +++ b/stdlib/source/library/lux/data/text/encoding.lux @@ -1,9 +1,9 @@ (.require [library [lux (.except) - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux index 9963627fb..6dc9c137f 100644 --- a/stdlib/source/library/lux/data/text/escape.lux +++ b/stdlib/source/library/lux/data/text/escape.lux @@ -11,12 +11,12 @@ [math [number (.only hex) ["n" nat]]] - [macro - [syntax (.only syntax)] - ["^" pattern]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["^" pattern]]]]] ["[0]" // (.only Char) ["%" \\format (.only format)]]) diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux index 674a53f67..c78edc826 100644 --- a/stdlib/source/library/lux/data/text/regex.lux +++ b/stdlib/source/library/lux/data/text/regex.lux @@ -14,15 +14,15 @@ ["<[1]>" \\parser (.only Parser)]] [collection ["[0]" list (.use "[1]#[0]" mix monad)]]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["^" pattern]] [math [number (.only hex) ["n" nat (.use "[1]#[0]" decimal)]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["^" pattern]]]]] ["[0]" // (.only) ["%" \\format (.only format)]]) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index 6813e7cc2..2b27378b6 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -22,26 +22,26 @@ ["[0]" array] ["[0]" list (.use "[1]#[0]" monad)] ["[0]" dictionary]]] - [macro - ["^" pattern] - ["[0]" template] - ["[0]" syntax (.only syntax)]] [math [number [ratio (.only Ratio)] ["n" nat] ["i" int]]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser]] + [macro + ["^" pattern] + ["[0]" template] + ["[0]" syntax (.only syntax)]] + ["[0]" type (.only) + ["<[1]>" \\parser (.only Parser)]]] [time (.only Time) [instant (.only Instant)] [duration (.only Duration)] [date (.only Date)] [month (.only Month)] - [day (.only Day)]] - [meta - ["[0]" type (.only) - ["<[1]>" \\parser (.only Parser)]] - ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + [day (.only Day)]]]]) (with_expansions [ (these (import java/lang/String "[1]::[0]") diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 128cf5780..eb030edec 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -18,17 +18,17 @@ ["[0]" stream (.only Stream)]] [format ["md" markdown (.only Markdown Block)]]] - ["[0]" macro (.only) - [syntax (.only syntax)] - ["^" pattern] - ["[0]" template]] [math [number ["n" nat]]] ["[0]" meta (.only) ["[0]" type (.use "[1]#[0]" equivalence)] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax)] + ["^" pattern] + ["[0]" template]]] [tool [compiler [language diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux index de3c150af..8fcfd5a96 100644 --- a/stdlib/source/library/lux/extension.lux +++ b/stdlib/source/library/lux/extension.lux @@ -9,11 +9,11 @@ ["[0]" product] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["" \\parser (.only Parser)]]] + ["" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)]]] [tool [compiler ["[0]" phase] diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 5beaf4478..40db8e0c3 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -19,19 +19,19 @@ ["[0]" array] ["[0]" list (.use "[1]#[0]" monad mix monoid)] ["[0]" dictionary (.only Dictionary)]]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["^" pattern] - ["[0]" template] - ["[0]" context]] [math [number ["n" nat]]] [meta - ["[0]" type (.use "[1]#[0]" equivalence) - ["[0]" check]] ["[0]" code (.only) - ["<[1]>" \\parser(.only Parser)]]] + ["<[1]>" \\parser(.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["^" pattern] + ["[0]" template] + ["[0]" context]] + ["[0]" type (.use "[1]#[0]" equivalence) + ["[0]" check]]] [target ["[0]" jvm [encoding diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 3dd10ebe6..e204a0a4c 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -15,14 +15,14 @@ ["%" \\format]] [collection ["[0]" list (.use "[1]#[0]" monad mix)]]] - ["[0]" macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]] ["@" target (.only) ["[0]" js]]]]) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index 329fce274..802c3ba9a 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -18,14 +18,14 @@ [collection ["[0]" array (.only Array)] ["[0]" list (.use "[1]#[0]" monad mix monoid)]]] - ["[0]" macro (.only with_symbols) - [syntax (.only syntax)] - ["^" pattern] - ["[0]" template]] ["[0]" meta (.only) ["[0]" type (.use "[1]#[0]" equivalence)] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)] + ["^" pattern] + ["[0]" template]]]]]) (with_template [ ] [(def .public ( value) diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux index fecdf259a..87279aaf1 100644 --- a/stdlib/source/library/lux/ffi.php.lux +++ b/stdlib/source/library/lux/ffi.php.lux @@ -14,14 +14,14 @@ ["%" \\format]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] ["[0]" meta (.only) [type abstract] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]]]]]) (primitive .public (Object brand) Any) diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux index a324365fa..7ba628f1d 100644 --- a/stdlib/source/library/lux/ffi.scm.lux +++ b/stdlib/source/library/lux/ffi.scm.lux @@ -14,14 +14,14 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] ["[0]" meta (.only) [type abstract] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]]]]]) (primitive .public (Object brand) Any) diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index 511ef27a2..67f97651d 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -13,13 +13,13 @@ [collection ["[0]" list (.use "[1]#[0]" monad mix)] ["[0]" set]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math ["[0]" random]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] [target ["/" js]] [tool diff --git a/stdlib/source/library/lux/ffi/export.jvm.lux b/stdlib/source/library/lux/ffi/export.jvm.lux index 95a779da2..ddd8f9d50 100644 --- a/stdlib/source/library/lux/ffi/export.jvm.lux +++ b/stdlib/source/library/lux/ffi/export.jvm.lux @@ -6,11 +6,11 @@ [data [collection ["[0]" list (.use "[1]#[0]" monad)]]] - [macro - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)]]]]] ["[0]" //]) (type (API of) diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index 13efe101b..3d1b6e068 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -13,13 +13,13 @@ [collection ["[0]" list (.use "[1]#[0]" monad mix)] ["[0]" set]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math ["[0]" random]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] [target ["/" lua]] [tool diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index 9427d0b4c..bbcc9c295 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -13,13 +13,13 @@ [collection ["[0]" list (.use "[1]#[0]" monad mix)] ["[0]" set]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math ["[0]" random]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] [target ["/" python]] [tool diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index f11e4e0c4..56d67edca 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -15,13 +15,13 @@ [collection ["[0]" list (.use "[1]#[0]" monad mix)] ["[0]" set]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math ["[0]" random]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] [target ["/" ruby]] [tool diff --git a/stdlib/source/library/lux/locale/language.lux b/stdlib/source/library/lux/locale/language.lux index c5b008d11..ae11c87b1 100644 --- a/stdlib/source/library/lux/locale/language.lux +++ b/stdlib/source/library/lux/locale/language.lux @@ -6,9 +6,9 @@ [hash (.only Hash)]] [data ["[0]" text]] - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/locale/territory.lux b/stdlib/source/library/lux/locale/territory.lux index 153e0afd9..74c30fce6 100644 --- a/stdlib/source/library/lux/locale/territory.lux +++ b/stdlib/source/library/lux/locale/territory.lux @@ -6,9 +6,9 @@ [hash (.only Hash)]] [data ["[0]" text]] - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux deleted file mode 100644 index cc5c46d6d..000000000 --- a/stdlib/source/library/lux/macro.lux +++ /dev/null @@ -1,214 +0,0 @@ -(.require - [library - [lux (.except local symbol function macro) - [abstract - ["[0]" monad (.only do)]] - [data - ["[0]" text (.use "[1]#[0]" monoid)] - [collection - ["[0]" list (.use "[1]#[0]" monoid monad)]]] - [math - [number - ["[0]" nat] - ["[0]" int]]]]] - ["[0]" // - ["[1]" meta (.only) - ["[0]" code] - ["[0]" location] - ["[0]" symbol (.use "[1]#[0]" codec)]]]) - -(def .public (single_expansion syntax) - (-> Code (Meta (List Code))) - (case syntax - [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] - (do //.monad - [?macro (//.macro name)] - (case ?macro - {.#Some macro} - ((as Macro' macro) args) - - {.#None} - (at //.monad in (list syntax)))) - - _ - (at //.monad in (list syntax)))) - -(def .public (expansion syntax) - (-> Code (Meta (List Code))) - (case syntax - [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] - (do //.monad - [?macro (//.macro name)] - (case ?macro - {.#Some macro} - (do [! //.monad] - [top_level_expansion ((as Macro' macro) args)] - (|> top_level_expansion - (monad.each //.monad expansion) - (at ! each list#conjoint))) - - {.#None} - (at //.monad in (list syntax)))) - - _ - (at //.monad in (list syntax)))) - -(def .public (full_expansion syntax) - (-> Code (Meta (List Code))) - (case syntax - [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] - (do //.monad - [?macro (//.macro name)] - (case ?macro - {.#Some macro} - (do //.monad - [expansion ((as Macro' macro) args) - expansion' (monad.each //.monad full_expansion expansion)] - (in (list#conjoint expansion'))) - - {.#None} - (do //.monad - [parts' (monad.each //.monad full_expansion (list.partial (code.symbol name) args))] - (in (list (code.form (list#conjoint parts'))))))) - - [_ {.#Form {.#Item [harg targs]}}] - (do //.monad - [harg+ (full_expansion harg) - targs+ (monad.each //.monad full_expansion targs)] - (in (list (code.form (list#composite harg+ (list#conjoint (is (List (List Code)) targs+))))))) - - [_ {.#Variant members}] - (do //.monad - [members' (monad.each //.monad full_expansion members)] - (in (list (code.variant (list#conjoint members'))))) - - [_ {.#Tuple members}] - (do //.monad - [members' (monad.each //.monad full_expansion members)] - (in (list (code.tuple (list#conjoint members'))))) - - _ - (at //.monad in (list syntax)))) - -(def .public (symbol prefix) - (-> Text (Meta Code)) - (do //.monad - [id //.seed] - (in (|> id - (at nat.decimal encoded) - (all text#composite "__gensym__" prefix) - [""] code.symbol)))) - -(def (local ast) - (-> Code (Meta Text)) - (case ast - [_ {.#Symbol [_ name]}] - (at //.monad in name) - - _ - (//.failure (text#composite "Code is not a local symbol: " (code.format ast))))) - -(def .public wrong_syntax_error - (-> Symbol Text) - (|>> symbol#encoded - (text.prefix (text#composite "Wrong syntax for " text.\'')) - (text.suffix (text#composite text.\'' ".")))) - -(def .public with_symbols - (.macro (_ tokens) - (case tokens - (pattern (list [_ {.#Tuple symbols}] body)) - (do [! //.monad] - [symbol_names (monad.each ! ..local symbols) - .let [symbol_defs (list#conjoint (list#each (is (-> Text (List Code)) - (.function (_ name) (list (code.symbol ["" name]) (` (..symbol (, (code.text name))))))) - symbol_names))]] - (in (list (` ((,! do) (,! //.monad) - [(,* symbol_defs)] - (, body)))))) - - _ - (//.failure (..wrong_syntax_error (.symbol ..with_symbols)))))) - -(def .public (one_expansion token) - (-> Code (Meta Code)) - (do //.monad - [token+ (..expansion token)] - (case token+ - (pattern (list token')) - (in token') - - _ - (//.failure "Macro expanded to more than 1 element.")))) - -(with_template [ ] - [(def .public - (.macro (_ tokens) - (let [[module _] (.symbol .._) - [_ short] (.symbol ) - macro_name [module short]] - (case (is (Maybe [Bit Code]) - (case tokens - (pattern (list [_ {.#Text "omit"}] - token)) - {.#Some [#1 token]} - - (pattern (list token)) - {.#Some [#0 token]} - - _ - {.#None})) - {.#Some [omit? token]} - (do //.monad - [location //.location - output ( token) - .let [_ ("lux io log" (all text#composite (symbol#encoded macro_name) " " (location.format location))) - _ (list#each (|>> code.format "lux io log") - output) - _ ("lux io log" "")]] - (in (if omit? - (list) - output))) - - {.#None} - (//.failure (..wrong_syntax_error macro_name))))))] - - [log_single_expansion! ..single_expansion] - [log_expansion! ..expansion] - [log_full_expansion! ..full_expansion] - ) - -(def .public times - (.macro (_ tokens) - (case tokens - (pattern (list.partial [_ {.#Nat times}] terms)) - (loop (again [times times - before terms]) - (case times - 0 - (at //.monad in before) - - _ - (do [! //.monad] - [after (|> before - (monad.each ! ..single_expansion) - (at ! each list#conjoint))] - (again (-- times) after)))) - - _ - (//.failure (..wrong_syntax_error (.symbol ..times)))))) - -(def .public final - (.macro (_ it) - (let [! //.monad] - (|> it - (monad.each ! ..expansion) - (at ! each list#conjoint))))) - -(def .public function - (-> Macro Macro') - (|>> (as Macro'))) - -(def .public macro - (-> Macro' Macro) - (|>> (as Macro))) diff --git a/stdlib/source/library/lux/macro/context.lux b/stdlib/source/library/lux/macro/context.lux deleted file mode 100644 index 464d0cfea..000000000 --- a/stdlib/source/library/lux/macro/context.lux +++ /dev/null @@ -1,159 +0,0 @@ -(.require - [library - [lux (.except def global) - [abstract - [monad (.only do)]] - [control - ["?" parser] - ["[0]" exception (.only exception)] - ["[0]" maybe] - [function - [predicate (.only Predicate)]]] - [data - ["[0]" text (.use "[1]#[0]" equivalence monoid)] - [collection - ["[0]" list (.only) - ["[0]" property]]]] - ["[0]" meta (.only) - ["[0]" symbol (.use "[1]#[0]" codec)] - ["[0]" code (.only) - ["?[1]" \\parser]]]]] - ["[0]" // (.only) - [syntax (.only syntax)] - ["^" pattern]]) - -(type .public Stack - List) - -(exception .public (no_definition [it Symbol]) - (exception.report - "Definition" (symbol#encoded it))) - -(.def (global it) - (-> Symbol (Meta Any)) - (do meta.monad - [.let [[@ expected_name] it] - defs (meta.definitions @)] - (case (list.one (function (_ [actual_name [exported? type value]]) - (if (text#= expected_name actual_name) - {.#Some value} - {.#None})) - defs) - {.#Some it} - (in it) - - {.#None} - (meta.failure (exception.error ..no_definition [it]))))) - -(exception .public no_active_context) - -(.def (peek' _ context) - (All (_ a) (-> (Stack a) Symbol (Meta a))) - (do meta.monad - [stack (..global context)] - (case (|> stack - (as (Stack Any)) - list.head) - {.#Some top} - (in (as_expected top)) - - {.#None} - (meta.failure (exception.error ..no_active_context []))))) - -(.def .public peek - (syntax (_ [g!it (at ?.monad each code.symbol ?code.global)]) - (in (list (` ((,! ..peek') (, g!it) (.symbol (, g!it)))))))) - -(exception .public no_example) - -(.def (search' _ ? context) - (All (_ a) (-> (Stack a) (Predicate a) Symbol (Meta a))) - (do meta.monad - [stack (..global context)] - (case (|> stack - (as (Stack Any)) - (list.example (as (Predicate Any) ?))) - {.#Some it} - (in (as_expected it)) - - {.#None} - (meta.failure (exception.error ..no_example []))))) - -(.def .public search - (syntax (_ [g!context (at ?.monad each code.symbol ?code.global) - g!? ?code.any]) - (in (list (` ((,! ..search') (, g!context) (, g!?) (.symbol (, g!context)))))))) - -(.def (alter on_definition [@ context]) - (-> (-> Definition Definition) Symbol (Meta Any)) - (function (_ lux) - (let [on_global (is (-> Global Global) - (function (_ it) - (case it - {.#Definition it} - {.#Definition (on_definition it)} - - _ - it))) - on_globals (is (-> (property.List Global) (property.List Global)) - (property.revised context on_global)) - on_module (is (-> Module Module) - (revised .#definitions on_globals))] - {.#Right [(revised .#modules (property.revised @ on_module) lux) - []]}))) - -(.def (push' _ top) - (All (_ a) (-> (Stack a) a Symbol (Meta Any))) - (alter (function (_ [exported? type stack]) - (|> stack - (as (Stack Any)) - {.#Item top} - (is (Stack Any)) - [exported? type])))) - -(.def .public push - (syntax (_ [g!context (at ?.monad each code.symbol ?code.global) - g!it ?code.any]) - (in (list (` ((,! ..push') (, g!context) (, g!it) (.symbol (, g!context)))))))) - -(.def pop' - (-> Symbol (Meta Any)) - (alter (function (_ [exported? type value]) - [exported? type (let [value (as (Stack Any) value)] - (maybe.else value (list.tail value)))]))) - -(.def .public pop - (syntax (_ [expression? ?code.bit - context ?code.global]) - (do meta.monad - [_ (..pop' context)] - (in (if expression? - (list (' [])) - (list)))))) - -(.def .public def - (syntax (_ [.let [! ?.monad - ?local (at ! each code.local ?code.local)] - [$ g!expression g!declaration] (?code.tuple (all ?.and ?code.local ?local ?local)) - context_type ?code.any]) - (do [! meta.monad] - [@ meta.current_module_name - .let [g!context (code.symbol [@ $])]] - (//.with_symbols [g!it g!body g!_] - (in (list (` (.def (, (code.local $)) - (..Stack (, context_type)) - (list))) - (` (.def ((, g!expression) (, g!it) (, g!body)) - (-> (, context_type) Code (Meta Code)) - ((,! do) (,! meta.monad) - [(, g!_) ((,! ..push) (, g!context) (, g!it))] - ((,' in) (` (let [((,' ,') (, g!body)) ((,' ,) (, g!body)) - ((,' ,') (, g!_)) ((,! ..pop) #1 (, g!context))] - ((,' ,') (, g!body)))))))) - (` (.def ((, g!declaration) (, g!it) (, g!body)) - (-> (, context_type) Code (Meta (List Code))) - ((,! do) (,! meta.monad) - [(, g!_) ((,! ..push) (, g!context) (, g!it))] - ((,' in) (list (, g!body) - (` ((,! ..pop) #0 (, g!context)))))))) - )))))) diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux deleted file mode 100644 index 9b2ec3156..000000000 --- a/stdlib/source/library/lux/macro/local.lux +++ /dev/null @@ -1,144 +0,0 @@ -(.require - [library - [lux (.except with let) - [abstract - ["[0]" monad (.only do)]] - [control - ["<>" parser] - ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] - [data - ["[0]" product] - ["[0]" text] - [collection - ["[0]" list (.use "[1]#[0]" functor) - ["[0]" property]]]] - ["[0]" meta (.only) - ["[0]" code (.only) - ["<[1]>" \\parser]]]]] - ["[0]" // (.only) - [syntax (.only syntax)]]) - -(exception .public (unknown_module [module Text]) - (exception.report - "Module" (text.format module))) - -(with_template [] - [(exception .public ( [module Text - definition Text]) - (exception.report - "Module" (text.format module) - "Definition" (text.format definition)))] - - [cannot_shadow_definition] - [unknown_definition] - ) - -(def (with_module name body) - (All (_ a) (-> Text (-> Module (Try [Module a])) (Meta a))) - (function (_ compiler) - (case (|> compiler (the .#modules) (property.value name)) - {.#Some module} - (case (body module) - {try.#Success [module' output]} - {try.#Success [(revised .#modules (property.has name module') compiler) - output]} - - {try.#Failure error} - {try.#Failure error}) - - {.#None} - (exception.except ..unknown_module [name])))) - -(def (push_one [name macro]) - (-> [Symbol Macro] (Meta Any)) - (do meta.monad - [[module_name definition_name] (meta.normal name) - .let [definition (is Global {.#Definition [false .Macro macro]}) - add_macro! (is (-> (property.List Global) (property.List Global)) - (property.has definition_name definition))]] - (..with_module module_name - (function (_ module) - (case (|> module (the .#definitions) (property.value definition_name)) - {.#None} - {try.#Success [(revised .#definitions add_macro! module) - []]} - - {.#Some _} - (exception.except ..cannot_shadow_definition [module_name definition_name])))))) - -(def (pop_one name) - (-> Symbol (Meta Any)) - (do meta.monad - [[module_name definition_name] (meta.normal name) - .let [lacks_macro! (is (-> (property.List Global) (property.List Global)) - (property.lacks definition_name))]] - (..with_module module_name - (function (_ module) - (case (|> module (the .#definitions) (property.value definition_name)) - {.#Some _} - {try.#Success [(revised .#definitions lacks_macro! module) - []]} - - {.#None} - (exception.except ..unknown_definition [module_name definition_name])))))) - -(def (pop_all macros self) - (-> (List Symbol) Symbol Macro) - ("lux macro" - (function (_ _) - (do [! meta.monad] - [_ (monad.each ! ..pop_one macros) - _ (..pop_one self) - compiler meta.compiler_state] - (in (case (the .#expected compiler) - {.#Some _} - (list (' [])) - - {.#None} - (list))))))) - -(def .public (push macros) - (-> (List [Symbol Macro]) (Meta Code)) - (do meta.monad - [_ (monad.each meta.monad ..push_one macros) - seed meta.seed - g!pop (//.symbol "pop") - _ (.let [g!pop (is Symbol - ["" (code.format g!pop)])] - (..push_one [g!pop (..pop_all (list#each product.left macros) g!pop)]))] - (in (` ((, g!pop)))))) - -(def .public (with macros expression? body) - (-> (List [Symbol Macro]) Bit Code (Meta (List Code))) - (do [! meta.monad] - [g!pop (..push macros)] - (.if expression? - (//.with_symbols [g!body] - (in (list (` (.let [(, g!body) (, body)] - (exec - (, g!pop) - (, g!body))))))) - (in (list body - g!pop))))) - -(def .public let - (syntax (_ [locals (.tuple (<>.some (<>.and .local .any))) - body .any]) - (do [! meta.monad] - [here_name meta.current_module_name - locals (monad.each ! (function (_ [name value]) - (|> value - (meta.eval .Macro) - (at ! each (|>> (as .Macro) - [[here_name name]])))) - locals) - expression? (is (Meta Bit) - (function (_ lux) - {try.#Success [lux (case (the .#expected lux) - {.#None} - false - - {.#Some _} - true)]}))] - (..with locals expression? body)))) diff --git a/stdlib/source/library/lux/macro/pattern.lux b/stdlib/source/library/lux/macro/pattern.lux deleted file mode 100644 index affa8273a..000000000 --- a/stdlib/source/library/lux/macro/pattern.lux +++ /dev/null @@ -1,256 +0,0 @@ -(.require - [library - [lux (.except or let with_template |> `)]]) - -(def partial_list - (`` ("lux in-module" (,, (static .prelude)) .partial_list))) - -(def locally - (macro (_ tokens lux) - (.let [[prelude _] (symbol ._)] - (case tokens - (pattern (list [@ {.#Symbol ["" name]}])) - {.#Right [lux (list (.` ("lux in-module" (, [@ {.#Text prelude}]) - (, [@ {.#Symbol [prelude name]}]))))]} - - _ - {.#Left ""})))) - -(.with_template [] - [(def (..locally ))] - - [list#size] - [list#composite] - [list#each] - [list#conjoint] - [every?] - - [maybe#monad] - - [function#composite] - - [failure] - [meta#in] - - [do] - [monad#each] - - [Replacement_Environment] - [realized_template] - [replacement_environment] - - [symbol_short] - [tuple_list] - - [meta#monad] - [text$] - [generated_symbol] - [type_definition] - [record_slots] - [text#composite] - [type#encoded] - [module_alias] - [symbol$] - [tuple$] - [monad#mix] - [zipped_2] - - [multi_level_case^] - [multi_level_case$] - [type_code] - [expected_type] - - [wrong_syntax_error] - [local$] - - [list#reversed] - [untemplated_list] - [bit$] - [nat$] - [int$] - [rev$] - [frac$] - ) - -(def .public or - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {.#Form patterns}] body branches)) - (case patterns - {.#End} - (failure (..wrong_syntax_error (symbol ..or))) - - _ - (.let [pairs (.|> patterns - (list#each (function (_ pattern) (list pattern body))) - list#conjoint)] - (meta#in (list#composite pairs branches)))) - _ - (failure (..wrong_syntax_error (symbol ..or)))))) - -(def .public with_template - (macro (_ tokens) - (case tokens - (pattern (partial_list [_ {.#Form (list [_ {.#Tuple bindings}] - [_ {.#Tuple templates}])}] - [_ {.#Form data}] - branches)) - (case (is (Maybe (List Code)) - (do maybe#monad - [bindings' (monad#each maybe#monad symbol_short bindings) - data' (monad#each maybe#monad tuple_list data)] - (.let [num_bindings (list#size bindings')] - (if (every? (|>> ("lux i64 =" num_bindings)) - (list#each list#size data')) - (.let [apply (is (-> Replacement_Environment (List Code)) - (function (_ env) (list#each (realized_template env) templates)))] - (.|> data' - (list#each (function#composite apply (replacement_environment bindings'))) - list#conjoint - in)) - {.#None})))) - {.#Some output} - (meta#in (list#composite output branches)) - - {.#None} - (failure (..wrong_syntax_error (symbol ..with_template)))) - - _ - (failure (..wrong_syntax_error (symbol ..with_template)))))) - -(def .public multi - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form levels}] body next_branches)) - (do meta#monad - [mlc (multi_level_case^ levels) - .let [initial_bind? (case mlc - [[_ {.#Symbol _}] _] - #1 - - _ - #0)] - expected ..expected_type - g!temp (..generated_symbol "temp")] - (in (list g!temp - (.` ({{.#Some (, g!temp)} - (, g!temp) - - {.#None} - (.case (, g!temp) - (,* next_branches))} - ("lux type check" {.#Apply (, (type_code expected)) Maybe} - (.case (, g!temp) - (,* (multi_level_case$ g!temp [mlc body])) - - (,* (if initial_bind? - (list) - (list g!temp (.` {.#None}))))))))))) - - _ - (failure (..wrong_syntax_error (symbol ..multi)))))) - -(def .public let - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches)) - (.let [g!whole (local$ name)] - (meta#in (partial_list g!whole - (.` (case (, g!whole) (, pattern) (, body))) - branches))) - - _ - (failure (..wrong_syntax_error (symbol ..let)))))) - -(def .public |> - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches)) - (.let [g!name (local$ name)] - (meta#in (partial_list g!name - (.` (.let [(, g!name) (.|> (, g!name) (,* steps))] - (, body))) - branches))) - - _ - (failure (..wrong_syntax_error (symbol ..|>)))))) - -(def (name$ [module name]) - (-> Symbol Code) - (.` [(, (text$ module)) (, (text$ name))])) - -(def (untemplated_partial_list last inits) - (-> Code (List Code) Code) - (case inits - {.#End} - last - - {.#Item [init inits']} - (.` {.#Item (, init) (, (untemplated_partial_list last inits'))}))) - -(.with_template [ ] - [(def ( g!meta untemplated_pattern elems) - (-> Code (-> Code (Meta Code)) - (-> (List Code) (Meta Code))) - (case (list#reversed elems) - {.#Item [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}] - inits} - (do meta#monad - [=inits (monad#each meta#monad untemplated_pattern (list#reversed inits))] - (in (.` [(, g!meta) { (, (untemplated_partial_list spliced =inits))}]))) - - _ - (do meta#monad - [=elems (monad#each meta#monad untemplated_pattern elems)] - (in (.` [(, g!meta) { (, (untemplated_list =elems))}])))))] - - [.#Form untemplated_form] - [.#Variant untemplated_variant] - [.#Tuple untemplated_tuple] - ) - -(def (untemplated_pattern pattern) - (-> Code (Meta Code)) - (do meta#monad - [g!meta (..generated_symbol "g!meta")] - (case pattern - (..with_template [ ] - [[_ { value}] - (in (.` [(, g!meta) { (, ( value))}]))]) - ([.#Bit bit$] - [.#Nat nat$] - [.#Int int$] - [.#Rev rev$] - [.#Frac frac$] - [.#Text text$] - [.#Symbol name$]) - - [_ {.#Form {.#Item [[_ {.#Symbol ["" ","]}] {.#Item [unquoted {.#End}]}]}}] - (in unquoted) - - [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}] - (failure "Cannot use (,*) inside of `code` unless it is the last element in a form or a tuple.") - - (..with_template [ ] - [[_ { elems}] - ( g!meta untemplated_pattern elems)]) - ([.#Form ..untemplated_form] - [.#Variant ..untemplated_variant] - [.#Tuple ..untemplated_tuple]) - ))) - -(def .public ` - (macro (_ tokens) - (case tokens - (pattern (partial_list [_meta {.#Form (list template)}] body branches)) - (do meta#monad - [pattern (untemplated_pattern template)] - (in (partial_list pattern body branches))) - - (pattern (list template)) - (do meta#monad - [pattern (untemplated_pattern template)] - (in (list pattern))) - - _ - (failure (..wrong_syntax_error (symbol ..`)))))) diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux deleted file mode 100644 index 5321db403..000000000 --- a/stdlib/source/library/lux/macro/syntax.lux +++ /dev/null @@ -1,99 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - ["[0]" monad (.only do)]] - [control - ["<>" parser] - ["[0]" try]] - [data - ["[0]" text (.use "[1]#[0]" monoid)] - [collection - ["[0]" list]]] - ["[0]" meta (.only) - ["[0]" code (.only) - ["" \\parser (.only Parser)]]]]] - ["[0]" // (.only with_symbols)]) - -(def (self_documenting binding parser) - (All (_ a) (-> Code (Parser a) (Parser a))) - (function (_ tokens) - (case (parser tokens) - {try.#Failure error} - {try.#Failure (all text#composite - "Failed to parse: " (code.format binding) text.new_line - error)} - - success - success))) - -(def (un_paired pairs) - (All (_ a) (-> (List [a a]) (List a))) - (case pairs - {.#Item [x y] pairs'} - (list.partial x y (un_paired pairs')) - - {.#End} - {.#End})) - -(def syntaxP - (Parser [[Text (Maybe Text) (List Code)] Code]) - (all <>.and - (.form (all <>.and - .local - (<>.maybe .local) - (.tuple (<>.some .any)))) - .any)) - -(def .public syntax - (macro (_ tokens) - (case (.result ..syntaxP tokens) - {try.#Success [[name g!state args] body]} - (with_symbols [g!tokens g!body g!error] - (do [! meta.monad] - [vars+parsers (case (list.pairs args) - {.#Some args} - (monad.each ! - (is (-> [Code Code] (Meta [Code Code])) - (function (_ [var parser]) - (with_expansions [ (in [var - (` ((,! ..self_documenting) (' (, var)) - (, parser)))])] - (case var - [_ {.#Symbol ["" _]}] - - - [_ {.#Symbol _}] - (in [var parser]) - - _ - )))) - args) - - _ - (meta.failure "Syntax pattern expects pairs of bindings and code-parsers.")) - g!state (case g!state - {.#Some g!state} - (in (code.local g!state)) - - {.#None} - (//.symbol "g!state")) - this_module meta.current_module_name - .let [g!name (code.symbol ["" name])]] - (in (list (` (.macro ((, g!name) (, g!tokens) (, g!state)) - (.case ((,! .result) - (is ((,! .Parser) (Meta (List Code))) - ((,! do) (,! <>.monad) - [(,* (..un_paired vars+parsers))] - (.at (,! <>.monad) (,' in) - (is (Meta (List Code)) - (, body))))) - (, g!tokens)) - {try.#Success (, g!body)} - ((, g!body) (, g!state)) - - {try.#Failure (, g!error)} - {try.#Failure ((,! text.interposed) (,! text.new_line) (list "Invalid syntax:" (, g!error)))}))))))) - - {try.#Failure error} - (meta.failure (//.wrong_syntax_error (symbol ..syntax)))))) diff --git a/stdlib/source/library/lux/macro/syntax/check.lux b/stdlib/source/library/lux/macro/syntax/check.lux deleted file mode 100644 index 21a8aff54..000000000 --- a/stdlib/source/library/lux/macro/syntax/check.lux +++ /dev/null @@ -1,41 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)] - [monad (.only do)]] - [control - ["<>" parser]] - [data - ["[0]" product]] - [meta - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) - -(def extension - "lux check") - -(type .public Check - (Record - [#type Code - #value Code])) - -(def .public equivalence - (Equivalence Check) - (all product.equivalence - code.equivalence - code.equivalence - )) - -(def .public (format (open "_[0]")) - (-> Check Code) - (` ((, (code.text ..extension)) - (, _#type) - (, _#value)))) - -(def .public parser - (Parser Check) - (<| .form - (<>.after (.this_text ..extension)) - (<>.and .any - .any))) diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux deleted file mode 100644 index 1f4a9cccd..000000000 --- a/stdlib/source/library/lux/macro/syntax/declaration.lux +++ /dev/null @@ -1,44 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)]] - [control - ["<>" parser (.use "[1]#[0]" monad)]] - [data - ["[0]" product] - ["[0]" text] - [collection - ["[0]" list (.use "[1]#[0]" functor)]]] - [meta - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) - -(type .public Declaration - (Record - [#name Text - #arguments (List Text)])) - -(def .public equivalence - (Equivalence Declaration) - (all product.equivalence - text.equivalence - (list.equivalence text.equivalence) - )) - -(def .public parser - (Parser Declaration) - (<>.either (<>.and .local - (<>#in (list))) - (.form (<>.and .local - (<>.some .local))))) - -(def .public (format value) - (-> Declaration Code) - (let [g!name (code.local (the #name value))] - (case (the #arguments value) - {.#End} - g!name - - arguments - (` ((, g!name) (,* (list#each code.local arguments))))))) diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux deleted file mode 100644 index b9627f0a2..000000000 --- a/stdlib/source/library/lux/macro/syntax/definition.lux +++ /dev/null @@ -1,97 +0,0 @@ -(.require - [library - [lux (.except Definition) - ["[0]" macro] - [abstract - [equivalence (.only Equivalence)] - [monad (.only do)]] - [control - ["<>" parser] - ["[0]" exception (.only exception)]] - [data - ["[0]" sum] - ["[0]" product] - ["[0]" bit] - ["[0]" text (.only) - ["%" \\format]] - [collection - ["[0]" list]]] - ["[0]" meta (.only) - ["[0]" location] - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] - ["[0]" // (.only) - ["[1][0]" check (.only Check)]]) - -(type .public Definition - (Record - [#name Text - #value (Either Check - Code) - #export? Bit])) - -(def .public equivalence - (Equivalence Definition) - (all product.equivalence - text.equivalence - (all sum.equivalence - //check.equivalence - code.equivalence - ) - bit.equivalence - )) - -(def extension - "lux def") - -(def dummy - Code - (` [.#module (, (code.text (the .#module location.dummy))) - .#line (, (code.nat (the .#line location.dummy))) - .#column (, (code.nat (the .#column location.dummy)))])) - -(def .public (format (open "_[0]")) - (-> Definition Code) - (` ((, (code.text ..extension)) - (, (code.local _#name)) - (, (case _#value - {.#Left check} - (//check.format check) - - {.#Right value} - value)) - (, (code.bit _#export?))))) - -(def .public (parser compiler) - (-> Lux (Parser Definition)) - (do [! <>.monad] - [raw .any - me_raw (|> raw - macro.full_expansion - (meta.result compiler) - <>.lifted)] - (<| (.locally me_raw) - .form - (<>.after (.this_text ..extension)) - (all <>.and - .local - (<>.or //check.parser - .any) - .bit - )))) - -(exception .public (lacks_type [definition Definition]) - (exception.report - "Definition" (%.code (..format definition)))) - -(def .public (typed compiler) - (-> Lux (Parser Definition)) - (do <>.monad - [definition (..parser compiler) - _ (case (the #value definition) - {.#Left _} - (in []) - - {.#Right _} - (<>.lifted (exception.except ..lacks_type [definition])))] - (in definition))) diff --git a/stdlib/source/library/lux/macro/syntax/export.lux b/stdlib/source/library/lux/macro/syntax/export.lux deleted file mode 100644 index 81400ed1f..000000000 --- a/stdlib/source/library/lux/macro/syntax/export.lux +++ /dev/null @@ -1,37 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [monad (.only do)]] - [control - ["<>" parser]] - [macro - ["^" pattern]] - [meta - ["[0]" code - ["<[1]>" \\parser (.only Parser)]]]]]) - -(def .public default_policy - Code - (` .private)) - -(def policy - (Parser Code) - (do [! <>.monad] - [candidate .next] - (case candidate - [_ {.#Symbol ["" _]}] - (in default_policy) - - (^.or [_ {.#Bit _}] - [_ {.#Symbol _}]) - (do ! - [_ .any] - (in candidate)) - - _ - (in default_policy)))) - -(def .public parser - (All (_ a) (-> (Parser a) (Parser [Code a]))) - (<>.and ..policy)) diff --git a/stdlib/source/library/lux/macro/syntax/input.lux b/stdlib/source/library/lux/macro/syntax/input.lux deleted file mode 100644 index 4461c7df9..000000000 --- a/stdlib/source/library/lux/macro/syntax/input.lux +++ /dev/null @@ -1,43 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)]] - [control - ["<>" parser]] - [data - ["[0]" product] - [collection - ["[0]" list (.use "[1]#[0]" monad)]]] - [meta - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) - -(type .public Input - (Record - [#binding Code - #type Code])) - -(def .public equivalence - (Equivalence Input) - (all product.equivalence - code.equivalence - code.equivalence - )) - -(def .public format - (-> (List Input) Code) - (|>> (list#each (function (_ value) - (list (the #binding value) - (the #type value)))) - list#conjoint - code.tuple)) - -(def .public parser - (Parser (List Input)) - (<| .tuple - <>.some - (all <>.and - .any - .any - ))) diff --git a/stdlib/source/library/lux/macro/syntax/type/variable.lux b/stdlib/source/library/lux/macro/syntax/type/variable.lux deleted file mode 100644 index 363f85fc0..000000000 --- a/stdlib/source/library/lux/macro/syntax/type/variable.lux +++ /dev/null @@ -1,25 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [equivalence (.only Equivalence)]] - [data - ["[0]" text]] - [meta - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) - -(type .public Variable - Text) - -(def .public equivalence - (Equivalence Variable) - text.equivalence) - -(def .public format - (-> Variable Code) - code.local) - -(def .public parser - (Parser Variable) - .local) diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux deleted file mode 100644 index 7b71d005e..000000000 --- a/stdlib/source/library/lux/macro/template.lux +++ /dev/null @@ -1,185 +0,0 @@ -(.require - [library - [lux (.except let local symbol macro) - [abstract - ["[0]" monad (.only do)]] - [control - ["<>" parser (.use "[1]#[0]" functor)] - ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] - [data - ["[0]" bit (.use "[1]#[0]" codec)] - ["[0]" text] - [collection - ["[0]" list (.use "[1]#[0]" monad)] - ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]] - [math - [number - ["[0]" nat (.use "[1]#[0]" decimal)] - ["[0]" int (.use "[1]#[0]" decimal)] - ["[0]" rev (.use "[1]#[0]" decimal)] - ["[0]" frac (.use "[1]#[0]" decimal)]]] - ["[0]" meta (.only) - ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] - ["[0]" // (.only) - [syntax (.only syntax)] - ["[0]" local]]) - -(def .public spliced - (syntax (_ [parts (.tuple (<>.some .any))]) - (in parts))) - -(def .public amount - (syntax (_ [parts (.tuple (<>.some .any))]) - (in (list (code.nat (list.size parts)))))) - -(def .public with_locals - (syntax (_ [locals (.tuple (<>.some .local)) - body .any]) - (do [! meta.monad] - [g!locals (|> locals - (list#each //.symbol) - (monad.all !))] - (in (list (` (.with_expansions [(,* (|> (list.zipped_2 locals g!locals) - (list#each (function (_ [name symbol]) - (list (code.local name) symbol))) - list#conjoint))] - (, body)))))))) - -(def (symbol_side module_side? parser) - (-> Bit (Parser Symbol) (Parser Text)) - (do <>.monad - [[module short] parser] - (in (if module_side? - (case module - "" short - _ module) - short)))) - -(def (snippet module_side?) - (-> Bit (Parser Text)) - (.let [full_symbol (..symbol_side module_side? .symbol)] - (all <>.either - .text - (if module_side? - full_symbol - (<>.either .local - full_symbol)) - (<>#each bit#encoded .bit) - (<>#each nat#encoded .nat) - (<>#each int#encoded .int) - (<>#each rev#encoded .rev) - (<>#each frac#encoded .frac) - ))) - -(def (part module_side?) - (-> Bit (Parser (List Text))) - (.tuple (<>.many (..snippet module_side?)))) - -(def .public text - (syntax (_ [simple (..part false)]) - (in (list (|> simple (text.interposed "") code.text))))) - -(with_template [ ] - [(def .public - (syntax (_ [name (<>.or (<>.and (..part true) (..part false)) - (..part false))]) - (case name - {.#Left [simple complex]} - (in (list ( [(text.interposed "" simple) - (text.interposed "" complex)]))) - - {.#Right simple} - (in (list (|> simple (text.interposed "") ))))))] - - [symbol code.local code.symbol] - ) - -(type Environment - (Dictionary Text Code)) - -(def (applied env template) - (-> Environment Code Code) - (case template - [_ {.#Symbol "" name}] - (case (dictionary.value name env) - {.#Some substitute} - substitute - - {.#None} - template) - - (^.with_template [] - [[meta { elems}] - [meta { (list#each (applied env) elems)}]]) - ([.#Form] - [.#Variant] - [.#Tuple]) - - _ - template)) - -(type Local - (Record - [#name Text - #parameters (List Text) - #template (List Code)])) - -(exception .public (irregular_arguments [expected Nat - actual Nat]) - (exception.report - "Expected" (at nat.decimal encoded expected) - "Actual" (at nat.decimal encoded actual))) - -(def (macro (open "_[0]")) - (-> Local Macro) - ("lux macro" - (function (_ inputs compiler) - (.let [parameters_amount (list.size _#parameters) - inputs_amount (list.size inputs)] - (if (nat.= parameters_amount inputs_amount) - (.let [environment (is Environment - (|> (list.zipped_2 _#parameters inputs) - (dictionary.of_list text.hash)))] - {.#Right [compiler (list#each (..applied environment) _#template)]}) - (exception.except ..irregular_arguments [parameters_amount inputs_amount])))))) - -(def local - (Parser Local) - (do <>.monad - [[name parameters] (.form (<>.and .local - (<>.many .local))) - template (.tuple (<>.some .any))] - (in [#name name - #parameters parameters - #template template]))) - -... TODO: Get rid of this (and any local definitions it depends on) once the bootstrapping compiler is gone. -(def .public let - (syntax (_ [locals (.tuple (<>.some ..local)) - body .any]) - (do meta.monad - [here_name meta.current_module_name - expression? (is (Meta Bit) - (function (_ lux) - {try.#Success [lux (case (the .#expected lux) - {.#None} - false - - {.#Some _} - true)]})) - g!pop (local.push (list#each (function (_ local) - [[here_name (the #name local)] - (..macro local)]) - locals))] - (if expression? - (//.with_symbols [g!body] - (in (list (` (.let [(, g!body) (, body)] - (exec - (, g!pop) - (, g!body))))))) - (in (list body - g!pop)))))) diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index 49a572887..2bda65168 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -15,14 +15,14 @@ ["%" \\format]] [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [meta - [type - ["[0]" check]] ["[0]" code - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + ["[0]" check]]] [tool [compiler ["[0]" phase (.use "[1]#[0]" monad)] diff --git a/stdlib/source/library/lux/math/infix.lux b/stdlib/source/library/lux/math/infix.lux index 5c4603e99..6716f43b2 100644 --- a/stdlib/source/library/lux/math/infix.lux +++ b/stdlib/source/library/lux/math/infix.lux @@ -9,15 +9,15 @@ ["[0]" product] [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - [syntax (.only syntax)]] [math [number ["n" nat] ["i" int]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)]]]]]) (type Infix (Rec Infix diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux index b6f9afdc7..16f184bc5 100644 --- a/stdlib/source/library/lux/math/modular.lux +++ b/stdlib/source/library/lux/math/modular.lux @@ -19,10 +19,10 @@ [number ["i" int (.use "[1]#[0]" decimal)]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [type + [primitive (.except)]]]]] ["[0]" // ["[1]" modulus (.only Modulus)]]) diff --git a/stdlib/source/library/lux/math/modulus.lux b/stdlib/source/library/lux/math/modulus.lux index 57e313bcf..fea4f576f 100644 --- a/stdlib/source/library/lux/math/modulus.lux +++ b/stdlib/source/library/lux/math/modulus.lux @@ -6,16 +6,16 @@ [control ["[0]" try (.only Try)] ["[0]" exception (.only exception)]] - [macro - [syntax (.only syntax)]] [math [number ["i" int]]] ["[0]" meta (.only) - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]] + [type + [primitive (.except)]]]]]) (exception .public zero_cannot_be_a_modulus) diff --git a/stdlib/source/library/lux/math/number.lux b/stdlib/source/library/lux/math/number.lux index 3cb0e401d..ef699d5d5 100644 --- a/stdlib/source/library/lux/math/number.lux +++ b/stdlib/source/library/lux/math/number.lux @@ -7,8 +7,9 @@ ["[0]" try (.only Try)]] [data ["[0]" text]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" / ["[1][0]" nat] ["[1][0]" int] diff --git a/stdlib/source/library/lux/math/number/complex.lux b/stdlib/source/library/lux/math/number/complex.lux index 65e28513d..8392c9a57 100644 --- a/stdlib/source/library/lux/math/number/complex.lux +++ b/stdlib/source/library/lux/math/number/complex.lux @@ -9,15 +9,15 @@ [data [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - [syntax (.only syntax)]] [math [number ["f" frac] ["[0]" int]]] [meta ["[0]" code - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]]]]) (type .public Complex (Record diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux index a91d24bd8..f4048ebc8 100644 --- a/stdlib/source/library/lux/math/number/frac.lux +++ b/stdlib/source/library/lux/math/number/frac.lux @@ -16,8 +16,9 @@ [predicate (.only Predicate)]]] [data ["[0]" text]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // ["[1][0]" i64] ["[1][0]" nat] diff --git a/stdlib/source/library/lux/math/number/int.lux b/stdlib/source/library/lux/math/number/int.lux index 29fc9d13e..33c82109e 100644 --- a/stdlib/source/library/lux/math/number/int.lux +++ b/stdlib/source/library/lux/math/number/int.lux @@ -16,8 +16,9 @@ [predicate (.only Predicate)]]] [data [text (.only Char)]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // ["[1][0]" nat] ["[1][0]" i64]]) diff --git a/stdlib/source/library/lux/math/number/nat.lux b/stdlib/source/library/lux/math/number/nat.lux index 51d2c68b8..5f63ffb78 100644 --- a/stdlib/source/library/lux/math/number/nat.lux +++ b/stdlib/source/library/lux/math/number/nat.lux @@ -13,8 +13,9 @@ ["[0]" function] ["[0]" maybe] ["[0]" try (.only Try)]] - [macro - ["^" pattern]]]]) + [meta + [macro + ["^" pattern]]]]]) (with_template [ ] [(def .public ( parameter subject) diff --git a/stdlib/source/library/lux/math/number/ratio.lux b/stdlib/source/library/lux/math/number/ratio.lux index 5c11f118c..e521bddf9 100644 --- a/stdlib/source/library/lux/math/number/ratio.lux +++ b/stdlib/source/library/lux/math/number/ratio.lux @@ -15,11 +15,11 @@ [data ["[0]" product] ["[0]" text (.use "[1]#[0]" monoid)]] - [macro - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + [macro + [syntax (.only syntax)]]]]] [// ["n" nat (.use "[1]#[0]" decimal)]]) diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux index 7ebf577d7..ece9576f8 100644 --- a/stdlib/source/library/lux/math/random.lux +++ b/stdlib/source/library/lux/math/random.lux @@ -28,15 +28,15 @@ ["r" ratio] ["c" complex] ["[0]" i64]]] + [meta + [type + [refinement (.only Refiner Refined)]]] ["[0]" time (.only Time) ["[0]" instant (.only Instant)] ["[0]" date (.only Date)] ["[0]" duration (.only Duration)] ["[0]" month (.only Month)] - ["[0]" day (.only Day)]] - [meta - [type - [refinement (.only Refiner Refined)]]]]]) + ["[0]" day (.only Day)]]]]) (type .public PRNG (Rec PRNG diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux index 63375b626..611028e8e 100644 --- a/stdlib/source/library/lux/meta.lux +++ b/stdlib/source/library/lux/meta.lux @@ -14,17 +14,16 @@ [collection ["[0]" list (.use "[1]#[0]" monoid monad) ["[0]" property]]]] - [macro - ["^" pattern]] [math [number ["n" nat] - ["i" int]]] - [meta - ["[0]" symbol (.use "[1]#[0]" codec equivalence)] - ["[0]" code]]]] + ["i" int]]]]] [/ - ["[0]" location]]) + ["[0]" location] + ["[0]" symbol (.use "[1]#[0]" codec equivalence)] + ["[0]" code] + [macro + ["^" pattern]]]) ... (.type (Meta a) ... (-> Lux (Try [Lux a]))) diff --git a/stdlib/source/library/lux/meta/code.lux b/stdlib/source/library/lux/meta/code.lux index dc182b124..c65f613c5 100644 --- a/stdlib/source/library/lux/meta/code.lux +++ b/stdlib/source/library/lux/meta/code.lux @@ -9,8 +9,6 @@ ["[0]" text (.use "[1]#[0]" monoid equivalence)] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["^" pattern]] [math [number ["[0]" nat] @@ -19,7 +17,9 @@ ["[0]" frac]]] [meta ["[0]" location] - ["[0]" symbol]]]]) + ["[0]" symbol] + [macro + ["^" pattern]]]]]) ... (type (Code' w) ... {.#Bit Bit} diff --git a/stdlib/source/library/lux/meta/configuration.lux b/stdlib/source/library/lux/meta/configuration.lux index 3ed5e3e6c..45ca34758 100644 --- a/stdlib/source/library/lux/meta/configuration.lux +++ b/stdlib/source/library/lux/meta/configuration.lux @@ -16,13 +16,13 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix) ["/" property]]]] - [macro - [syntax (.only syntax)]] [math [number (.only hex)]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]]]]) (type .public Configuration (/.List Text)) diff --git a/stdlib/source/library/lux/meta/macro.lux b/stdlib/source/library/lux/meta/macro.lux new file mode 100644 index 000000000..86e9fe57d --- /dev/null +++ b/stdlib/source/library/lux/meta/macro.lux @@ -0,0 +1,213 @@ +(.require + [library + [lux (.except local symbol function macro) + [abstract + ["[0]" monad (.only do)]] + [data + ["[0]" text (.use "[1]#[0]" monoid)] + [collection + ["[0]" list (.use "[1]#[0]" monoid monad)]]] + [math + [number + ["[0]" nat] + ["[0]" int]]]]] + ["[0]" // (.only) + ["[0]" code] + ["[0]" location] + ["[0]" symbol (.use "[1]#[0]" codec)]]) + +(def .public (single_expansion syntax) + (-> Code (Meta (List Code))) + (case syntax + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] + (do //.monad + [?macro (//.macro name)] + (case ?macro + {.#Some macro} + ((as Macro' macro) args) + + {.#None} + (at //.monad in (list syntax)))) + + _ + (at //.monad in (list syntax)))) + +(def .public (expansion syntax) + (-> Code (Meta (List Code))) + (case syntax + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] + (do //.monad + [?macro (//.macro name)] + (case ?macro + {.#Some macro} + (do [! //.monad] + [top_level_expansion ((as Macro' macro) args)] + (|> top_level_expansion + (monad.each //.monad expansion) + (at ! each list#conjoint))) + + {.#None} + (at //.monad in (list syntax)))) + + _ + (at //.monad in (list syntax)))) + +(def .public (full_expansion syntax) + (-> Code (Meta (List Code))) + (case syntax + [_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}] + (do //.monad + [?macro (//.macro name)] + (case ?macro + {.#Some macro} + (do //.monad + [expansion ((as Macro' macro) args) + expansion' (monad.each //.monad full_expansion expansion)] + (in (list#conjoint expansion'))) + + {.#None} + (do //.monad + [parts' (monad.each //.monad full_expansion (list.partial (code.symbol name) args))] + (in (list (code.form (list#conjoint parts'))))))) + + [_ {.#Form {.#Item [harg targs]}}] + (do //.monad + [harg+ (full_expansion harg) + targs+ (monad.each //.monad full_expansion targs)] + (in (list (code.form (list#composite harg+ (list#conjoint (is (List (List Code)) targs+))))))) + + [_ {.#Variant members}] + (do //.monad + [members' (monad.each //.monad full_expansion members)] + (in (list (code.variant (list#conjoint members'))))) + + [_ {.#Tuple members}] + (do //.monad + [members' (monad.each //.monad full_expansion members)] + (in (list (code.tuple (list#conjoint members'))))) + + _ + (at //.monad in (list syntax)))) + +(def .public (symbol prefix) + (-> Text (Meta Code)) + (do //.monad + [id //.seed] + (in (|> id + (at nat.decimal encoded) + (all text#composite "__gensym__" prefix) + [""] code.symbol)))) + +(def (local ast) + (-> Code (Meta Text)) + (case ast + [_ {.#Symbol [_ name]}] + (at //.monad in name) + + _ + (//.failure (text#composite "Code is not a local symbol: " (code.format ast))))) + +(def .public wrong_syntax_error + (-> Symbol Text) + (|>> symbol#encoded + (text.prefix (text#composite "Wrong syntax for " text.\'')) + (text.suffix (text#composite text.\'' ".")))) + +(def .public with_symbols + (.macro (_ tokens) + (case tokens + (pattern (list [_ {.#Tuple symbols}] body)) + (do [! //.monad] + [symbol_names (monad.each ! ..local symbols) + .let [symbol_defs (list#conjoint (list#each (is (-> Text (List Code)) + (.function (_ name) (list (code.symbol ["" name]) (` (..symbol (, (code.text name))))))) + symbol_names))]] + (in (list (` ((,! do) (,! //.monad) + [(,* symbol_defs)] + (, body)))))) + + _ + (//.failure (..wrong_syntax_error (.symbol ..with_symbols)))))) + +(def .public (one_expansion token) + (-> Code (Meta Code)) + (do //.monad + [token+ (..expansion token)] + (case token+ + (pattern (list token')) + (in token') + + _ + (//.failure "Macro expanded to more than 1 element.")))) + +(with_template [ ] + [(def .public + (.macro (_ tokens) + (let [[module _] (.symbol .._) + [_ short] (.symbol ) + macro_name [module short]] + (case (is (Maybe [Bit Code]) + (case tokens + (pattern (list [_ {.#Text "omit"}] + token)) + {.#Some [#1 token]} + + (pattern (list token)) + {.#Some [#0 token]} + + _ + {.#None})) + {.#Some [omit? token]} + (do //.monad + [location //.location + output ( token) + .let [_ ("lux io log" (all text#composite (symbol#encoded macro_name) " " (location.format location))) + _ (list#each (|>> code.format "lux io log") + output) + _ ("lux io log" "")]] + (in (if omit? + (list) + output))) + + {.#None} + (//.failure (..wrong_syntax_error macro_name))))))] + + [log_single_expansion! ..single_expansion] + [log_expansion! ..expansion] + [log_full_expansion! ..full_expansion] + ) + +(def .public times + (.macro (_ tokens) + (case tokens + (pattern (list.partial [_ {.#Nat times}] terms)) + (loop (again [times times + before terms]) + (case times + 0 + (at //.monad in before) + + _ + (do [! //.monad] + [after (|> before + (monad.each ! ..single_expansion) + (at ! each list#conjoint))] + (again (-- times) after)))) + + _ + (//.failure (..wrong_syntax_error (.symbol ..times)))))) + +(def .public final + (.macro (_ it) + (let [! //.monad] + (|> it + (monad.each ! ..expansion) + (at ! each list#conjoint))))) + +(def .public function + (-> Macro Macro') + (|>> (as Macro'))) + +(def .public macro + (-> Macro' Macro) + (|>> (as Macro))) diff --git a/stdlib/source/library/lux/meta/macro/context.lux b/stdlib/source/library/lux/meta/macro/context.lux new file mode 100644 index 000000000..464d0cfea --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/context.lux @@ -0,0 +1,159 @@ +(.require + [library + [lux (.except def global) + [abstract + [monad (.only do)]] + [control + ["?" parser] + ["[0]" exception (.only exception)] + ["[0]" maybe] + [function + [predicate (.only Predicate)]]] + [data + ["[0]" text (.use "[1]#[0]" equivalence monoid)] + [collection + ["[0]" list (.only) + ["[0]" property]]]] + ["[0]" meta (.only) + ["[0]" symbol (.use "[1]#[0]" codec)] + ["[0]" code (.only) + ["?[1]" \\parser]]]]] + ["[0]" // (.only) + [syntax (.only syntax)] + ["^" pattern]]) + +(type .public Stack + List) + +(exception .public (no_definition [it Symbol]) + (exception.report + "Definition" (symbol#encoded it))) + +(.def (global it) + (-> Symbol (Meta Any)) + (do meta.monad + [.let [[@ expected_name] it] + defs (meta.definitions @)] + (case (list.one (function (_ [actual_name [exported? type value]]) + (if (text#= expected_name actual_name) + {.#Some value} + {.#None})) + defs) + {.#Some it} + (in it) + + {.#None} + (meta.failure (exception.error ..no_definition [it]))))) + +(exception .public no_active_context) + +(.def (peek' _ context) + (All (_ a) (-> (Stack a) Symbol (Meta a))) + (do meta.monad + [stack (..global context)] + (case (|> stack + (as (Stack Any)) + list.head) + {.#Some top} + (in (as_expected top)) + + {.#None} + (meta.failure (exception.error ..no_active_context []))))) + +(.def .public peek + (syntax (_ [g!it (at ?.monad each code.symbol ?code.global)]) + (in (list (` ((,! ..peek') (, g!it) (.symbol (, g!it)))))))) + +(exception .public no_example) + +(.def (search' _ ? context) + (All (_ a) (-> (Stack a) (Predicate a) Symbol (Meta a))) + (do meta.monad + [stack (..global context)] + (case (|> stack + (as (Stack Any)) + (list.example (as (Predicate Any) ?))) + {.#Some it} + (in (as_expected it)) + + {.#None} + (meta.failure (exception.error ..no_example []))))) + +(.def .public search + (syntax (_ [g!context (at ?.monad each code.symbol ?code.global) + g!? ?code.any]) + (in (list (` ((,! ..search') (, g!context) (, g!?) (.symbol (, g!context)))))))) + +(.def (alter on_definition [@ context]) + (-> (-> Definition Definition) Symbol (Meta Any)) + (function (_ lux) + (let [on_global (is (-> Global Global) + (function (_ it) + (case it + {.#Definition it} + {.#Definition (on_definition it)} + + _ + it))) + on_globals (is (-> (property.List Global) (property.List Global)) + (property.revised context on_global)) + on_module (is (-> Module Module) + (revised .#definitions on_globals))] + {.#Right [(revised .#modules (property.revised @ on_module) lux) + []]}))) + +(.def (push' _ top) + (All (_ a) (-> (Stack a) a Symbol (Meta Any))) + (alter (function (_ [exported? type stack]) + (|> stack + (as (Stack Any)) + {.#Item top} + (is (Stack Any)) + [exported? type])))) + +(.def .public push + (syntax (_ [g!context (at ?.monad each code.symbol ?code.global) + g!it ?code.any]) + (in (list (` ((,! ..push') (, g!context) (, g!it) (.symbol (, g!context)))))))) + +(.def pop' + (-> Symbol (Meta Any)) + (alter (function (_ [exported? type value]) + [exported? type (let [value (as (Stack Any) value)] + (maybe.else value (list.tail value)))]))) + +(.def .public pop + (syntax (_ [expression? ?code.bit + context ?code.global]) + (do meta.monad + [_ (..pop' context)] + (in (if expression? + (list (' [])) + (list)))))) + +(.def .public def + (syntax (_ [.let [! ?.monad + ?local (at ! each code.local ?code.local)] + [$ g!expression g!declaration] (?code.tuple (all ?.and ?code.local ?local ?local)) + context_type ?code.any]) + (do [! meta.monad] + [@ meta.current_module_name + .let [g!context (code.symbol [@ $])]] + (//.with_symbols [g!it g!body g!_] + (in (list (` (.def (, (code.local $)) + (..Stack (, context_type)) + (list))) + (` (.def ((, g!expression) (, g!it) (, g!body)) + (-> (, context_type) Code (Meta Code)) + ((,! do) (,! meta.monad) + [(, g!_) ((,! ..push) (, g!context) (, g!it))] + ((,' in) (` (let [((,' ,') (, g!body)) ((,' ,) (, g!body)) + ((,' ,') (, g!_)) ((,! ..pop) #1 (, g!context))] + ((,' ,') (, g!body)))))))) + (` (.def ((, g!declaration) (, g!it) (, g!body)) + (-> (, context_type) Code (Meta (List Code))) + ((,! do) (,! meta.monad) + [(, g!_) ((,! ..push) (, g!context) (, g!it))] + ((,' in) (list (, g!body) + (` ((,! ..pop) #0 (, g!context)))))))) + )))))) diff --git a/stdlib/source/library/lux/meta/macro/local.lux b/stdlib/source/library/lux/meta/macro/local.lux new file mode 100644 index 000000000..9b2ec3156 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/local.lux @@ -0,0 +1,144 @@ +(.require + [library + [lux (.except with let) + [abstract + ["[0]" monad (.only do)]] + [control + ["<>" parser] + ["[0]" try (.only Try)] + ["[0]" exception (.only exception)]] + [data + ["[0]" product] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" functor) + ["[0]" property]]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] + ["[0]" // (.only) + [syntax (.only syntax)]]) + +(exception .public (unknown_module [module Text]) + (exception.report + "Module" (text.format module))) + +(with_template [] + [(exception .public ( [module Text + definition Text]) + (exception.report + "Module" (text.format module) + "Definition" (text.format definition)))] + + [cannot_shadow_definition] + [unknown_definition] + ) + +(def (with_module name body) + (All (_ a) (-> Text (-> Module (Try [Module a])) (Meta a))) + (function (_ compiler) + (case (|> compiler (the .#modules) (property.value name)) + {.#Some module} + (case (body module) + {try.#Success [module' output]} + {try.#Success [(revised .#modules (property.has name module') compiler) + output]} + + {try.#Failure error} + {try.#Failure error}) + + {.#None} + (exception.except ..unknown_module [name])))) + +(def (push_one [name macro]) + (-> [Symbol Macro] (Meta Any)) + (do meta.monad + [[module_name definition_name] (meta.normal name) + .let [definition (is Global {.#Definition [false .Macro macro]}) + add_macro! (is (-> (property.List Global) (property.List Global)) + (property.has definition_name definition))]] + (..with_module module_name + (function (_ module) + (case (|> module (the .#definitions) (property.value definition_name)) + {.#None} + {try.#Success [(revised .#definitions add_macro! module) + []]} + + {.#Some _} + (exception.except ..cannot_shadow_definition [module_name definition_name])))))) + +(def (pop_one name) + (-> Symbol (Meta Any)) + (do meta.monad + [[module_name definition_name] (meta.normal name) + .let [lacks_macro! (is (-> (property.List Global) (property.List Global)) + (property.lacks definition_name))]] + (..with_module module_name + (function (_ module) + (case (|> module (the .#definitions) (property.value definition_name)) + {.#Some _} + {try.#Success [(revised .#definitions lacks_macro! module) + []]} + + {.#None} + (exception.except ..unknown_definition [module_name definition_name])))))) + +(def (pop_all macros self) + (-> (List Symbol) Symbol Macro) + ("lux macro" + (function (_ _) + (do [! meta.monad] + [_ (monad.each ! ..pop_one macros) + _ (..pop_one self) + compiler meta.compiler_state] + (in (case (the .#expected compiler) + {.#Some _} + (list (' [])) + + {.#None} + (list))))))) + +(def .public (push macros) + (-> (List [Symbol Macro]) (Meta Code)) + (do meta.monad + [_ (monad.each meta.monad ..push_one macros) + seed meta.seed + g!pop (//.symbol "pop") + _ (.let [g!pop (is Symbol + ["" (code.format g!pop)])] + (..push_one [g!pop (..pop_all (list#each product.left macros) g!pop)]))] + (in (` ((, g!pop)))))) + +(def .public (with macros expression? body) + (-> (List [Symbol Macro]) Bit Code (Meta (List Code))) + (do [! meta.monad] + [g!pop (..push macros)] + (.if expression? + (//.with_symbols [g!body] + (in (list (` (.let [(, g!body) (, body)] + (exec + (, g!pop) + (, g!body))))))) + (in (list body + g!pop))))) + +(def .public let + (syntax (_ [locals (.tuple (<>.some (<>.and .local .any))) + body .any]) + (do [! meta.monad] + [here_name meta.current_module_name + locals (monad.each ! (function (_ [name value]) + (|> value + (meta.eval .Macro) + (at ! each (|>> (as .Macro) + [[here_name name]])))) + locals) + expression? (is (Meta Bit) + (function (_ lux) + {try.#Success [lux (case (the .#expected lux) + {.#None} + false + + {.#Some _} + true)]}))] + (..with locals expression? body)))) diff --git a/stdlib/source/library/lux/meta/macro/pattern.lux b/stdlib/source/library/lux/meta/macro/pattern.lux new file mode 100644 index 000000000..affa8273a --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/pattern.lux @@ -0,0 +1,256 @@ +(.require + [library + [lux (.except or let with_template |> `)]]) + +(def partial_list + (`` ("lux in-module" (,, (static .prelude)) .partial_list))) + +(def locally + (macro (_ tokens lux) + (.let [[prelude _] (symbol ._)] + (case tokens + (pattern (list [@ {.#Symbol ["" name]}])) + {.#Right [lux (list (.` ("lux in-module" (, [@ {.#Text prelude}]) + (, [@ {.#Symbol [prelude name]}]))))]} + + _ + {.#Left ""})))) + +(.with_template [] + [(def (..locally ))] + + [list#size] + [list#composite] + [list#each] + [list#conjoint] + [every?] + + [maybe#monad] + + [function#composite] + + [failure] + [meta#in] + + [do] + [monad#each] + + [Replacement_Environment] + [realized_template] + [replacement_environment] + + [symbol_short] + [tuple_list] + + [meta#monad] + [text$] + [generated_symbol] + [type_definition] + [record_slots] + [text#composite] + [type#encoded] + [module_alias] + [symbol$] + [tuple$] + [monad#mix] + [zipped_2] + + [multi_level_case^] + [multi_level_case$] + [type_code] + [expected_type] + + [wrong_syntax_error] + [local$] + + [list#reversed] + [untemplated_list] + [bit$] + [nat$] + [int$] + [rev$] + [frac$] + ) + +(def .public or + (macro (_ tokens) + (case tokens + (pattern (partial_list [_ {.#Form patterns}] body branches)) + (case patterns + {.#End} + (failure (..wrong_syntax_error (symbol ..or))) + + _ + (.let [pairs (.|> patterns + (list#each (function (_ pattern) (list pattern body))) + list#conjoint)] + (meta#in (list#composite pairs branches)))) + _ + (failure (..wrong_syntax_error (symbol ..or)))))) + +(def .public with_template + (macro (_ tokens) + (case tokens + (pattern (partial_list [_ {.#Form (list [_ {.#Tuple bindings}] + [_ {.#Tuple templates}])}] + [_ {.#Form data}] + branches)) + (case (is (Maybe (List Code)) + (do maybe#monad + [bindings' (monad#each maybe#monad symbol_short bindings) + data' (monad#each maybe#monad tuple_list data)] + (.let [num_bindings (list#size bindings')] + (if (every? (|>> ("lux i64 =" num_bindings)) + (list#each list#size data')) + (.let [apply (is (-> Replacement_Environment (List Code)) + (function (_ env) (list#each (realized_template env) templates)))] + (.|> data' + (list#each (function#composite apply (replacement_environment bindings'))) + list#conjoint + in)) + {.#None})))) + {.#Some output} + (meta#in (list#composite output branches)) + + {.#None} + (failure (..wrong_syntax_error (symbol ..with_template)))) + + _ + (failure (..wrong_syntax_error (symbol ..with_template)))))) + +(def .public multi + (macro (_ tokens) + (case tokens + (pattern (partial_list [_meta {.#Form levels}] body next_branches)) + (do meta#monad + [mlc (multi_level_case^ levels) + .let [initial_bind? (case mlc + [[_ {.#Symbol _}] _] + #1 + + _ + #0)] + expected ..expected_type + g!temp (..generated_symbol "temp")] + (in (list g!temp + (.` ({{.#Some (, g!temp)} + (, g!temp) + + {.#None} + (.case (, g!temp) + (,* next_branches))} + ("lux type check" {.#Apply (, (type_code expected)) Maybe} + (.case (, g!temp) + (,* (multi_level_case$ g!temp [mlc body])) + + (,* (if initial_bind? + (list) + (list g!temp (.` {.#None}))))))))))) + + _ + (failure (..wrong_syntax_error (symbol ..multi)))))) + +(def .public let + (macro (_ tokens) + (case tokens + (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches)) + (.let [g!whole (local$ name)] + (meta#in (partial_list g!whole + (.` (case (, g!whole) (, pattern) (, body))) + branches))) + + _ + (failure (..wrong_syntax_error (symbol ..let)))))) + +(def .public |> + (macro (_ tokens) + (case tokens + (pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches)) + (.let [g!name (local$ name)] + (meta#in (partial_list g!name + (.` (.let [(, g!name) (.|> (, g!name) (,* steps))] + (, body))) + branches))) + + _ + (failure (..wrong_syntax_error (symbol ..|>)))))) + +(def (name$ [module name]) + (-> Symbol Code) + (.` [(, (text$ module)) (, (text$ name))])) + +(def (untemplated_partial_list last inits) + (-> Code (List Code) Code) + (case inits + {.#End} + last + + {.#Item [init inits']} + (.` {.#Item (, init) (, (untemplated_partial_list last inits'))}))) + +(.with_template [ ] + [(def ( g!meta untemplated_pattern elems) + (-> Code (-> Code (Meta Code)) + (-> (List Code) (Meta Code))) + (case (list#reversed elems) + {.#Item [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}] + inits} + (do meta#monad + [=inits (monad#each meta#monad untemplated_pattern (list#reversed inits))] + (in (.` [(, g!meta) { (, (untemplated_partial_list spliced =inits))}]))) + + _ + (do meta#monad + [=elems (monad#each meta#monad untemplated_pattern elems)] + (in (.` [(, g!meta) { (, (untemplated_list =elems))}])))))] + + [.#Form untemplated_form] + [.#Variant untemplated_variant] + [.#Tuple untemplated_tuple] + ) + +(def (untemplated_pattern pattern) + (-> Code (Meta Code)) + (do meta#monad + [g!meta (..generated_symbol "g!meta")] + (case pattern + (..with_template [ ] + [[_ { value}] + (in (.` [(, g!meta) { (, ( value))}]))]) + ([.#Bit bit$] + [.#Nat nat$] + [.#Int int$] + [.#Rev rev$] + [.#Frac frac$] + [.#Text text$] + [.#Symbol name$]) + + [_ {.#Form {.#Item [[_ {.#Symbol ["" ","]}] {.#Item [unquoted {.#End}]}]}}] + (in unquoted) + + [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}] + (failure "Cannot use (,*) inside of `code` unless it is the last element in a form or a tuple.") + + (..with_template [ ] + [[_ { elems}] + ( g!meta untemplated_pattern elems)]) + ([.#Form ..untemplated_form] + [.#Variant ..untemplated_variant] + [.#Tuple ..untemplated_tuple]) + ))) + +(def .public ` + (macro (_ tokens) + (case tokens + (pattern (partial_list [_meta {.#Form (list template)}] body branches)) + (do meta#monad + [pattern (untemplated_pattern template)] + (in (partial_list pattern body branches))) + + (pattern (list template)) + (do meta#monad + [pattern (untemplated_pattern template)] + (in (list pattern))) + + _ + (failure (..wrong_syntax_error (symbol ..`)))))) diff --git a/stdlib/source/library/lux/meta/macro/syntax.lux b/stdlib/source/library/lux/meta/macro/syntax.lux new file mode 100644 index 000000000..5321db403 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax.lux @@ -0,0 +1,99 @@ +(.require + [library + [lux (.except) + [abstract + ["[0]" monad (.only do)]] + [control + ["<>" parser] + ["[0]" try]] + [data + ["[0]" text (.use "[1]#[0]" monoid)] + [collection + ["[0]" list]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["" \\parser (.only Parser)]]]]] + ["[0]" // (.only with_symbols)]) + +(def (self_documenting binding parser) + (All (_ a) (-> Code (Parser a) (Parser a))) + (function (_ tokens) + (case (parser tokens) + {try.#Failure error} + {try.#Failure (all text#composite + "Failed to parse: " (code.format binding) text.new_line + error)} + + success + success))) + +(def (un_paired pairs) + (All (_ a) (-> (List [a a]) (List a))) + (case pairs + {.#Item [x y] pairs'} + (list.partial x y (un_paired pairs')) + + {.#End} + {.#End})) + +(def syntaxP + (Parser [[Text (Maybe Text) (List Code)] Code]) + (all <>.and + (.form (all <>.and + .local + (<>.maybe .local) + (.tuple (<>.some .any)))) + .any)) + +(def .public syntax + (macro (_ tokens) + (case (.result ..syntaxP tokens) + {try.#Success [[name g!state args] body]} + (with_symbols [g!tokens g!body g!error] + (do [! meta.monad] + [vars+parsers (case (list.pairs args) + {.#Some args} + (monad.each ! + (is (-> [Code Code] (Meta [Code Code])) + (function (_ [var parser]) + (with_expansions [ (in [var + (` ((,! ..self_documenting) (' (, var)) + (, parser)))])] + (case var + [_ {.#Symbol ["" _]}] + + + [_ {.#Symbol _}] + (in [var parser]) + + _ + )))) + args) + + _ + (meta.failure "Syntax pattern expects pairs of bindings and code-parsers.")) + g!state (case g!state + {.#Some g!state} + (in (code.local g!state)) + + {.#None} + (//.symbol "g!state")) + this_module meta.current_module_name + .let [g!name (code.symbol ["" name])]] + (in (list (` (.macro ((, g!name) (, g!tokens) (, g!state)) + (.case ((,! .result) + (is ((,! .Parser) (Meta (List Code))) + ((,! do) (,! <>.monad) + [(,* (..un_paired vars+parsers))] + (.at (,! <>.monad) (,' in) + (is (Meta (List Code)) + (, body))))) + (, g!tokens)) + {try.#Success (, g!body)} + ((, g!body) (, g!state)) + + {try.#Failure (, g!error)} + {try.#Failure ((,! text.interposed) (,! text.new_line) (list "Invalid syntax:" (, g!error)))}))))))) + + {try.#Failure error} + (meta.failure (//.wrong_syntax_error (symbol ..syntax)))))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/check.lux b/stdlib/source/library/lux/meta/macro/syntax/check.lux new file mode 100644 index 000000000..21a8aff54 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/check.lux @@ -0,0 +1,41 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)] + [monad (.only do)]] + [control + ["<>" parser]] + [data + ["[0]" product]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]]) + +(def extension + "lux check") + +(type .public Check + (Record + [#type Code + #value Code])) + +(def .public equivalence + (Equivalence Check) + (all product.equivalence + code.equivalence + code.equivalence + )) + +(def .public (format (open "_[0]")) + (-> Check Code) + (` ((, (code.text ..extension)) + (, _#type) + (, _#value)))) + +(def .public parser + (Parser Check) + (<| .form + (<>.after (.this_text ..extension)) + (<>.and .any + .any))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/declaration.lux b/stdlib/source/library/lux/meta/macro/syntax/declaration.lux new file mode 100644 index 000000000..1f4a9cccd --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/declaration.lux @@ -0,0 +1,44 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)]] + [control + ["<>" parser (.use "[1]#[0]" monad)]] + [data + ["[0]" product] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" functor)]]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]]) + +(type .public Declaration + (Record + [#name Text + #arguments (List Text)])) + +(def .public equivalence + (Equivalence Declaration) + (all product.equivalence + text.equivalence + (list.equivalence text.equivalence) + )) + +(def .public parser + (Parser Declaration) + (<>.either (<>.and .local + (<>#in (list))) + (.form (<>.and .local + (<>.some .local))))) + +(def .public (format value) + (-> Declaration Code) + (let [g!name (code.local (the #name value))] + (case (the #arguments value) + {.#End} + g!name + + arguments + (` ((, g!name) (,* (list#each code.local arguments))))))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/definition.lux b/stdlib/source/library/lux/meta/macro/syntax/definition.lux new file mode 100644 index 000000000..750c94d60 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/definition.lux @@ -0,0 +1,97 @@ +(.require + [library + [lux (.except Definition) + [abstract + [equivalence (.only Equivalence)] + [monad (.only do)]] + [control + ["<>" parser] + ["[0]" exception (.only exception)]] + [data + ["[0]" sum] + ["[0]" product] + ["[0]" bit] + ["[0]" text (.only) + ["%" \\format]] + [collection + ["[0]" list]]] + ["[0]" meta (.only) + ["[0]" location] + ["[0]" macro] + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]] + ["[0]" // (.only) + ["[1][0]" check (.only Check)]]) + +(type .public Definition + (Record + [#name Text + #value (Either Check + Code) + #export? Bit])) + +(def .public equivalence + (Equivalence Definition) + (all product.equivalence + text.equivalence + (all sum.equivalence + //check.equivalence + code.equivalence + ) + bit.equivalence + )) + +(def extension + "lux def") + +(def dummy + Code + (` [.#module (, (code.text (the .#module location.dummy))) + .#line (, (code.nat (the .#line location.dummy))) + .#column (, (code.nat (the .#column location.dummy)))])) + +(def .public (format (open "_[0]")) + (-> Definition Code) + (` ((, (code.text ..extension)) + (, (code.local _#name)) + (, (case _#value + {.#Left check} + (//check.format check) + + {.#Right value} + value)) + (, (code.bit _#export?))))) + +(def .public (parser compiler) + (-> Lux (Parser Definition)) + (do [! <>.monad] + [raw .any + me_raw (|> raw + macro.full_expansion + (meta.result compiler) + <>.lifted)] + (<| (.locally me_raw) + .form + (<>.after (.this_text ..extension)) + (all <>.and + .local + (<>.or //check.parser + .any) + .bit + )))) + +(exception .public (lacks_type [definition Definition]) + (exception.report + "Definition" (%.code (..format definition)))) + +(def .public (typed compiler) + (-> Lux (Parser Definition)) + (do <>.monad + [definition (..parser compiler) + _ (case (the #value definition) + {.#Left _} + (in []) + + {.#Right _} + (<>.lifted (exception.except ..lacks_type [definition])))] + (in definition))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/export.lux b/stdlib/source/library/lux/meta/macro/syntax/export.lux new file mode 100644 index 000000000..d68b4a678 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/export.lux @@ -0,0 +1,37 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)]] + [control + ["<>" parser]] + [meta + ["[0]" code + ["<[1]>" \\parser (.only Parser)]] + [macro + ["^" pattern]]]]]) + +(def .public default_policy + Code + (` .private)) + +(def policy + (Parser Code) + (do [! <>.monad] + [candidate .next] + (case candidate + [_ {.#Symbol ["" _]}] + (in default_policy) + + (^.or [_ {.#Bit _}] + [_ {.#Symbol _}]) + (do ! + [_ .any] + (in candidate)) + + _ + (in default_policy)))) + +(def .public parser + (All (_ a) (-> (Parser a) (Parser [Code a]))) + (<>.and ..policy)) diff --git a/stdlib/source/library/lux/meta/macro/syntax/input.lux b/stdlib/source/library/lux/meta/macro/syntax/input.lux new file mode 100644 index 000000000..4461c7df9 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/input.lux @@ -0,0 +1,43 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)]] + [control + ["<>" parser]] + [data + ["[0]" product] + [collection + ["[0]" list (.use "[1]#[0]" monad)]]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]]) + +(type .public Input + (Record + [#binding Code + #type Code])) + +(def .public equivalence + (Equivalence Input) + (all product.equivalence + code.equivalence + code.equivalence + )) + +(def .public format + (-> (List Input) Code) + (|>> (list#each (function (_ value) + (list (the #binding value) + (the #type value)))) + list#conjoint + code.tuple)) + +(def .public parser + (Parser (List Input)) + (<| .tuple + <>.some + (all <>.and + .any + .any + ))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/type/variable.lux b/stdlib/source/library/lux/meta/macro/syntax/type/variable.lux new file mode 100644 index 000000000..363f85fc0 --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/syntax/type/variable.lux @@ -0,0 +1,25 @@ +(.require + [library + [lux (.except) + [abstract + [equivalence (.only Equivalence)]] + [data + ["[0]" text]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]]) + +(type .public Variable + Text) + +(def .public equivalence + (Equivalence Variable) + text.equivalence) + +(def .public format + (-> Variable Code) + code.local) + +(def .public parser + (Parser Variable) + .local) diff --git a/stdlib/source/library/lux/meta/macro/template.lux b/stdlib/source/library/lux/meta/macro/template.lux new file mode 100644 index 000000000..20cd85f2b --- /dev/null +++ b/stdlib/source/library/lux/meta/macro/template.lux @@ -0,0 +1,184 @@ +(.require + [library + [lux (.except let local symbol macro) + [abstract + ["[0]" monad (.only do)]] + [control + ["<>" parser (.use "[1]#[0]" functor)] + ["[0]" try (.only Try)] + ["[0]" exception (.only exception)]] + [data + ["[0]" bit (.use "[1]#[0]" codec)] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" monad)] + ["[0]" dictionary (.only Dictionary)]]] + [math + [number + ["[0]" nat (.use "[1]#[0]" decimal)] + ["[0]" int (.use "[1]#[0]" decimal)] + ["[0]" rev (.use "[1]#[0]" decimal)] + ["[0]" frac (.use "[1]#[0]" decimal)]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser (.only Parser)]]]]] + ["[0]" // (.only) + [syntax (.only syntax)] + ["^" pattern] + ["[0]" local]]) + +(def .public spliced + (syntax (_ [parts (.tuple (<>.some .any))]) + (in parts))) + +(def .public amount + (syntax (_ [parts (.tuple (<>.some .any))]) + (in (list (code.nat (list.size parts)))))) + +(def .public with_locals + (syntax (_ [locals (.tuple (<>.some .local)) + body .any]) + (do [! meta.monad] + [g!locals (|> locals + (list#each //.symbol) + (monad.all !))] + (in (list (` (.with_expansions [(,* (|> (list.zipped_2 locals g!locals) + (list#each (function (_ [name symbol]) + (list (code.local name) symbol))) + list#conjoint))] + (, body)))))))) + +(def (symbol_side module_side? parser) + (-> Bit (Parser Symbol) (Parser Text)) + (do <>.monad + [[module short] parser] + (in (if module_side? + (case module + "" short + _ module) + short)))) + +(def (snippet module_side?) + (-> Bit (Parser Text)) + (.let [full_symbol (..symbol_side module_side? .symbol)] + (all <>.either + .text + (if module_side? + full_symbol + (<>.either .local + full_symbol)) + (<>#each bit#encoded .bit) + (<>#each nat#encoded .nat) + (<>#each int#encoded .int) + (<>#each rev#encoded .rev) + (<>#each frac#encoded .frac) + ))) + +(def (part module_side?) + (-> Bit (Parser (List Text))) + (.tuple (<>.many (..snippet module_side?)))) + +(def .public text + (syntax (_ [simple (..part false)]) + (in (list (|> simple (text.interposed "") code.text))))) + +(with_template [ ] + [(def .public + (syntax (_ [name (<>.or (<>.and (..part true) (..part false)) + (..part false))]) + (case name + {.#Left [simple complex]} + (in (list ( [(text.interposed "" simple) + (text.interposed "" complex)]))) + + {.#Right simple} + (in (list (|> simple (text.interposed "") ))))))] + + [symbol code.local code.symbol] + ) + +(type Environment + (Dictionary Text Code)) + +(def (applied env template) + (-> Environment Code Code) + (case template + [_ {.#Symbol "" name}] + (case (dictionary.value name env) + {.#Some substitute} + substitute + + {.#None} + template) + + (^.with_template [] + [[meta { elems}] + [meta { (list#each (applied env) elems)}]]) + ([.#Form] + [.#Variant] + [.#Tuple]) + + _ + template)) + +(type Local + (Record + [#name Text + #parameters (List Text) + #template (List Code)])) + +(exception .public (irregular_arguments [expected Nat + actual Nat]) + (exception.report + "Expected" (at nat.decimal encoded expected) + "Actual" (at nat.decimal encoded actual))) + +(def (macro (open "_[0]")) + (-> Local Macro) + ("lux macro" + (function (_ inputs compiler) + (.let [parameters_amount (list.size _#parameters) + inputs_amount (list.size inputs)] + (if (nat.= parameters_amount inputs_amount) + (.let [environment (is Environment + (|> (list.zipped_2 _#parameters inputs) + (dictionary.of_list text.hash)))] + {.#Right [compiler (list#each (..applied environment) _#template)]}) + (exception.except ..irregular_arguments [parameters_amount inputs_amount])))))) + +(def local + (Parser Local) + (do <>.monad + [[name parameters] (.form (<>.and .local + (<>.many .local))) + template (.tuple (<>.some .any))] + (in [#name name + #parameters parameters + #template template]))) + +... TODO: Get rid of this (and any local definitions it depends on) once the bootstrapping compiler is gone. +(def .public let + (syntax (_ [locals (.tuple (<>.some ..local)) + body .any]) + (do meta.monad + [here_name meta.current_module_name + expression? (is (Meta Bit) + (function (_ lux) + {try.#Success [lux (case (the .#expected lux) + {.#None} + false + + {.#Some _} + true)]})) + g!pop (local.push (list#each (function (_ local) + [[here_name (the #name local)] + (..macro local)]) + locals))] + (if expression? + (//.with_symbols [g!body] + (in (list (` (.let [(, g!body) (, body)] + (exec + (, g!pop) + (, g!body))))))) + (in (list body + g!pop)))))) diff --git a/stdlib/source/library/lux/meta/type.lux b/stdlib/source/library/lux/meta/type.lux index af6ee1351..1664ce98a 100644 --- a/stdlib/source/library/lux/meta/type.lux +++ b/stdlib/source/library/lux/meta/type.lux @@ -15,9 +15,6 @@ [collection ["[0]" array] ["[0]" list (.use "[1]#[0]" monad monoid mix)]]] - ["[0]" macro (.only) - [syntax (.only syntax)] - ["^" pattern]] [math [number ["n" nat (.use "[1]#[0]" decimal)]]] @@ -25,7 +22,10 @@ ["[0]" location] ["[0]" symbol (.use "[1]#[0]" equivalence codec)] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]]) + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax)] + ["^" pattern]]]]]) (with_template [ ] [(def .public ( type) diff --git a/stdlib/source/library/lux/meta/type/check.lux b/stdlib/source/library/lux/meta/type/check.lux index cb49cc6e4..60c1f0e5c 100644 --- a/stdlib/source/library/lux/meta/type/check.lux +++ b/stdlib/source/library/lux/meta/type/check.lux @@ -16,11 +16,12 @@ [collection ["[0]" list (.use "[1]#[0]" mix)] ["[0]" set (.only Set)]]] - [macro - ["^" pattern]] [math [number - ["n" nat (.use "[1]#[0]" decimal)]]]]] + ["n" nat (.use "[1]#[0]" decimal)]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // (.use "[1]#[0]" equivalence)]) (def !n#= diff --git a/stdlib/source/library/lux/meta/type/dynamic.lux b/stdlib/source/library/lux/meta/type/dynamic.lux index eccb312e2..ea4635966 100644 --- a/stdlib/source/library/lux/meta/type/dynamic.lux +++ b/stdlib/source/library/lux/meta/type/dynamic.lux @@ -8,11 +8,11 @@ [data [text ["%" \\format]]] - [macro (.only with_symbols) - ["[0]" syntax (.only syntax)]] [meta ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro (.only with_symbols) + ["[0]" syntax (.only syntax)]]]]] ["[0]" // (.only) ["[0]" primitive (.only primitive)]]) diff --git a/stdlib/source/library/lux/meta/type/implicit.lux b/stdlib/source/library/lux/meta/type/implicit.lux index 3d92d214c..64bcb5469 100644 --- a/stdlib/source/library/lux/meta/type/implicit.lux +++ b/stdlib/source/library/lux/meta/type/implicit.lux @@ -15,14 +15,14 @@ [collection ["[0]" list (.use "[1]#[0]" monad mix)] ["[0]" dictionary (.only Dictionary)]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math ["[0]" number (.only) ["n" nat]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] ["[0]" // (.use "[1]#[0]" equivalence) ["/[1]" //] ["[0]" check (.only Check)]]) diff --git a/stdlib/source/library/lux/meta/type/poly.lux b/stdlib/source/library/lux/meta/type/poly.lux index 912a22a9b..abf1d8c5b 100644 --- a/stdlib/source/library/lux/meta/type/poly.lux +++ b/stdlib/source/library/lux/meta/type/poly.lux @@ -12,15 +12,15 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary]]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["^" pattern]] [math [number ["n" nat]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["^" pattern]]]]] ["[0]" // (.only) ["<[1]>" \\parser (.only Env)] ["/[1]" //]]) diff --git a/stdlib/source/library/lux/meta/type/primitive.lux b/stdlib/source/library/lux/meta/type/primitive.lux index 339612998..c1ead54eb 100644 --- a/stdlib/source/library/lux/meta/type/primitive.lux +++ b/stdlib/source/library/lux/meta/type/primitive.lux @@ -10,15 +10,15 @@ ["[0]" text (.use "[1]#[0]" equivalence)] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - ["[0]" macro (.only) - ["^" pattern] - ["[0]" context] - [syntax (.only syntax) - ["|[0]|" export]]] [meta ["[0]" symbol (.use "[1]#[0]" codec)] ["[0]" code (.only) - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + ["^" pattern] + ["[0]" context] + [syntax (.only syntax) + ["|[0]|" export]]]]]] ["[0]" //]) (type .public Frame diff --git a/stdlib/source/library/lux/meta/type/quotient.lux b/stdlib/source/library/lux/meta/type/quotient.lux index e6553fb40..a872c9992 100644 --- a/stdlib/source/library/lux/meta/type/quotient.lux +++ b/stdlib/source/library/lux/meta/type/quotient.lux @@ -3,11 +3,11 @@ [lux (.except type) [abstract [equivalence (only Equivalence)]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [meta ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)]]]]] ["[0]" // (.only) [primitive (.except)]]) diff --git a/stdlib/source/library/lux/meta/type/refinement.lux b/stdlib/source/library/lux/meta/type/refinement.lux index e5c18decf..b08bdd5e9 100644 --- a/stdlib/source/library/lux/meta/type/refinement.lux +++ b/stdlib/source/library/lux/meta/type/refinement.lux @@ -4,11 +4,11 @@ [control [function [predicate (.only Predicate)]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [meta ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] ["[0]" // (.only) [primitive (.except)]]) diff --git a/stdlib/source/library/lux/meta/type/resource.lux b/stdlib/source/library/lux/meta/type/resource.lux index f1e099e72..1f7ead9f5 100644 --- a/stdlib/source/library/lux/meta/type/resource.lux +++ b/stdlib/source/library/lux/meta/type/resource.lux @@ -15,14 +15,14 @@ ["[0]" set] ["[0]" sequence (.only Sequence)] ["[0]" list (.use "[1]#[0]" functor mix)]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number ["n" nat]]] ["[0]" meta (.only) ["[0]" code - ["<[1]>" \\parser (.only Parser)]]]]] + ["<[1]>" \\parser (.only Parser)]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] [// [primitive (.except)]]) diff --git a/stdlib/source/library/lux/meta/type/unit.lux b/stdlib/source/library/lux/meta/type/unit.lux index e0b0af638..cb8b9c142 100644 --- a/stdlib/source/library/lux/meta/type/unit.lux +++ b/stdlib/source/library/lux/meta/type/unit.lux @@ -5,14 +5,14 @@ [equivalence (.only Equivalence)] [order (.only Order)] [enum (.only Enum)]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number ["i" int]]] [meta ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] ["[0]" // (.only) [primitive (.except)]]) diff --git a/stdlib/source/library/lux/meta/type/unit/scale.lux b/stdlib/source/library/lux/meta/type/unit/scale.lux index f1bbdb08f..9d750eea9 100644 --- a/stdlib/source/library/lux/meta/type/unit/scale.lux +++ b/stdlib/source/library/lux/meta/type/unit/scale.lux @@ -1,15 +1,15 @@ (.require [library [lux (.except type) - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number ["i" int] ["[0]" ratio (.only Ratio)]]] [meta ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]]]] ["[0]" // (.only) ["/[1]" //]]) diff --git a/stdlib/source/library/lux/meta/version.lux b/stdlib/source/library/lux/meta/version.lux index 7c3eaf426..0bee9801e 100644 --- a/stdlib/source/library/lux/meta/version.lux +++ b/stdlib/source/library/lux/meta/version.lux @@ -10,11 +10,11 @@ ["[0]" text (.use "[1]#[0]" equivalence)] [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - [syntax (.only syntax)]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]] [tool [compiler [version (.only Version)]]]]]) diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux index 442038fdf..02c0c6179 100644 --- a/stdlib/source/library/lux/program.lux +++ b/stdlib/source/library/lux/program.lux @@ -9,11 +9,11 @@ ["[0]" io] [concurrency ["[0]" thread]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)]]]]] ["" \\parser]) (type Arguments diff --git a/stdlib/source/library/lux/static.lux b/stdlib/source/library/lux/static.lux index 375664915..617ce7cdb 100644 --- a/stdlib/source/library/lux/static.lux +++ b/stdlib/source/library/lux/static.lux @@ -8,14 +8,14 @@ [data [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)]] [math [number (.only hex)] ["[0]" random (.only Random)]] ["[0]" meta (.use "[1]#[0]" functor) ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]]]]) (with_template [ ] [(def .public diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux index aeb290691..b7ce2a7fb 100644 --- a/stdlib/source/library/lux/target/common_lisp.lux +++ b/stdlib/source/library/lux/target/common_lisp.lux @@ -8,12 +8,12 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" monad monoid)]]] - [macro - ["[0]" template]] [math [number ["f" frac]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/target/js.lux b/stdlib/source/library/lux/target/js.lux index 29816e610..e5a1ce144 100644 --- a/stdlib/source/library/lux/target/js.lux +++ b/stdlib/source/library/lux/target/js.lux @@ -8,13 +8,13 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["[0]" template]] [math [number ["i" int] ["f" frac]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux index 3167f2516..0b0af146e 100644 --- a/stdlib/source/library/lux/target/jvm/attribute.lux +++ b/stdlib/source/library/lux/target/jvm/attribute.lux @@ -11,11 +11,12 @@ ["[0]" product] ["[0]" binary ["[1]F" \\format (.only Format)]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // ["[1][0]" index (.only Index)] ["[1][0]" type (.only Type) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index ca0c92f65..906216326 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -20,14 +20,15 @@ ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" dictionary (.only Dictionary)] ["[0]" sequence (.only Sequence)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat] ["i" int] - ["[0]" i32 (.only I32)]]]]] + ["[0]" i32 (.only I32)]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]]]] ["[0]" / ["_" instruction (.only Primitive_Array_Type Instruction Estimator) (.use "[1]#[0]" monoid)] ["[1][0]" address (.only Address)] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux index f9e9d4b07..9dc19ed00 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux @@ -16,12 +16,12 @@ ["[0]" \\format (.only Mutation Specification)]] [collection ["[0]" list]]] - [macro - ["[0]" template]] [math [number (.only hex) ["n" nat]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]] ["[0]" // diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index fbd207bdc..e80bef65b 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -12,9 +12,6 @@ ["[0]" text] ["[0]" binary ["[1]F" \\format (.only Format) (.use "[1]#[0]" monoid)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["[0]" i32 (.only I32)] @@ -22,6 +19,9 @@ ["[0]" int] ["[0]" frac]]] [meta + [macro + ["^" pattern] + ["[0]" template]] [type [primitive (.except)]]]]] ["[0]" / diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux index ba6304a39..91d7c15c6 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux @@ -12,14 +12,14 @@ ["%" \\format (.only format)]] [binary ["[0]" \\format (.only Format)]]] - [macro - ["[0]" template]] [math [number ["[0]" i64] ["n" nat] ["i" int]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux index bbc331384..858d06d80 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux @@ -12,13 +12,13 @@ ["%" \\format (.only format)]] [binary ["[0]" \\format (.only Format)]]] - [macro - ["[0]" template]] [math [number ["n" nat] ["[0]" i64]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux index b76d05904..35b9894be 100644 --- a/stdlib/source/library/lux/target/jvm/modifier.lux +++ b/stdlib/source/library/lux/target/jvm/modifier.lux @@ -10,16 +10,16 @@ [data ["[0]" binary ["[1]F" \\format (.only Format)]]] - [macro (.only with_symbols) - [syntax (.only syntax)]] [math ["[0]" number (.only hex) ["[0]" i64]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro (.only with_symbols) + [syntax (.only syntax)]] + [type + [primitive (.except)]]]]] ["[0]" // [encoding ["[1][0]" unsigned]]]) diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux index cf38c5efa..45a33bb52 100644 --- a/stdlib/source/library/lux/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/reflection.lux @@ -16,11 +16,12 @@ ["[0]" list (.use "[1]#[0]" mix functor)] ["[0]" array] ["[0]" dictionary]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // [encoding ["[1][0]" name (.only External)]] diff --git a/stdlib/source/library/lux/target/jvm/type/category.lux b/stdlib/source/library/lux/target/jvm/type/category.lux index ad293150e..7cae42458 100644 --- a/stdlib/source/library/lux/target/jvm/type/category.lux +++ b/stdlib/source/library/lux/target/jvm/type/category.lux @@ -1,9 +1,9 @@ (.require [library [lux (.except Primitive) - [macro - ["[0]" template]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/target/lua.lux b/stdlib/source/library/lux/target/lua.lux index b0432cbdd..bb8d9bc84 100644 --- a/stdlib/source/library/lux/target/lua.lux +++ b/stdlib/source/library/lux/target/lua.lux @@ -13,19 +13,19 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] ["i" int] ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) ... Added the carriage return for better Windows compatibility. (def \n+ diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux index ef08c945d..0369549f3 100644 --- a/stdlib/source/library/lux/target/php.lux +++ b/stdlib/source/library/lux/target/php.lux @@ -13,18 +13,18 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) (def input_separator ", ") (def statement_suffix ";") diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index e1197964b..b02449eb7 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -14,18 +14,18 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) (.def input_separator ", ") diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux index 3ddfac43d..f425f584b 100644 --- a/stdlib/source/library/lux/target/r.lux +++ b/stdlib/source/library/lux/target/r.lux @@ -10,17 +10,17 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) (primitive .public (Code kind) Text diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index dd99e29f7..1d7662bae 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -13,18 +13,18 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] ["f" frac]]] [meta - [type - [primitive (.except)]] ["[0]" code (.only) - ["<[1]>" \\parser]]]]]) + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]] + [type + [primitive (.except)]]]]]) (def input_separator ", ") (def statement_suffix ";") diff --git a/stdlib/source/library/lux/target/scheme.lux b/stdlib/source/library/lux/target/scheme.lux index 6918a872c..e8e39d40e 100644 --- a/stdlib/source/library/lux/target/scheme.lux +++ b/stdlib/source/library/lux/target/scheme.lux @@ -12,13 +12,13 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor monoid)]]] - [macro - ["[0]" template]] [math [number ["n" nat] ["f" frac]]] [meta + [macro + ["[0]" template]] [type [primitive (.except)]]]]]) diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux index 19f0d287b..352207e47 100644 --- a/stdlib/source/library/lux/test.lux +++ b/stdlib/source/library/lux/test.lux @@ -24,20 +24,20 @@ ["[0]" set (.only Set)] ["[0]" dictionary ["[1]" ordered (.only Dictionary)]]]] - [time - ["[0]" instant] - ["[0]" duration (.only Duration)]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number (.only hex) ["n" nat] ["f" frac]]] - [macro - [syntax (.only syntax)]] ["[0]" meta (.only) ["[0]" symbol] ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]] + [time + ["[0]" instant] + ["[0]" duration (.only Duration)]] [world ["[0]" environment] ["[0]" console]]]]) diff --git a/stdlib/source/library/lux/time/day.lux b/stdlib/source/library/lux/time/day.lux index 2a85f5107..f50c79af1 100644 --- a/stdlib/source/library/lux/time/day.lux +++ b/stdlib/source/library/lux/time/day.lux @@ -12,12 +12,13 @@ ["[0]" exception (.only exception)]] [data ["[0]" text (.use "[1]#[0]" monoid)]] - [macro - ["^" pattern] - ["[0]" template]] [math [number - ["n" nat]]]]]) + ["n" nat]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]]]]) (type .public Day (Variant diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux index a8e01bc39..385106ea5 100644 --- a/stdlib/source/library/lux/time/month.lux +++ b/stdlib/source/library/lux/time/month.lux @@ -12,12 +12,13 @@ ["[0]" exception (.only exception)]] [data ["[0]" text (.use "[1]#[0]" monoid)]] - [macro - ["^" pattern] - ["[0]" template]] [math [number - ["n" nat]]]]]) + ["n" nat]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]]]]) (type .public Month (Variant diff --git a/stdlib/source/library/lux/tool/compiler/default/init.lux b/stdlib/source/library/lux/tool/compiler/default/init.lux index f966f9b63..7d015fd6b 100644 --- a/stdlib/source/library/lux/tool/compiler/default/init.lux +++ b/stdlib/source/library/lux/tool/compiler/default/init.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["@" target (.only Target)] - ["[0]" meta] [abstract ["[0]" monad (.only do)]] [control @@ -18,7 +17,7 @@ ["[0]" dictionary] ["[0]" set] ["[0]" sequence (.use "[1]#[0]" functor)]]] - [meta + ["[0]" meta (.only) ["[0]" configuration (.only Configuration)] ["[0]" version]] [world diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux index 13d0ba6ed..2442874a0 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux @@ -17,8 +17,6 @@ ["%" \\format (.only Format)]] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - [syntax (.only syntax)]] [math [number ["n" nat] @@ -29,7 +27,9 @@ ["[0]" location] ["[0]" configuration (.only Configuration)] ["[0]" code - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)]]]]] ["[0]" / ["[1][0]" simple (.only Simple)] ["[1][0]" complex (.only Tuple Variant Complex)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux index 04023ab5c..aefb5abc7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/coverage.lux @@ -16,15 +16,16 @@ ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" dictionary (.only Dictionary)] ["[0]" set (.only Set) (.use "[1]#[0]" equivalence)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat (.use "[1]#[0]" interval)] ["i" int] ["r" rev] - ["f" frac]]]]] + ["f" frac]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]]]] ["[0]" // ["[1][0]" simple] ["[1][0]" complex] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux index bbffab2a0..d25fb1f8a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/inference.lux @@ -14,13 +14,13 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor monoid)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat]]] [meta + [macro + ["^" pattern] + ["[0]" template]] ["[0]" type (.only) ["[0]" check]]]]] ["/" // (.only Analysis Operation Phase) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux index 73ce2ea01..2e2982214 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux @@ -1,6 +1,7 @@ (.require [library [lux (.except) + ["[0]" meta] [abstract [monad (.only do)]] [control @@ -8,8 +9,7 @@ ["[0]" exception (.only exception)]] [data ["[0]" text - ["%" \\format (.only format)]]] - ["[0]" meta]]] + ["%" \\format (.only format)]]]]] [///// ["[0]" phase]]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux index d9ab4f4a1..33e818a9e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux @@ -1,6 +1,7 @@ (.require [library [lux (.except Label with) + ["[0]" meta] [abstract ["[0]" monad (.only do)]] [control @@ -12,8 +13,7 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" mix functor) - ["[0]" property]]]] - ["[0]" meta]]] + ["[0]" property]]]]]] ["/" // (.only Operation) ["//[1]" // [phase diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/simple.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/simple.lux index b87c107ff..4b092ad00 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/simple.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/simple.lux @@ -7,14 +7,15 @@ ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only Format)]]] - [macro - ["^" pattern]] [math [number ["n" nat] ["i" int] ["r" rev] - ["f" frac]]]]]) + ["f" frac]]] + [meta + [macro + ["^" pattern]]]]]) (type .public Simple (Variant diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux index 6cfad0d9f..b534b616a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - ["[0]" meta] [abstract ["[0]" monad (.only do)]] [control @@ -12,12 +11,12 @@ ["%" \\format (.only format)]] [collection ["[0]" list]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] - [meta + ["[0]" meta (.only) + [macro + ["^" pattern]] [type ["[0]" check (.only Check)]]]]] ["/" // (.only Operation) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux index bd46c3d8c..c217a6d6c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux @@ -16,14 +16,14 @@ ["[0]" sequence (.only Sequence)] ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set (.only Set)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat]]] [meta - ["[0]" symbol]]]] + ["[0]" symbol] + [macro + ["^" pattern] + ["[0]" template]]]]] [// [synthesis (.only Synthesis)] [phase diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux index 5882c78f4..594626581 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux @@ -10,14 +10,14 @@ ["%" \\format (.only format)]] [collection ["[0]" list]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] ["[0]" meta (.only) + ["[0]" location] ["[0]" code] - ["[0]" location]]]] + [macro + ["^" pattern]]]]] ["[0]" / ["[1][0]" simple] ["[1][0]" complex] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux index 7301f6b8e..65d951e0a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -16,10 +16,10 @@ [math [number ["n" nat]]] - [macro - ["^" pattern]] ["[0]" meta (.only) ["[0]" code] + [macro + ["^" pattern]] ["[0]" type (.only) ["[0]" check (.only Check)]]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux index 2e43232b3..61daacb2f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -1,7 +1,6 @@ (.require [library [lux (.except) - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -9,8 +8,9 @@ [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]]] - [macro - ["^" pattern]]]] + ["[0]" meta (.only) + [macro + ["^" pattern]]]]] ["[0]" // ["/[1]" // ["[1][0]" extension] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux index c8ffe0bb7..36a7deaa1 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux @@ -16,8 +16,9 @@ [collection ["[0]" list] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] [///// ["//" phase] [meta diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index 54592b36b..39dc0ac97 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -24,9 +24,6 @@ ["[0]" array] ["[0]" dictionary (.only Dictionary)] ["[0]" sequence]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat] @@ -34,6 +31,9 @@ ["[0]" meta (.only) ["[0]" code ["<[1]>" \\parser (.only Parser)]] + [macro + ["^" pattern] + ["[0]" template]] ["[0]" type (.only) ["[0]" check (.only Check) (.use "[1]#[0]" monad)]]] [target diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index a9932f619..367240a34 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -14,14 +14,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] [meta ["[0]" code ["<[1]>" \\parser (.only Parser)]] + [macro + ["^" pattern]] [type ["[0]" check]]] ["[0]" meta]]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux index 9f74950cb..8cb1f6b1c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -21,16 +21,16 @@ ["[0]" dictionary] ["[0]" sequence] ["[0]" set (.only Set)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat] ["[0]" i32]]] [meta ["[0]" code - ["<[1]>" \\parser (.only Parser)]]] + ["<[1]>" \\parser (.only Parser)]] + [macro + ["^" pattern] + ["[0]" template]]] [target [jvm ["_" bytecode (.only Bytecode) (.use "[1]#[0]" monad)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux index 8b50853ac..8c5f5dbc8 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/lux.lux @@ -20,14 +20,14 @@ ["[0]" array] ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set (.only Set)]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] ["[0]" meta (.only) ["[0]" code - ["<[1]>" \\parser (.only Parser)]]] + ["<[1]>" \\parser (.only Parser)]] + [macro + ["^" pattern]]] ["[0]" type (.only sharing) (.use "[1]#[0]" equivalence) ["[0]" check]]]] ["[0]" /// (.only Extender) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux index 150ff7dee..3205b9933 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux @@ -11,11 +11,12 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary]]] - [macro - ["^" pattern]] [math [number ["f" frac]]] + [meta + [macro + ["^" pattern]]] ["@" target (.only) ["_" js (.only Literal Expression Statement)]]]] ["[0]" //// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux index 13662d1c3..b72b69b2c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -19,13 +19,14 @@ ["[0]" dictionary (.only Dictionary)] ["[0]" set (.only Set)] ["[0]" sequence]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat] ["[0]" i32]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]] [target [jvm ["[0]" version] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux index 560f6c1ae..abaf8d32f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux @@ -14,11 +14,12 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["^" pattern]] [math [number ["f" frac]]] + [meta + [macro + ["^" pattern]]] ["@" target (.only) ["_" lua (.only Expression Statement)]]]] ["[0]" //// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux index f36712cd4..37ac2d627 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux @@ -14,11 +14,12 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["^" pattern]] [math [number ["f" frac]]] + [meta + [macro + ["^" pattern]]] [target ["_" python (.only Expression Statement)]]]] ["[0]" //// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux index a9681db10..95b08bf3c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux @@ -14,11 +14,12 @@ [collection ["[0]" dictionary] ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["^" pattern]] [math [number ["f" frac]]] + [meta + [macro + ["^" pattern]]] [target ["_" ruby (.only Expression Statement)]]]] ["[0]" //// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux index 9087341e0..8af11bb77 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp.lux @@ -3,8 +3,9 @@ [lux (.except) [abstract [monad (.only do)]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" / [runtime (.only Phase)] ["[1][0]" primitive] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux index a839ca4ba..6059eddc2 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux @@ -9,11 +9,12 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix monoid)] ["[0]" set]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] + [meta + [macro + ["^" pattern]]] [target ["_" common_lisp (.only Expression Var/1)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux index 434d214e0..a945e79be 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux @@ -14,14 +14,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor monoid)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target ["_" common_lisp (.only Expression Computation Literal)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux index 0ccc9cbd3..9ab55a0a6 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux @@ -6,11 +6,11 @@ [data [collection ["[0]" list (.use "[1]#[0]" functor)]]] - ["[0]" macro (.only with_symbols) - [syntax (.only syntax)]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)]]]]] ["[0]" /// ["[1][0]" extension] [// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux index 4c6b002c2..907159f8a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux @@ -5,8 +5,9 @@ [monad (.only do)]] [control ["[0]" exception (.only exception)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" js]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux index ce5b1a3f8..24e27bd78 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux @@ -9,11 +9,12 @@ ["[0]" text] [collection ["[0]" list (.use "[1]#[0]" functor mix)]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] + [meta + [macro + ["^" pattern]]] [target ["_" js (.only Expression Computation Var Statement)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux index 75762cc34..da52044a7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux @@ -15,14 +15,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] [target ["_" js (.only Expression Var Computation Statement)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux index e5994dc9f..8b5ee06f9 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm.lux @@ -3,8 +3,9 @@ [lux (.except) [abstract [monad (.only do)]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" / [runtime (.only Phase)] ["[1][0]" primitive] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux index ad49fa9e5..bc03aae26 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux @@ -10,12 +10,13 @@ ["[0]" list (.use "[1]#[0]" mix)]] ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]]] - [macro - ["^" pattern]] [math [number ["n" nat] ["[0]" i32]]] + [meta + [macro + ["^" pattern]]] [target [jvm ["_" bytecode (.only Label Bytecode) (.use "[1]#[0]" monad) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux index ad9b0e720..100d864ab 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux @@ -6,11 +6,12 @@ [monad (.only do)]] [control ["[0]" try]] - [macro - ["^" pattern]] [math [number ["i" int]]] + [meta + [macro + ["^" pattern]]] [target [jvm ["_" bytecode (.only Bytecode)] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux index e3929c22c..6971e4cfa 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux @@ -5,8 +5,9 @@ [monad (.only do)]] [control ["[0]" exception (.only exception)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" lua]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux index 5d87b83d7..ea8ca09f0 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux @@ -9,8 +9,9 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" lua (.only Expression Var Statement)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux index 0d3d0f783..7d2fff7cd 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux @@ -15,14 +15,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" lua (.only Expression Location Var Computation Literal Label Statement)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux index 030565284..e96ac884a 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux @@ -5,8 +5,9 @@ [monad (.only do)]] [control ["[0]" exception (.only exception)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" php]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux index 2b015ee7f..39ae8fcd4 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux @@ -10,11 +10,12 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern]] [math [number ["i" int]]] + [meta + [macro + ["^" pattern]]] [target ["_" php (.only Expression Var Statement)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux index 2e525be79..755efeded 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux @@ -15,14 +15,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" php (.only Expression Label Constant Var Computation Literal Statement)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux index f88b023c8..a5435e72d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python.lux @@ -5,8 +5,9 @@ [monad (.only do)]] [control ["[0]" exception (.only exception)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" python]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux index b79dc468b..5062e41ae 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux @@ -9,12 +9,13 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern]] [math [number ["n" nat] ["i" int]]] + [meta + [macro + ["^" pattern]]] [target ["_" python (.only Expression SVar Statement)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index 19c967248..b90fd1962 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux @@ -15,8 +15,6 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["f" frac] @@ -24,7 +22,9 @@ ["[0]" meta (.only) ["[0]" version] ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" python (.only Expression SVar Computation Literal Statement)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux index cb2ccd087..135f3e4df 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r.lux @@ -3,8 +3,9 @@ [lux (.except) [abstract [monad (.only do)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" r]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux index ac0a29c7e..51cb787a3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux @@ -10,12 +10,13 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["i" int]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]] [target ["_" r (.only Expression SVar)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux index 49dfb21af..47cc25566 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux @@ -15,8 +15,6 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["n" nat] @@ -24,7 +22,9 @@ ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" r (.only SVar Expression)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux index f46905815..989d07127 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux @@ -5,8 +5,9 @@ [monad (.only do)]] [control ["[0]" exception (.only exception)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" ruby]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux index 8e22cf563..68c958870 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux @@ -9,12 +9,13 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern]] [math [number ["n" nat] ["i" int]]] + [meta + [macro + ["^" pattern]]] [target ["_" ruby (.only Expression LVar Statement)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux index 6684e6a59..32eb33c53 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux @@ -15,15 +15,15 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64] ["[0]" int (.use "[1]#[0]" interval)]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" ruby (.only Expression LVar Computation Literal Statement)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux index 35c505b59..24b418ffa 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme.lux @@ -3,8 +3,9 @@ [lux (.except) [abstract [monad (.only do)]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [target ["_" scheme]]]] ["[0]" / diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux index 5f07b07e7..b9546d729 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux @@ -10,12 +10,13 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["i" int]]] + [meta + [macro + ["^" pattern] + ["[0]" template]]] [target ["_" scheme (.only Expression Computation Var)]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux index cbf99339c..80d6b5111 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux @@ -11,11 +11,11 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["dict" dictionary (.only Dictionary)]]] - ["[0]" macro (.only with_symbols) - [syntax (.only syntax)]] [meta ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)]]] [target ["_" scheme (.only Expression Computation)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux index 1bf3f72eb..a54248283 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux @@ -15,14 +15,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" sequence]]] - ["[0]" macro (.only) - [syntax (.only syntax)]] [math [number (.only hex) ["[0]" i64]]] ["[0]" meta (.only) ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + ["[0]" macro (.only) + [syntax (.only syntax)]]] ["@" target (.only) ["_" scheme (.only Expression Computation Var)]]]] ["[0]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux index 69c424b5b..3aa00a192 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux @@ -10,8 +10,9 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" / ["[1][0]" function] ["[1][0]" case] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 507e0b5fa..b2e0d357d 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -13,13 +13,14 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix monoid)] ["[0]" set (.only Set)]]] - [macro - ["^" pattern]] [math [number ["n" nat] ["[0]" i64] - ["[0]" frac]]]]] + ["[0]" frac]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" /// [// ["[1][0]" analysis (.only Match Analysis) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux index e58b8f6fd..f1bf10c2c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -13,11 +13,12 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor monoid)]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // ["[1][0]" loop (.only Transform)] ["//[1]" /// diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index 42d9ed6ae..eb5738a11 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -8,11 +8,12 @@ [data [collection ["[0]" list]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] [//// ["[0]" analysis (.only Environment) ["[1]/[0]" complex]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index 7f2be3cf5..80fce0c79 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -15,11 +15,12 @@ ["[0]" dictionary (.only Dictionary)] ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" set]]] - [macro - ["^" pattern]] [math [number - ["n" nat]]]]] + ["n" nat]]] + [meta + [macro + ["^" pattern]]]]] [//// ["[0]" analysis (.only) ["[1]/[0]" complex]] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index cba888c44..e5304ee2e 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -41,13 +41,13 @@ [collection ["[0]" list] ["[0]" dictionary (.only Dictionary)]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [meta ["[0]" symbol] ["[0]" code - ["<[1]>" \\parser]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]]] [math [number ["n" nat] diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux index 03fd9d860..735da0f51 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux @@ -16,14 +16,15 @@ [collection ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]] [math [number ["[0]" i64] ["n" nat] ["i" int] - ["f" frac]]]]] + ["f" frac]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" / ["[1][0]" simple (.only Simple)] ["[1][0]" access (.only Access) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux index 32a921934..738ea9b76 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/simple.lux @@ -10,14 +10,15 @@ ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format]]] - [macro - ["^" pattern]] [math [number ["[0]" i64 (.use "[1]#[0]" equivalence)] ["n" nat] ["i" int] - ["f" frac]]]]]) + ["f" frac]]] + [meta + [macro + ["^" pattern]]]]]) (type .public Simple (Variant diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact/category.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact/category.lux index 665894617..706ea16ae 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact/category.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact/category.lux @@ -8,11 +8,12 @@ [data ["[0]" product] ["[0]" text (.use "[1]#[0]" equivalence)]] - [macro - ["^" pattern]] [math [number - ["[0]" nat]]]]] + ["[0]" nat]]] + [meta + [macro + ["^" pattern]]]]] [///// [arity (.only Arity)]]) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/module/descriptor.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/module/descriptor.lux index b3e186b92..057f72e6e 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/module/descriptor.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/module/descriptor.lux @@ -13,11 +13,12 @@ ["<[1]>" \\parser (.only Parser)]] [collection ["[0]" set (.only Set)]]] - [macro - ["^" pattern]] [math [number ["[0]" nat]]] + [meta + [macro + ["^" pattern]]] [world [file (.only Path)]]]]) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux index b7c1e2e35..fa6493f90 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -20,9 +20,9 @@ ["[0]" list] ["[0]" sequence (.only Sequence) (.use "[1]#[0]" functor mix)] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["^" pattern]] [meta + [macro + ["^" pattern]] [type [primitive (.except)]]]]] ["[0]" // diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency/artifact.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency/artifact.lux index 11fa0a54f..d3e19193c 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency/artifact.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency/artifact.lux @@ -12,13 +12,13 @@ ["[0]" set (.only Set)] ["[0]" dictionary (.only Dictionary)] ["[0]" sequence]]] - [macro - ["^" pattern]] [math [number ["[0]" nat]]] [meta - ["[0]" symbol]] + ["[0]" symbol] + [macro + ["^" pattern]]] [tool [compiler ["[0]" phase] diff --git a/stdlib/source/library/lux/tool/compiler/meta/cli.lux b/stdlib/source/library/lux/tool/compiler/meta/cli.lux index caeb07961..2f2aa0f92 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/cli.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/cli.lux @@ -14,13 +14,13 @@ ["<[1]>" \\parser]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["^" pattern]] [math [number (.only hex)]] [meta ["[0]" symbol] - ["[0]" configuration (.only Configuration)]] + ["[0]" configuration (.only Configuration)] + [macro + ["^" pattern]]] ["[0]" program ["<[1]>" \\parser (.only Parser)]] [tool diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux index 3a89e09eb..032eaaf66 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux @@ -20,11 +20,11 @@ ["[0]" list (.use "[1]#[0]" mix)] ["[0]" dictionary (.only Dictionary)] ["[0]" sequence (.only Sequence)]]] - [macro - ["^" pattern]] [meta ["[0]" configuration (.only Configuration)] - ["[0]" version]] + ["[0]" version] + [macro + ["^" pattern]]] [world ["[0]" file]]]] ["[0]" // (.only) diff --git a/stdlib/source/library/lux/tool/compiler/reference.lux b/stdlib/source/library/lux/tool/compiler/reference.lux index c4a64ae2e..340cf1a0d 100644 --- a/stdlib/source/library/lux/tool/compiler/reference.lux +++ b/stdlib/source/library/lux/tool/compiler/reference.lux @@ -9,13 +9,13 @@ [data [text ["%" \\format (.only Format)]]] - [macro - ["^" pattern]] [math [number ["n" nat]]] [meta - ["[0]" symbol]]]] + ["[0]" symbol] + [macro + ["^" pattern]]]]] ["[0]" / ["[1][0]" variable (.only Variable)]]) diff --git a/stdlib/source/library/lux/tool/compiler/reference/variable.lux b/stdlib/source/library/lux/tool/compiler/reference/variable.lux index 30f7b449d..852a1e058 100644 --- a/stdlib/source/library/lux/tool/compiler/reference/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/reference/variable.lux @@ -9,12 +9,13 @@ [data [text ["%" \\format (.only Format)]]] - [macro - ["^" pattern]] [math [number ["n" nat] - ["i" int]]]]]) + ["i" int]]] + [meta + [macro + ["^" pattern]]]]]) (type .public Register Nat) diff --git a/stdlib/source/library/lux/world/db/jdbc.lux b/stdlib/source/library/lux/world/db/jdbc.lux index 71ffeb1db..955335715 100644 --- a/stdlib/source/library/lux/world/db/jdbc.lux +++ b/stdlib/source/library/lux/world/db/jdbc.lux @@ -1,12 +1,14 @@ (.require [library [lux (.except and int) + [fii (.only import)] [control [functor (.only Functor)] [apply (.only Apply)] [monad (.only Monad do)] - ["[0]" try (.only Try)] ["ex" exception] + ["[0]" try (.only Try)] + ["[0]" io (.only IO)] [concurrency ["[0]" async (.only Async) (.use "[1]#[0]" monad)]] [security @@ -15,10 +17,8 @@ ["[0]" product] [text ["%" \\format (.only format)]]] - ["[0]" io (.only IO)] [world - [net (.only URL)]] - [host (.only import)]]] + [net (.only URL)]]]] [// ["[0]" sql]] ["[0]" / diff --git a/stdlib/source/library/lux/world/db/jdbc/input.lux b/stdlib/source/library/lux/world/db/jdbc/input.lux index 94a0b399e..fb8f9b3e3 100644 --- a/stdlib/source/library/lux/world/db/jdbc/input.lux +++ b/stdlib/source/library/lux/world/db/jdbc/input.lux @@ -5,10 +5,10 @@ [control [functor (.only Contravariant)] [monad (.only Monad do)] - ["[0]" try (.only Try)]] + ["[0]" try (.only Try)] + ["[0]" io (.only IO)]] [time ["[0]" instant (.only Instant)]] - ["[0]" io (.only IO)] [world [binary (.only Binary)]]]]) diff --git a/stdlib/source/library/lux/world/db/jdbc/output.lux b/stdlib/source/library/lux/world/db/jdbc/output.lux index 809015e50..6a9181636 100644 --- a/stdlib/source/library/lux/world/db/jdbc/output.lux +++ b/stdlib/source/library/lux/world/db/jdbc/output.lux @@ -7,10 +7,10 @@ [apply (.only Apply)] [monad (.only Monad do)] ["ex" exception] - ["[0]" try (.only Try)]] + ["[0]" try (.only Try)] + ["[0]" io (.only IO)]] [time ["[0]" instant (.only Instant)]] - ["[0]" io (.only IO)] [world [binary (.only Binary)]]]]) diff --git a/stdlib/source/library/lux/world/db/sql.lux b/stdlib/source/library/lux/world/db/sql.lux index 834e43081..70312b648 100644 --- a/stdlib/source/library/lux/world/db/sql.lux +++ b/stdlib/source/library/lux/world/db/sql.lux @@ -10,8 +10,9 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["[0]" template]] + [meta + [macro + ["[0]" template]]] [type [primitive (.except)]]]]) diff --git a/stdlib/source/library/lux/world/environment.lux b/stdlib/source/library/lux/world/environment.lux index dc055f98d..ce76fc208 100644 --- a/stdlib/source/library/lux/world/environment.lux +++ b/stdlib/source/library/lux/world/environment.lux @@ -25,11 +25,12 @@ (.,, (.for "JavaScript" (.,, (.these ["[0]" node_js])) "{old}" (.,, (.these ["node_js" //math])) (.,, (.these))))] - ["[0]" macro (.only) - ["[0]" template]] [math [number - ["i" int]]]]] + ["i" int]]] + [meta + ["[0]" macro (.only) + ["[0]" template]]]]] ["[0]" \\parser] [// [file (.only Path)] diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 3b768f0a1..303782ac7 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -28,12 +28,13 @@ (.,, (.for "JavaScript" (.,, (.these ["[0]" node_js])) "{old}" (.,, (.these ["node_js" //control/thread])) (.,, (.these))))] - [macro - ["[0]" template]] [math [number ["i" int] ["f" frac]]] + [meta + [macro + ["[0]" template]]] [time ["[0]" instant (.only Instant)] ["[0]" duration]]]]))) diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux index 3cc84fdcf..6a999716d 100644 --- a/stdlib/source/library/lux/world/net/http/client.lux +++ b/stdlib/source/library/lux/world/net/http/client.lux @@ -17,16 +17,16 @@ ["[0]" text] [collection ["[0]" dictionary]]] - [macro - [syntax (.only syntax)] - ["[0]" template]] [math [number ["n" nat] ["i" int]]] [meta ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["<[1]>" \\parser]] + [macro + [syntax (.only syntax)] + ["[0]" template]]]]] ["[0]" // (.only) [// (.only URL)]]) diff --git a/stdlib/source/library/lux/world/net/http/request.lux b/stdlib/source/library/lux/world/net/http/request.lux index e4c1eebb9..fdf8a8aa1 100644 --- a/stdlib/source/library/lux/world/net/http/request.lux +++ b/stdlib/source/library/lux/world/net/http/request.lux @@ -21,8 +21,9 @@ [collection ["[0]" list (.use "[1]#[0]" functor mix)] ["[0]" dictionary]]] - [macro - ["^" pattern]] + [meta + [macro + ["^" pattern]]] [world ["[0]" binary (.only Binary)]]]] ["[0]" // (.only Body Response Server) diff --git a/stdlib/source/library/lux/world/net/http/response.lux b/stdlib/source/library/lux/world/net/http/response.lux index 68e9fe674..7b223efed 100644 --- a/stdlib/source/library/lux/world/net/http/response.lux +++ b/stdlib/source/library/lux/world/net/http/response.lux @@ -2,6 +2,7 @@ [library [lux (.except static) [control + ["[0]" io] [concurrency ["[0]" async] ["[0]" frp (.use "[1]#[0]" monad)]]] @@ -13,7 +14,6 @@ ["[0]" css (.only CSS)] ["[0]" context] ["[0]" json (.only JSON) (.use "[1]#[0]" codec)]]] - ["[0]" io] [world ["[0]" binary (.only Binary)]]]] ["[0]" // (.only Status Body Response Server) diff --git a/stdlib/source/library/lux/world/net/http/route.lux b/stdlib/source/library/lux/world/net/http/route.lux index e4454432e..53d533334 100644 --- a/stdlib/source/library/lux/world/net/http/route.lux +++ b/stdlib/source/library/lux/world/net/http/route.lux @@ -10,8 +10,9 @@ ["[0]" text] [number ["n" nat]]] - [macro - ["^" pattern]]]] + [meta + [macro + ["^" pattern]]]]] ["[0]" // (.only URI Server) ["[1][0]" status] ["[1][0]" response]]) -- cgit v1.2.3