From 104130efba46a875eba566384578f8aa8593ad37 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 1 Jul 2022 18:53:58 -0400 Subject: Moved "lux/macro/code" to "lux/meta/code". --- stdlib/source/test/aedifex/artifact/time.lux | 6 +- stdlib/source/test/aedifex/metadata/artifact.lux | 4 +- stdlib/source/test/aedifex/metadata/snapshot.lux | 4 +- stdlib/source/test/aedifex/parser.lux | 2 +- stdlib/source/test/lux.lux | 8 +- stdlib/source/test/lux/control/parser.lux | 3 +- stdlib/source/test/lux/control/remember.lux | 12 +- stdlib/source/test/lux/data/binary.lux | 4 +- stdlib/source/test/lux/data/format/json.lux | 4 +- stdlib/source/test/lux/data/text.lux | 11 +- stdlib/source/test/lux/data/text/escape.lux | 10 +- stdlib/source/test/lux/data/text/regex.lux | 9 +- stdlib/source/test/lux/debug.lux | 10 +- stdlib/source/test/lux/documentation.lux | 4 +- stdlib/source/test/lux/extension.lux | 91 +++--- stdlib/source/test/lux/ffi.jvm.lux | 8 +- stdlib/source/test/lux/ffi/export.jvm.lux | 6 +- stdlib/source/test/lux/macro.lux | 10 +- stdlib/source/test/lux/macro/code.lux | 318 --------------------- stdlib/source/test/lux/macro/local.lux | 10 +- stdlib/source/test/lux/macro/pattern.lux | 6 +- stdlib/source/test/lux/macro/syntax.lux | 8 +- stdlib/source/test/lux/macro/syntax/check.lux | 11 +- .../source/test/lux/macro/syntax/declaration.lux | 7 +- stdlib/source/test/lux/macro/syntax/definition.lux | 18 +- stdlib/source/test/lux/macro/syntax/export.lux | 8 +- stdlib/source/test/lux/macro/syntax/input.lux | 17 +- .../source/test/lux/macro/syntax/type/variable.lux | 7 +- stdlib/source/test/lux/macro/template.lux | 9 +- stdlib/source/test/lux/math/modulus.lux | 4 +- stdlib/source/test/lux/meta.lux | 2 + stdlib/source/test/lux/meta/code.lux | 318 +++++++++++++++++++++ stdlib/source/test/lux/meta/configuration.lux | 10 +- stdlib/source/test/lux/meta/location.lux | 7 +- stdlib/source/test/lux/meta/type.lux | 6 +- stdlib/source/test/lux/meta/type/primitive.lux | 10 +- stdlib/source/test/lux/meta/type/resource.lux | 10 +- stdlib/source/test/lux/meta/type/unit/scale.lux | 8 +- stdlib/source/test/lux/meta/version.lux | 10 +- stdlib/source/test/lux/program.lux | 9 +- stdlib/source/test/lux/static.lux | 7 +- stdlib/source/test/lux/target/jvm.lux | 6 +- stdlib/source/test/lux/target/python.lux | 6 +- .../compiler/language/lux/analysis/inference.lux | 4 +- .../tool/compiler/language/lux/analysis/macro.lux | 9 +- .../tool/compiler/language/lux/phase/analysis.lux | 4 +- .../compiler/language/lux/phase/analysis/case.lux | 4 +- .../language/lux/phase/analysis/complex.lux | 4 +- .../language/lux/phase/analysis/function.lux | 4 +- .../language/lux/phase/extension/analysis/lux.lux | 3 +- .../test/lux/tool/compiler/language/lux/syntax.lux | 3 +- 51 files changed, 538 insertions(+), 535 deletions(-) delete mode 100644 stdlib/source/test/lux/macro/code.lux create mode 100644 stdlib/source/test/lux/meta/code.lux (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/aedifex/artifact/time.lux b/stdlib/source/test/aedifex/artifact/time.lux index 2ef81472a..c81dffa89 100644 --- a/stdlib/source/test/aedifex/artifact/time.lux +++ b/stdlib/source/test/aedifex/artifact/time.lux @@ -11,12 +11,12 @@ [data ["[0]" text ["<[1]>" \\parser]]] - [time - ["[0]" instant (.use "[1]#[0]" equivalence)]] [math ["[0]" random (.only Random)] [number - ["i" int]]]]] + ["i" int]]] + [time + ["[0]" instant (.use "[1]#[0]" equivalence)]]]] [\\program ["[0]" /]] ["[0]" / diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index 5e0a5b41c..17770c575 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -20,12 +20,12 @@ ["<[1]>" \\parser]]] [collection ["[0]" list]]] - [macro - ["[0]" code]] [math ["[0]" random (.only Random)] [number ["n" nat]]] + [meta + ["[0]" code]] ["[0]" time (.only) ["[0]" date] ["[0]" year] diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index 9d88a0617..46e368dbf 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -20,12 +20,12 @@ ["<[1]>" \\parser]]] [collection ["[0]" list]]] - [macro - ["[0]" code]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat]]] + [meta + ["[0]" code]] ["[0]" time (.only) ["[0]" date] ["[0]" year] diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index cd49c6417..01daa640e 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -18,7 +18,7 @@ ["[0]" random (.only Random)] [number ["n" nat]]] - [macro + [meta ["[0]" code (.only) ["<[1]>" \\parser]]]]] [// diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 04f893c8f..a7cb9cfa9 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -24,9 +24,7 @@ ["[0]" macro (.only) [syntax (.only syntax)] ["^" pattern] - ["[0]" template] - ["[0]" code (.use "[1]#[0]" equivalence) - ["<[1]>" \\parser]]] + ["[0]" template]] ["[0]" math ["[0]" random (.use "[1]#[0]" functor)] [number @@ -38,7 +36,9 @@ ["f" frac] ["[0]" i64]]] ["[0]" meta (.use "[1]#[0]" monad) - ["[0]" location (.use "[1]#[0]" equivalence)]]]] + ["[0]" location (.use "[1]#[0]" equivalence)] + ["[0]" code (.use "[1]#[0]" equivalence) + ["<[1]>" \\parser]]]]] ... TODO: Must have 100% coverage on tests. ["[0]" / ["[1][0]" abstract] diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index aa083b543..738a8b739 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -21,7 +21,8 @@ [number ["n" nat]]] [macro - [syntax (.only syntax)] + [syntax (.only syntax)]] + [meta ["[0]" code (.only) ["<[1]>" \\parser]]]]] [\\library diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index 44216d17d..8d6c21767 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract ["[0]" monad (.only do)]] [control @@ -16,14 +15,15 @@ [math [number (.only hex)] ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] + ["[0]" macro (.only) + ["[0]" syntax (.only syntax)]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]] [time ["[0]" date (.only Date)] ["[0]" instant] - ["[0]" duration]] - ["[0]" macro (.only) - ["[0]" syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]]]] + ["[0]" duration]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 5bd685351..4fde0e1f9 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -32,8 +32,7 @@ [array [\\unsafe (.only)]]]] [macro - ["^" pattern] - ["[0]" code]] + ["^" pattern]] [math ["[0]" random (.only Random)] [number @@ -43,6 +42,7 @@ ["[0]" rev] ["[0]" frac]]] [meta + ["[0]" code] ["[0]" symbol] ["[0]" type]]]] [\\library diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 75d616037..7177b268d 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -29,8 +29,7 @@ ["[0]" list (.use "[1]#[0]" functor)]]] ["[0]" macro (.only) ["^" pattern] - ["[0]" syntax (.only syntax)] - ["[0]" code]] + ["[0]" syntax (.only syntax)]] [math ["[0]" random (.only Random)] [number @@ -43,6 +42,7 @@ ["[0]" duration ["[0]/[1]" \\test]]] ["[0]" meta (.only) + ["[0]" code] [type ["[0]" unit]]]]] ["[0]" \\polytypic] diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index ca4866bc4..04c67ac15 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -34,9 +34,7 @@ ["[1]" set] ["[1]/[0]" block]]]] [macro - ["^" pattern] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["^" pattern]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] ["[0]" modulus] @@ -50,7 +48,9 @@ [meta ["[0]" location] ["[0]" symbol] - ["[0]" type]] + ["[0]" type] + ["[0]" code (.only) + ["<[1]>" \\parser]]] ["[0]" time (.only) ["[0]" day] ["[0]" month] @@ -62,9 +62,8 @@ ["[1][0]" xml] ["[1][0]" json]] [// - [macro - ["[1][0]" code]] [meta + ["[1][0]" code] ["[1][0]" symbol] ["[1][0]" type]]]] ["[0]" / diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 86e2a645a..94808d95b 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" debug] - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -17,13 +16,14 @@ ["[0]" set (.only Set)]]] [macro [syntax (.only syntax)] - ["[0]" template] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["[0]" template]] [math ["[0]" random (.only Random)] [number (.only hex) - ["n" nat]]]]] + ["n" nat]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" / (.only) [// diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 5988210cd..4d480632b 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -12,12 +12,13 @@ ["%" \\format (.only format)] ["<[1]>" \\parser (.only Parser)]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math [number (.only hex)] - ["[0]" random]]]] + ["[0]" random]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index d85343bc9..245f5bdba 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -17,13 +17,14 @@ [json (.only JSON)] [xml (.only XML)]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math ["[0]" random (.only Random)] [number [ratio (.only Ratio)]]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser]]] [time (.only Time) [instant (.only Instant)] [date (.only Date)] @@ -37,12 +38,11 @@ [format ["[1][0]" json] ["[1][0]" xml]]] - [macro - ["[1][0]" code]] [math [number ["[1][0]" ratio]]] [meta + ["[1][0]" code] ["[1][0]" location] ["[1][0]" symbol] ["[1][0]" type]]]) diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index 8054dbbcc..bac10e185 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [control ["[0]" try] ["[0]" exception]] @@ -13,7 +12,8 @@ ["md" markdown]]] ["[0]" macro (.only) [syntax (.only syntax)] - ["[0]" template] + ["[0]" template]] + ["[0]" meta (.only) ["[0]" code (.only) ["<[1]>" \\parser]]]]] [\\library diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 4ee1757d0..27a8a4cc8 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -31,13 +31,14 @@ ["[0]" sequence] ["[0]" list (.use "[1]#[0]" functor)]]] [macro - ["[0]" template] - ["[0]" code - ["<[1]>" \\parser]]] + ["[0]" template]] [math ["[0]" random] [number ["n" nat]]] + [meta + ["[0]" code + ["<[1]>" \\parser]]] [tool [compiler ["[0]" phase] @@ -135,48 +136,48 @@ ... Declaration (declaration (..my_declaration self phase archive [expression .any]) - (do [! phase.monad] - [analysis_phase declaration.analysis - expressionA (<| declaration.lifted_analysis - (type.expecting .Any) - (analysis_phase archive expression)) - - synthesis_phase declaration.synthesis - expressionS (declaration.lifted_synthesis - (synthesis_phase archive expressionA)) - - generation_phase declaration.generation - expressionG (declaration.lifted_generation - (generation_phase archive expressionS)) - - _ (declaration.lifted_generation - (generation.with_new_context archive unit.none - (do ! - [[module_id artifact_id] (generation.context archive) - .let [commentary (format "Successfully installed declaration " (%.text self) "!")] - _ (generation.save! artifact_id {.#None} - (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] - (<| [$class] - (try.else (binary.empty 0)) - (try#each (binaryF.result class.format)) - (class.class version.v6_0 class.public - (name.internal $class) - {.#None} - (name.internal "java.lang.Object") - (list) - (list) - (list) - sequence.empty))) - @.js (js.comment commentary - (js.statement (js.string commentary))) - @.python (python.comment commentary - (python.statement (python.string commentary))) - @.lua (lua.comment commentary - (lua.statement expressionG)) - @.ruby (ruby.comment commentary - (ruby.statement (ruby.string commentary)))))] - (generation.log! commentary))))] - (in declaration.no_requirements))) + (do [! phase.monad] + [analysis_phase declaration.analysis + expressionA (<| declaration.lifted_analysis + (type.expecting .Any) + (analysis_phase archive expression)) + + synthesis_phase declaration.synthesis + expressionS (declaration.lifted_synthesis + (synthesis_phase archive expressionA)) + + generation_phase declaration.generation + expressionG (declaration.lifted_generation + (generation_phase archive expressionS)) + + _ (declaration.lifted_generation + (generation.with_new_context archive unit.none + (do ! + [[module_id artifact_id] (generation.context archive) + .let [commentary (format "Successfully installed declaration " (%.text self) "!")] + _ (generation.save! artifact_id {.#None} + (for @.jvm (let [$class (jvm/runtime.class_name [module_id artifact_id])] + (<| [$class] + (try.else (binary.empty 0)) + (try#each (binaryF.result class.format)) + (class.class version.v6_0 class.public + (name.internal $class) + {.#None} + (name.internal "java.lang.Object") + (list) + (list) + (list) + sequence.empty))) + @.js (js.comment commentary + (js.statement (js.string commentary))) + @.python (python.comment commentary + (python.statement (python.string commentary))) + @.lua (lua.comment commentary + (lua.statement expressionG)) + @.ruby (ruby.comment commentary + (ruby.statement (ruby.string commentary)))))] + (generation.log! commentary))))] + (in declaration.no_requirements))) (`` ((~~ (static ..my_declaration)) (n.* 2 3))) )) diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 13c9f2fcd..375de540a 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -19,9 +19,7 @@ ["[0]" array (.only Array)]]] ["[0]" macro (.only) [syntax (.only syntax)] - ["[0]" template] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["[0]" template]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number (.only hex) @@ -30,7 +28,9 @@ ["i" int (.use "[1]#[0]" equivalence)] ["f" frac (.use "[1]#[0]" equivalence)]]] ["[0]" meta (.only) - ["[0]" type (.use "[1]#[0]" equivalence)]] + ["[0]" type (.use "[1]#[0]" equivalence)] + ["[0]" code (.only) + ["<[1]>" \\parser]]] [target ["[0]" jvm ["[1]" type (.use "[1]#[0]" equivalence)]]]]] diff --git a/stdlib/source/test/lux/ffi/export.jvm.lux b/stdlib/source/test/lux/ffi/export.jvm.lux index b4e827e14..8ad59d6ed 100644 --- a/stdlib/source/test/lux/ffi/export.jvm.lux +++ b/stdlib/source/test/lux/ffi/export.jvm.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] ["[0]" debug] ["[0]" static] [abstract @@ -12,14 +11,15 @@ ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format]]] [macro - ["[0]" code] ["[0]" template]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number (.only hex) ["[0]" i64] ["[0]" int (.use "[1]#[0]" equivalence)] - ["[0]" frac (.use "[1]#[0]" equivalence)]]]]] + ["[0]" frac (.use "[1]#[0]" equivalence)]]] + ["[0]" meta (.only) + ["[0]" code]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 3f6e3fe92..555a47c03 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -21,15 +21,14 @@ ["n" nat]]] ["[0]" meta (.only) ["[0]" location] - ["[0]" symbol]]]] + ["[0]" symbol] + ["[0]" code (.use "[1]#[0]" equivalence) + ["<[1]>" \\parser]]]]] [\\library ["[0]" / (.only) [syntax (.only syntax)] - ["[0]" template] - ["[0]" code (.use "[1]#[0]" equivalence) - ["<[1]>" \\parser]]]] + ["[0]" template]]] ["[0]" / - ["[1][0]" code] ["[1][0]" local] ["[1][0]" syntax] ["[1][0]" template] @@ -243,7 +242,6 @@ ..test|expansion - /code.test /local.test /syntax.test /template.test diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux deleted file mode 100644 index a566b030d..000000000 --- a/stdlib/source/test/lux/macro/code.lux +++ /dev/null @@ -1,318 +0,0 @@ -(.require - [library - [lux (.except local global) - ["_" test (.only Test)] - [abstract - [monad (.only do)] - [\\specification - ["$[0]" equivalence]]] - [control - ["<>" parser] - ["[0]" function] - ["[0]" try (.only Try)]] - [data - ["[0]" bit] - ["[0]" product] - ["[0]" text] - [collection - ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["^" pattern]] - [math - ["[0]" random (.only Random) (.use "[1]#[0]" monad)] - [number - ["[0]" nat] - ["[0]" int] - ["[0]" rev] - ["[0]" frac]]] - [meta - ["[0]" symbol] - ["[0]" location]] - [tool - [compiler - [language - [lux - ["[0]" syntax]]]]]]] - ["[0]" \\parser] - [\\library - ["[0]" /]]) - -(def !expect - (template (_ ) - [(case - - true - - _ - false)])) - -(def local - (Random Text) - (random.lower_case 1)) - -(def global - (Random Symbol) - (all random.and - (random.lower_case 1) - (random.lower_case 1) - )) - -(def any_symbol - (Random Symbol) - (all random.either - (random#each (|>> [""]) - ..local) - ..global - )) - -(def \\parser - Test - (<| (_.covering \\parser._) - (_.for [\\parser.Parser]) - (`` (all _.and - (do [! random.monad] - [expected (at ! each /.bit random.bit)] - (_.coverage [\\parser.result] - (and (|> (\\parser.result \\parser.any (list expected)) - (!expect {try.#Success _})) - (|> (\\parser.result \\parser.any (list)) - (!expect {try.#Failure _}))))) - (~~ (with_template [ ] - [(do [! random.monad] - [expected - dummy (|> (random.only (|>> (at = expected) not)))] - (all _.and - (_.coverage [] - (|> (\\parser.result (list ( expected))) - (!expect (^.multi {try.#Success actual} - (at = expected actual))))) - (_.coverage [] - (and (|> (\\parser.result ( expected) (list ( expected))) - (!expect {try.#Success []})) - (|> (\\parser.result ( expected) (list ( dummy))) - (!expect {try.#Failure _})))) - ))] - - [\\parser.any \\parser.this (at ! each /.bit random.bit) function.identity /.equivalence] - [\\parser.bit \\parser.this_bit random.bit /.bit bit.equivalence] - [\\parser.nat \\parser.this_nat random.nat /.nat nat.equivalence] - [\\parser.int \\parser.this_int random.int /.int int.equivalence] - [\\parser.rev \\parser.this_rev random.rev /.rev rev.equivalence] - [\\parser.frac \\parser.this_frac random.safe_frac /.frac frac.equivalence] - [\\parser.text \\parser.this_text (random.unicode 1) /.text text.equivalence] - [\\parser.local \\parser.this_local ..local /.local text.equivalence] - [\\parser.global \\parser.this_global ..global /.symbol symbol.equivalence] - [\\parser.symbol \\parser.this_symbol ..any_symbol /.symbol symbol.equivalence] - )) - (~~ (with_template [ ] - [(do [! random.monad] - [expected_left random.nat - expected_right random.int] - (_.coverage [] - (|> (\\parser.result ( (<>.and \\parser.nat \\parser.int)) - (list ( (list (/.nat expected_left) - (/.int expected_right))))) - (!expect (^.multi {try.#Success [actual_left actual_right]} - (and (at nat.equivalence = expected_left actual_left) - (at int.equivalence = expected_right actual_right)))))))] - - [\\parser.form /.form] - [\\parser.variant /.variant] - [\\parser.tuple /.tuple] - )) - (do [! random.monad] - [expected_local random.nat - expected_global random.int] - (_.coverage [\\parser.locally] - (|> (\\parser.result (<>.and (\\parser.locally (list (/.nat expected_local)) \\parser.nat) - \\parser.int) - (list (/.int expected_global))) - (!expect (^.multi {try.#Success [actual_local actual_global]} - (and (at nat.equivalence = expected_local actual_local) - (at int.equivalence = expected_global actual_global))))))) - (do [! random.monad] - [dummy (at ! each /.bit random.bit)] - (_.coverage [\\parser.end?] - (|> (\\parser.result (do <>.monad - [pre \\parser.end? - _ \\parser.any - post \\parser.end?] - (in (and (not pre) - post))) - (list dummy)) - (!expect (^.multi {try.#Success verdict} - verdict))))) - (do [! random.monad] - [dummy (at ! each /.bit random.bit)] - (_.coverage [\\parser.end] - (and (|> (\\parser.result \\parser.end (list)) - (!expect {try.#Success []})) - (|> (\\parser.result \\parser.end (list dummy)) - (!expect {try.#Failure _}))))) - (do [! random.monad] - [expected (at ! each /.bit random.bit)] - (_.coverage [\\parser.next] - (|> (\\parser.result (do <>.monad - [pre \\parser.next - post \\parser.any] - (in (and (same? expected pre) - (same? pre post)))) - (list expected)) - (!expect {try.#Success _})))) - (do [! random.monad] - [expected (at ! each /.bit random.bit)] - (_.coverage [\\parser.not] - (and (|> (\\parser.result (\\parser.not \\parser.nat) (list expected)) - (!expect (^.multi {try.#Success actual} - (same? expected actual)))) - (|> (\\parser.result (\\parser.not \\parser.bit) (list expected)) - (!expect {try.#Failure _}))))) - )))) - -(def random_text - (Random Text) - (random.alphabetic 10)) - -(def random_symbol - (Random Symbol) - (random.and ..random_text ..random_text)) - -(def (random_sequence random) - (All (_ a) (-> (Random a) (Random (List a)))) - (do [! random.monad] - [size (|> random.nat (at ! each (nat.% 3)))] - (random.list size random))) - -(def .public random - (Random Code) - (random.rec - (function (_ random) - (all random.either - (random#each /.bit random.bit) - (random#each /.nat random.nat) - (random#each /.int random.int) - (random#each /.rev random.rev) - (random#each /.frac random.safe_frac) - (random#each /.text ..random_text) - (random#each /.symbol ..random_symbol) - (random#each /.form (..random_sequence random)) - (random#each /.variant (..random_sequence random)) - (random#each /.tuple (..random_sequence random)) - )))) - -(def (read source_code) - (-> Text (Try Code)) - (let [parse (syntax.parse "" - syntax.no_aliases - (text.size source_code)) - start (is Source - [location.dummy 0 source_code])] - (case (parse start) - {.#Left [end error]} - {try.#Failure error} - - {.#Right [end lux_code]} - {try.#Success lux_code}))) - -(def (replacement_simulation [original substitute]) - (-> [Code Code] (Random [Code Code])) - (random.rec - (function (_ replacement_simulation) - (let [for_sequence (is (-> (-> (List Code) Code) (Random [Code Code])) - (function (_ to_code) - (random.only (|>> product.left (at /.equivalence = original) not) - (do [! random.monad] - [parts (..random_sequence replacement_simulation)] - (in [(to_code (list#each product.left parts)) - (to_code (list#each product.right parts))])))))] - (all random.either - (random#in [original substitute]) - (do [! random.monad] - [sample (random.only (|>> (at /.equivalence = original) not) - (all random.either - (random#each /.bit random.bit) - (random#each /.nat random.nat) - (random#each /.int random.int) - (random#each /.rev random.rev) - (random#each /.frac random.safe_frac) - (random#each /.text ..random_text) - (random#each /.symbol ..random_symbol)))] - (in [sample sample])) - (for_sequence /.form) - (for_sequence /.variant) - (for_sequence /.tuple) - ))))) - -(def for_format - Test - (`` (all _.and - (~~ (with_template [ ] - [(do [! random.monad] - [expected ] - (_.coverage [] - (and (case (..read (/.format ( expected))) - {try.#Success actual} - (at /.equivalence = - actual - ( expected)) - - {try.#Failure error} - false) - (at /.equivalence = - [location.dummy { expected}] - ( expected)))))] - - [/.bit random.bit .#Bit] - [/.nat random.nat .#Nat] - [/.int random.int .#Int] - [/.rev random.rev .#Rev] - [/.frac random.safe_frac .#Frac] - [/.text ..random_text .#Text] - [/.symbol ..random_symbol .#Symbol] - [/.form (..random_sequence ..random) .#Form] - [/.variant (..random_sequence ..random) .#Variant] - [/.tuple (..random_sequence ..random) .#Tuple])) - (~~ (with_template [ ] - [(do [! random.monad] - [expected ] - (_.coverage [] - (and (case (..read (/.format ( expected))) - {try.#Success actual} - (at /.equivalence = - actual - ( expected)) - - {try.#Failure error} - false) - (at /.equivalence = - [location.dummy { ["" expected]}] - ( expected))) - ))] - - [/.local ..random_text .#Symbol] - ))))) - -(def .public test - Test - (<| (_.covering /._) - (all _.and - (_.for [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - - (_.for [/.format] - ..for_format) - - (do [! random.monad] - [[original substitute] (random.only (function (_ [original substitute]) - (not (at /.equivalence = original substitute))) - (random.and ..random ..random)) - [sample expected] (random.only (function (_ [sample expected]) - (not (at /.equivalence = sample expected))) - (..replacement_simulation [original substitute]))] - (_.coverage [/.replaced] - (at /.equivalence = - expected - (/.replaced original substitute sample)))) - - ..\\parser - ))) diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index 74d66e29c..eb904eed8 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -2,7 +2,6 @@ [library [lux (.except with) ["_" test (.only Test)] - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -16,13 +15,14 @@ ["[0]" list ["[0]" property]]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math ["[0]" random (.only Random)] [number - ["n" nat]]]]] + ["n" nat]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/macro/pattern.lux b/stdlib/source/test/lux/macro/pattern.lux index 8ebdf71db..7b9e161c1 100644 --- a/stdlib/source/test/lux/macro/pattern.lux +++ b/stdlib/source/test/lux/macro/pattern.lux @@ -6,14 +6,14 @@ [monad (.only do)]] [data ["[0]" bit (.use "[1]#[0]" equivalence)]] - [macro - ["[0]" code]] [math ["[0]" random (.only Random)] [number ["n" nat] ["i" int] - ["f" frac]]]]] + ["f" frac]]] + [meta + ["[0]" code]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/macro/syntax.lux b/stdlib/source/test/lux/macro/syntax.lux index c973ed03c..84304452c 100644 --- a/stdlib/source/test/lux/macro/syntax.lux +++ b/stdlib/source/test/lux/macro/syntax.lux @@ -7,12 +7,12 @@ [math ["[0]" random] [number - ["n" nat]]]]] - [\\library - ["[0]" / (.only) - [// + ["n" nat]]] + [meta ["[0]" code ["<[1]>" \\parser]]]]] + [\\library + ["[0]" /]] ["[0]" / ["[1][0]" check] ["[1][0]" declaration] diff --git a/stdlib/source/test/lux/macro/syntax/check.lux b/stdlib/source/test/lux/macro/syntax/check.lux index b8e3aa34b..11fa981e6 100644 --- a/stdlib/source/test/lux/macro/syntax/check.lux +++ b/stdlib/source/test/lux/macro/syntax/check.lux @@ -11,19 +11,20 @@ ["[0]" try]] [math ["[0]" random (.only Random)]] - [macro + [meta ["[0]" code (.use "[1]#[0]" equivalence) ["<[1]>" \\parser]]]]] [\\library ["[0]" /]] - ["$[0]" /// - ["[1][0]" code]]) + ["$[0]" //// + [meta + ["[1][0]" code]]]) (def .public random (Random /.Check) (all random.and - $///code.random - $///code.random + $////code.random + $////code.random )) (def .public test diff --git a/stdlib/source/test/lux/macro/syntax/declaration.lux b/stdlib/source/test/lux/macro/syntax/declaration.lux index b6c571170..d111576fc 100644 --- a/stdlib/source/test/lux/macro/syntax/declaration.lux +++ b/stdlib/source/test/lux/macro/syntax/declaration.lux @@ -14,9 +14,10 @@ ["n" nat]]]]] [\\library ["[0]" / (.only) - [/// - ["[0]" code - ["<[1]>" \\parser]]]]]) + [//// + [meta + ["[0]" code + ["<[1]>" \\parser]]]]]]) (def .public random (Random /.Declaration) diff --git a/stdlib/source/test/lux/macro/syntax/definition.lux b/stdlib/source/test/lux/macro/syntax/definition.lux index eab4879a0..0ebf14286 100644 --- a/stdlib/source/test/lux/macro/syntax/definition.lux +++ b/stdlib/source/test/lux/macro/syntax/definition.lux @@ -10,26 +10,26 @@ ["<>" parser] ["[0]" try] ["[0]" exception]] - [macro - ["[0]" code (.use "[1]#[0]" equivalence) - ["<[1]>" \\parser]]] [math ["[0]" random (.only Random)]] [meta - ["[0]" location]]]] + ["[0]" location] + ["[0]" code (.use "[1]#[0]" equivalence) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]] ["$[0]"// ["[1][0]" check] - ["[1]/" // - ["[1][0]" code]]]) + ["[1]//" /// + [meta + ["[1][0]" code]]]]) (def .public random (Random /.Definition) (all random.and (random.alphabetic 5) (random.or $//check.random - $///code.random) + $////code.random) random.bit )) @@ -64,8 +64,8 @@ (do random.monad [expected ..random - type $///code.random - untyped_value $///code.random] + type $////code.random + untyped_value $////code.random] (all _.and (_.coverage [/.format /.parser] (case (.result (/.parser compiler) diff --git a/stdlib/source/test/lux/macro/syntax/export.lux b/stdlib/source/test/lux/macro/syntax/export.lux index 3ef76a0bb..bace31485 100644 --- a/stdlib/source/test/lux/macro/syntax/export.lux +++ b/stdlib/source/test/lux/macro/syntax/export.lux @@ -7,13 +7,13 @@ [control ["[0]" maybe] ["[0]" try (.use "[1]#[0]" functor)]] - [macro - ["[0]" code (.use "[1]#[0]" equivalence) - ["<[1]>" \\parser]]] [math ["[0]" random (.only Random)] [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" code (.use "[1]#[0]" equivalence) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/macro/syntax/input.lux b/stdlib/source/test/lux/macro/syntax/input.lux index 7768f7c6b..2294518a9 100644 --- a/stdlib/source/test/lux/macro/syntax/input.lux +++ b/stdlib/source/test/lux/macro/syntax/input.lux @@ -14,20 +14,21 @@ [math ["[0]" random (.only Random)] [number - ["n" nat]]]]] - [\\library - ["[0]" / (.only) - [/// + ["n" nat]]] + [meta ["[0]" code ["<[1]>" \\parser]]]]] - ["$[0]" /// - ["[1][0]" code]]) + [\\library + ["[0]" /]] + ["$[0]" //// + [meta + ["[1][0]" code]]]) (def .public random (Random /.Input) (all random.and - $///code.random - $///code.random + $////code.random + $////code.random )) (def .public test diff --git a/stdlib/source/test/lux/macro/syntax/type/variable.lux b/stdlib/source/test/lux/macro/syntax/type/variable.lux index 1970a6ef8..d0c249716 100644 --- a/stdlib/source/test/lux/macro/syntax/type/variable.lux +++ b/stdlib/source/test/lux/macro/syntax/type/variable.lux @@ -12,9 +12,10 @@ ["[0]" random (.only Random)]]]] [\\library ["[0]" / (.only) - [//// - ["[0]" code - ["<[1]>" \\parser]]]]]) + [///// + [meta + ["[0]" code + ["<[1]>" \\parser]]]]]]) (def .public random (Random /.Variable) diff --git a/stdlib/source/test/lux/macro/template.lux b/stdlib/source/test/lux/macro/template.lux index 4c48e5561..d279edfeb 100644 --- a/stdlib/source/test/lux/macro/template.lux +++ b/stdlib/source/test/lux/macro/template.lux @@ -11,13 +11,14 @@ [collection ["[0]" list]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math ["[0]" random (.only Random)] [number - ["[0]" nat]]]]] + ["[0]" nat]]] + [meta + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/math/modulus.lux b/stdlib/source/test/lux/math/modulus.lux index 5109bb34b..98c4480d2 100644 --- a/stdlib/source/test/lux/math/modulus.lux +++ b/stdlib/source/test/lux/math/modulus.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -13,7 +12,8 @@ [number ["i" int]]] [macro - [syntax (.only syntax)] + [syntax (.only syntax)]] + ["[0]" meta (.only) ["[0]" code]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index e5166d7ee..2c2943c19 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -33,6 +33,7 @@ ["[0]" / (.only) ["[0]" type (.use "[1]#[0]" equivalence)]]] ["[0]" / + ["[1][0]" code] ["[1][0]" location] ["[1][0]" symbol] ["[1][0]" configuration] @@ -1017,6 +1018,7 @@ ..label_related) )) + /code.test /location.test /symbol.test /configuration.test diff --git a/stdlib/source/test/lux/meta/code.lux b/stdlib/source/test/lux/meta/code.lux new file mode 100644 index 000000000..a566b030d --- /dev/null +++ b/stdlib/source/test/lux/meta/code.lux @@ -0,0 +1,318 @@ +(.require + [library + [lux (.except local global) + ["_" test (.only Test)] + [abstract + [monad (.only do)] + [\\specification + ["$[0]" equivalence]]] + [control + ["<>" parser] + ["[0]" function] + ["[0]" try (.only Try)]] + [data + ["[0]" bit] + ["[0]" product] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" functor)]]] + [macro + ["^" pattern]] + [math + ["[0]" random (.only Random) (.use "[1]#[0]" monad)] + [number + ["[0]" nat] + ["[0]" int] + ["[0]" rev] + ["[0]" frac]]] + [meta + ["[0]" symbol] + ["[0]" location]] + [tool + [compiler + [language + [lux + ["[0]" syntax]]]]]]] + ["[0]" \\parser] + [\\library + ["[0]" /]]) + +(def !expect + (template (_ ) + [(case + + true + + _ + false)])) + +(def local + (Random Text) + (random.lower_case 1)) + +(def global + (Random Symbol) + (all random.and + (random.lower_case 1) + (random.lower_case 1) + )) + +(def any_symbol + (Random Symbol) + (all random.either + (random#each (|>> [""]) + ..local) + ..global + )) + +(def \\parser + Test + (<| (_.covering \\parser._) + (_.for [\\parser.Parser]) + (`` (all _.and + (do [! random.monad] + [expected (at ! each /.bit random.bit)] + (_.coverage [\\parser.result] + (and (|> (\\parser.result \\parser.any (list expected)) + (!expect {try.#Success _})) + (|> (\\parser.result \\parser.any (list)) + (!expect {try.#Failure _}))))) + (~~ (with_template [ ] + [(do [! random.monad] + [expected + dummy (|> (random.only (|>> (at = expected) not)))] + (all _.and + (_.coverage [] + (|> (\\parser.result (list ( expected))) + (!expect (^.multi {try.#Success actual} + (at = expected actual))))) + (_.coverage [] + (and (|> (\\parser.result ( expected) (list ( expected))) + (!expect {try.#Success []})) + (|> (\\parser.result ( expected) (list ( dummy))) + (!expect {try.#Failure _})))) + ))] + + [\\parser.any \\parser.this (at ! each /.bit random.bit) function.identity /.equivalence] + [\\parser.bit \\parser.this_bit random.bit /.bit bit.equivalence] + [\\parser.nat \\parser.this_nat random.nat /.nat nat.equivalence] + [\\parser.int \\parser.this_int random.int /.int int.equivalence] + [\\parser.rev \\parser.this_rev random.rev /.rev rev.equivalence] + [\\parser.frac \\parser.this_frac random.safe_frac /.frac frac.equivalence] + [\\parser.text \\parser.this_text (random.unicode 1) /.text text.equivalence] + [\\parser.local \\parser.this_local ..local /.local text.equivalence] + [\\parser.global \\parser.this_global ..global /.symbol symbol.equivalence] + [\\parser.symbol \\parser.this_symbol ..any_symbol /.symbol symbol.equivalence] + )) + (~~ (with_template [ ] + [(do [! random.monad] + [expected_left random.nat + expected_right random.int] + (_.coverage [] + (|> (\\parser.result ( (<>.and \\parser.nat \\parser.int)) + (list ( (list (/.nat expected_left) + (/.int expected_right))))) + (!expect (^.multi {try.#Success [actual_left actual_right]} + (and (at nat.equivalence = expected_left actual_left) + (at int.equivalence = expected_right actual_right)))))))] + + [\\parser.form /.form] + [\\parser.variant /.variant] + [\\parser.tuple /.tuple] + )) + (do [! random.monad] + [expected_local random.nat + expected_global random.int] + (_.coverage [\\parser.locally] + (|> (\\parser.result (<>.and (\\parser.locally (list (/.nat expected_local)) \\parser.nat) + \\parser.int) + (list (/.int expected_global))) + (!expect (^.multi {try.#Success [actual_local actual_global]} + (and (at nat.equivalence = expected_local actual_local) + (at int.equivalence = expected_global actual_global))))))) + (do [! random.monad] + [dummy (at ! each /.bit random.bit)] + (_.coverage [\\parser.end?] + (|> (\\parser.result (do <>.monad + [pre \\parser.end? + _ \\parser.any + post \\parser.end?] + (in (and (not pre) + post))) + (list dummy)) + (!expect (^.multi {try.#Success verdict} + verdict))))) + (do [! random.monad] + [dummy (at ! each /.bit random.bit)] + (_.coverage [\\parser.end] + (and (|> (\\parser.result \\parser.end (list)) + (!expect {try.#Success []})) + (|> (\\parser.result \\parser.end (list dummy)) + (!expect {try.#Failure _}))))) + (do [! random.monad] + [expected (at ! each /.bit random.bit)] + (_.coverage [\\parser.next] + (|> (\\parser.result (do <>.monad + [pre \\parser.next + post \\parser.any] + (in (and (same? expected pre) + (same? pre post)))) + (list expected)) + (!expect {try.#Success _})))) + (do [! random.monad] + [expected (at ! each /.bit random.bit)] + (_.coverage [\\parser.not] + (and (|> (\\parser.result (\\parser.not \\parser.nat) (list expected)) + (!expect (^.multi {try.#Success actual} + (same? expected actual)))) + (|> (\\parser.result (\\parser.not \\parser.bit) (list expected)) + (!expect {try.#Failure _}))))) + )))) + +(def random_text + (Random Text) + (random.alphabetic 10)) + +(def random_symbol + (Random Symbol) + (random.and ..random_text ..random_text)) + +(def (random_sequence random) + (All (_ a) (-> (Random a) (Random (List a)))) + (do [! random.monad] + [size (|> random.nat (at ! each (nat.% 3)))] + (random.list size random))) + +(def .public random + (Random Code) + (random.rec + (function (_ random) + (all random.either + (random#each /.bit random.bit) + (random#each /.nat random.nat) + (random#each /.int random.int) + (random#each /.rev random.rev) + (random#each /.frac random.safe_frac) + (random#each /.text ..random_text) + (random#each /.symbol ..random_symbol) + (random#each /.form (..random_sequence random)) + (random#each /.variant (..random_sequence random)) + (random#each /.tuple (..random_sequence random)) + )))) + +(def (read source_code) + (-> Text (Try Code)) + (let [parse (syntax.parse "" + syntax.no_aliases + (text.size source_code)) + start (is Source + [location.dummy 0 source_code])] + (case (parse start) + {.#Left [end error]} + {try.#Failure error} + + {.#Right [end lux_code]} + {try.#Success lux_code}))) + +(def (replacement_simulation [original substitute]) + (-> [Code Code] (Random [Code Code])) + (random.rec + (function (_ replacement_simulation) + (let [for_sequence (is (-> (-> (List Code) Code) (Random [Code Code])) + (function (_ to_code) + (random.only (|>> product.left (at /.equivalence = original) not) + (do [! random.monad] + [parts (..random_sequence replacement_simulation)] + (in [(to_code (list#each product.left parts)) + (to_code (list#each product.right parts))])))))] + (all random.either + (random#in [original substitute]) + (do [! random.monad] + [sample (random.only (|>> (at /.equivalence = original) not) + (all random.either + (random#each /.bit random.bit) + (random#each /.nat random.nat) + (random#each /.int random.int) + (random#each /.rev random.rev) + (random#each /.frac random.safe_frac) + (random#each /.text ..random_text) + (random#each /.symbol ..random_symbol)))] + (in [sample sample])) + (for_sequence /.form) + (for_sequence /.variant) + (for_sequence /.tuple) + ))))) + +(def for_format + Test + (`` (all _.and + (~~ (with_template [ ] + [(do [! random.monad] + [expected ] + (_.coverage [] + (and (case (..read (/.format ( expected))) + {try.#Success actual} + (at /.equivalence = + actual + ( expected)) + + {try.#Failure error} + false) + (at /.equivalence = + [location.dummy { expected}] + ( expected)))))] + + [/.bit random.bit .#Bit] + [/.nat random.nat .#Nat] + [/.int random.int .#Int] + [/.rev random.rev .#Rev] + [/.frac random.safe_frac .#Frac] + [/.text ..random_text .#Text] + [/.symbol ..random_symbol .#Symbol] + [/.form (..random_sequence ..random) .#Form] + [/.variant (..random_sequence ..random) .#Variant] + [/.tuple (..random_sequence ..random) .#Tuple])) + (~~ (with_template [ ] + [(do [! random.monad] + [expected ] + (_.coverage [] + (and (case (..read (/.format ( expected))) + {try.#Success actual} + (at /.equivalence = + actual + ( expected)) + + {try.#Failure error} + false) + (at /.equivalence = + [location.dummy { ["" expected]}] + ( expected))) + ))] + + [/.local ..random_text .#Symbol] + ))))) + +(def .public test + Test + (<| (_.covering /._) + (all _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + + (_.for [/.format] + ..for_format) + + (do [! random.monad] + [[original substitute] (random.only (function (_ [original substitute]) + (not (at /.equivalence = original substitute))) + (random.and ..random ..random)) + [sample expected] (random.only (function (_ [sample expected]) + (not (at /.equivalence = sample expected))) + (..replacement_simulation [original substitute]))] + (_.coverage [/.replaced] + (at /.equivalence = + expected + (/.replaced original substitute sample)))) + + ..\\parser + ))) diff --git a/stdlib/source/test/lux/meta/configuration.lux b/stdlib/source/test/lux/meta/configuration.lux index e1a546d82..141d7ed96 100644 --- a/stdlib/source/test/lux/meta/configuration.lux +++ b/stdlib/source/test/lux/meta/configuration.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract [monad (.only do)] [\\specification @@ -18,11 +17,12 @@ [collection ["[0]" list]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math - ["[0]" random (.only Random) (.use "[1]#[0]" monad)]]]] + ["[0]" random (.only Random) (.use "[1]#[0]" monad)]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/meta/location.lux b/stdlib/source/test/lux/meta/location.lux index de92d9eac..d87af185b 100644 --- a/stdlib/source/test/lux/meta/location.lux +++ b/stdlib/source/test/lux/meta/location.lux @@ -12,9 +12,8 @@ ["[0]" random (.only Random)]]]] [\\library ["[0]" /]] - ["$[0]" /// - [macro - ["[1][0]" code]]]) + ["$[0]" // + ["[1][0]" code]]) (def .public random (Random Location) @@ -44,7 +43,7 @@ (text.contains? error located_error))))) (do random.monad - [[location _] $///code.random] + [[location _] $//code.random] (_.coverage [/.dummy] (at /.equivalence = /.dummy location))) ))) diff --git a/stdlib/source/test/lux/meta/type.lux b/stdlib/source/test/lux/meta/type.lux index 9f753b1d0..59ca03061 100644 --- a/stdlib/source/test/lux/meta/type.lux +++ b/stdlib/source/test/lux/meta/type.lux @@ -20,14 +20,14 @@ ["[0]" list] ["[0]" array]]] [macro - ["^" pattern] - ["[0]" code (.use "[1]#[0]" equivalence)]] + ["^" pattern]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat]]] [meta - ["[0]" symbol (.use "[1]#[0]" equivalence)]]]] + ["[0]" symbol (.use "[1]#[0]" equivalence)] + ["[0]" code (.use "[1]#[0]" equivalence)]]]] ["[0]" \\parser] [\\library ["[0]" / (.use "[1]#[0]" equivalence)]] diff --git a/stdlib/source/test/lux/meta/type/primitive.lux b/stdlib/source/test/lux/meta/type/primitive.lux index 7b4500c00..8766f07c2 100644 --- a/stdlib/source/test/lux/meta/type/primitive.lux +++ b/stdlib/source/test/lux/meta/type/primitive.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -12,13 +11,14 @@ ["[0]" text (.use "[1]#[0]" equivalence)]] ["[0]" macro (.only) [syntax (.only syntax)] - ["[0]" template] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + ["[0]" template]] ["[0]" math (.only) ["[0]" random] [number - ["n" nat]]]]] + ["n" nat]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/meta/type/resource.lux b/stdlib/source/test/lux/meta/type/resource.lux index a23f1cacf..f7d04d659 100644 --- a/stdlib/source/test/lux/meta/type/resource.lux +++ b/stdlib/source/test/lux/meta/type/resource.lux @@ -2,7 +2,6 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract ["[0]" monad (.only) [indexed (.only do)]]] @@ -17,11 +16,12 @@ ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math - ["[0]" random]]]] + ["[0]" random]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" / (.only Res)]]) diff --git a/stdlib/source/test/lux/meta/type/unit/scale.lux b/stdlib/source/test/lux/meta/type/unit/scale.lux index adc3523b5..0c305912b 100644 --- a/stdlib/source/test/lux/meta/type/unit/scale.lux +++ b/stdlib/source/test/lux/meta/type/unit/scale.lux @@ -2,18 +2,18 @@ [library [lux (.except) ["_" test (.only Test)] - ["[0]" meta] [abstract [monad (.only do)] [equivalence (.only Equivalence)]] [macro - [syntax (.only syntax)] - ["[0]" code]] + [syntax (.only syntax)]] [math ["[0]" random (.only Random)] [number ["i" int] - ["[0]" ratio (.use "[1]#[0]" equivalence)]]]]] + ["[0]" ratio (.use "[1]#[0]" equivalence)]]] + ["[0]" meta (.only) + ["[0]" code]]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/meta/version.lux b/stdlib/source/test/lux/meta/version.lux index ff70f25a0..e225265da 100644 --- a/stdlib/source/test/lux/meta/version.lux +++ b/stdlib/source/test/lux/meta/version.lux @@ -3,7 +3,6 @@ [lux (.except) ["_" test (.only Test)] ["[0]" static] - ["[0]" meta] [abstract [monad (.only do)]] [control @@ -12,13 +11,14 @@ [data ["[0]" text]] ["[0]" macro (.only) - [syntax (.only syntax)] - ["[0]" code (.only) - ["<[1]>" \\parser]]] + [syntax (.only syntax)]] [math ["[0]" random] [number - ["n" nat]]]]] + ["n" nat]]] + ["[0]" meta (.only) + ["[0]" code (.only) + ["<[1]>" \\parser]]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/program.lux b/stdlib/source/test/lux/program.lux index 8d534dd6e..cedad66d5 100644 --- a/stdlib/source/test/lux/program.lux +++ b/stdlib/source/test/lux/program.lux @@ -14,13 +14,14 @@ ["[0]" list]]] [macro [syntax (.only syntax)] - ["^" pattern] - ["[0]" code - ["<[1]>" \\parser]]] + ["^" pattern]] [math ["[0]" random] [number - ["n" nat (.use "[1]#[0]" decimal)]]]]] + ["n" nat (.use "[1]#[0]" decimal)]]] + [meta + ["[0]" code + ["<[1]>" \\parser]]]]] ["[0]" \\parser] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/static.lux b/stdlib/source/test/lux/static.lux index 95896cb7c..5748958f4 100644 --- a/stdlib/source/test/lux/static.lux +++ b/stdlib/source/test/lux/static.lux @@ -3,21 +3,20 @@ [lux (.except) ["_" test (.only Test)] ["@" target] - ["[0]" meta] [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" mix)]]] - [macro - ["[0]" code]] [math ["[0]" random (.use "[1]#[0]" functor)] [number ["n" nat] ["i" int] ["r" rev] - ["f" frac]]]]] + ["f" frac]]] + ["[0]" meta (.only) + ["[0]" code]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index fd972f3e0..afda8957c 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -1,8 +1,9 @@ (.require [library [lux (.except Type Primitive Label int) - ["[0]" ffi (.only import)] + ["_" test (.only Test)] ["@" target] + ["[0]" ffi (.only import)] [abstract ["[0]" monad (.only do)]] [control @@ -31,8 +32,7 @@ ["i" int] ["f" frac] ["[0]" i32 (.only I32)] - ["[0]" i64]]] - ["_" test (.only Test)]]] + ["[0]" i64]]]]] [\\library ["[0]" / ["[1][0]" loader (.only Library)] diff --git a/stdlib/source/test/lux/target/python.lux b/stdlib/source/test/lux/target/python.lux index 7fa88daf7..8e3fb3472 100644 --- a/stdlib/source/test/lux/target/python.lux +++ b/stdlib/source/test/lux/target/python.lux @@ -20,15 +20,15 @@ ["%" \\format (.only format)]] [collection ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["[0]" code]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat] ["i" int] ["f" frac] - ["[0]" i64]]]]] + ["[0]" i64]]] + [meta + ["[0]" code]]]] [\\library ["[0]" / (.use "[1]#[0]" equivalence)]]) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux index 987a00507..7387ce1bc 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/inference.lux @@ -2,6 +2,7 @@ [library [lux (.except) ["_" test (.only Test)] + ["[0]" macro] [abstract [monad (.only do)]] [control @@ -14,13 +15,12 @@ ["[0]" text] [collection ["[0]" list (.use "[1]#[0]" monad)]]] - ["[0]" macro (.only) - ["[0]" code]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat]]] [meta + ["[0]" code] ["[0]" symbol ["$[1]" \\test]] ["[0]" configuration diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux index 0563892be..5a830ba38 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/macro.lux @@ -2,6 +2,7 @@ [library [lux (.except) ["_" test (.only Test)] + ["[0]" macro] [abstract [monad (.only do)] [\\specification @@ -16,20 +17,18 @@ ["[0]" text (.use "[1]#[0]" equivalence)] [collection ["[0]" list (.use "[1]#[0]" monad)]]] - ["[0]" macro (.only) - ["[0]" code (.use "[1]#[0]" equivalence)]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat]]] ["[0]" meta (.only) + ["[0]" code (.use "[1]#[0]" equivalence)] ["[0]" configuration ["$[1]" \\test]]]]] ["$" /////// - [macro - ["[1][0]" code]] [meta - ["[1][0]" symbol]]] + ["[1][0]" symbol] + ["[1][0]" code]]] [\\library ["[0]" / (.only) ["/[1]" //]]]) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux index 3c0823345..0c68a9690 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis.lux @@ -2,6 +2,7 @@ [library [lux (.except) ["_" test (.only Test)] + ["[0]" macro] [abstract [monad (.only do)]] [control @@ -12,13 +13,12 @@ ["[0]" text] [collection ["[0]" list]]] - ["[0]" macro (.only) - ["[0]" code]] [math ["[0]" random] [number ["n" nat]]] [meta + ["[0]" code] ["[0]" type (.use "[1]#[0]" equivalence) ["[0]" check]]]]] [\\library diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux index e5254f4b4..35da92ea5 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -2,6 +2,7 @@ [library [lux (.except) ["_" test (.only Test)] + ["[0]" macro] [abstract [monad (.only do)]] [control @@ -11,11 +12,10 @@ ["[0]" product] ["[0]" text (.only) ["%" \\format]]] - ["[0]" macro (.only) - ["[0]" code]] [math ["[0]" random]] [meta + ["[0]" code] ["[0]" type (.use "[1]#[0]" equivalence) ["[0]" check]]]]] [\\library diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux index 31e3355f2..29da6a3cd 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/complex.lux @@ -18,14 +18,14 @@ ["[0]" list (.use "[1]#[0]" monad monoid)] ["[0]" set]]] ["[0]" macro (.only) - ["^" pattern] - ["[0]" code]] + ["^" pattern]] [math ["[0]" random (.only Random) (.use "[1]#[0]" monad)] [number ["n" nat] ["f" frac]]] [meta + ["[0]" code] ["[0]" symbol (.only) ["$[1]" \\test]] ["[0]" configuration diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux index 1a865d0d6..421c41900 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -2,6 +2,7 @@ [library [lux (.except) ["_" test (.only Test)] + ["[0]" macro] [abstract [monad (.only do)]] [control @@ -14,13 +15,12 @@ ["%" \\format]] [collection ["[0]" list]]] - ["[0]" macro (.only) - ["[0]" code]] [math ["[0]" random] [number ["n" nat]]] [meta + ["[0]" code] ["[0]" symbol ["$[1]" \\test]] ["[0]" type (.use "[1]#[0]" equivalence) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index 7507a6da6..a3b9b281d 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -14,9 +14,8 @@ ["[0]" atom]]] [data ["[0]" product]] - [macro - ["[0]" code]] [meta + ["[0]" code] ["[0]" symbol] ["[0]" type (.use "[1]#[0]" equivalence)]]] [//// diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux index 52e957f9c..98b9a71fd 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux @@ -16,9 +16,8 @@ [collection ["[0]" list] ["[0]" dictionary (.only Dictionary)]]] - [macro - ["[0]" code]] [meta + ["[0]" code] ["[0]" location] ["[0]" symbol]]] [\\ -- cgit v1.2.3