aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/meta/compiler
diff options
context:
space:
mode:
authorEduardo Julian2023-02-12 02:54:39 -0400
committerEduardo Julian2023-02-12 02:54:39 -0400
commit049dcdc0c6dc678786dbf854a20385fb6ef06f9a (patch)
tree65188f9d0858116d20051930705aa73b66d2aaa5 /stdlib/source/test/lux/meta/compiler
parent6c4c9a8c10950e3244f15451fe18fb768abee924 (diff)
Added an abstraction for interest rates.
Diffstat (limited to 'stdlib/source/test/lux/meta/compiler')
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux38
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux16
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux26
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/function.lux8
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/when.lux10
-rw-r--r--stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux6
-rw-r--r--stdlib/source/test/lux/meta/compiler/meta/cli/compiler.lux3
7 files changed, 54 insertions, 53 deletions
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux
index 87b6530d3..b9749422b 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis/inference.lux
@@ -134,7 +134,7 @@
analysis/*))))
(try.else false))
(|> (/.general archive.empty ..analysis
- (type_literal (-> type/0 expected))
+ (type.literal (-> type/0 expected))
(list term/0))
(//type.expecting expected)
(//module.with 0 (product.left name))
@@ -143,7 +143,7 @@
(try#each (|>> product.left (type#= expected)))
(try.else false))
(|> (/.general archive.empty ..analysis
- (type_literal {.#Named name (-> type/0 expected)})
+ (type.literal {.#Named name (-> type/0 expected)})
(list term/0))
(//type.expecting expected)
(//module.with 0 (product.left name))
@@ -152,7 +152,7 @@
(try#each (|>> product.left (type#= expected)))
(try.else false))
(|> (/.general archive.empty ..analysis
- (type_literal (All (_ a) (-> a a)))
+ (type.literal (All (_ a) (-> a a)))
(list term/0))
(//type.expecting type/0)
(//module.with 0 (product.left name))
@@ -163,7 +163,7 @@
(try#each (type#= type/0))
(try.else false))
(|> (/.general archive.empty ..analysis
- (type_literal ((All (_ a) (-> a a)) type/0))
+ (type.literal ((All (_ a) (-> a a)) type/0))
(list term/0))
(//type.expecting type/0)
(//module.with 0 (product.left name))
@@ -173,7 +173,7 @@
(try.else false))
(|> (do /phase.monad
[[@var varT] (//type.check check.var)
- _ (//type.check (check.check varT (type_literal (-> type/0 expected))))]
+ _ (//type.check (check.check varT (type.literal (-> type/0 expected))))]
(/.general archive.empty ..analysis varT (list term/0)))
(//type.expecting expected)
(//module.with 0 (product.left name))
@@ -184,7 +184,7 @@
(try#each (type#= expected))
(try.else false))
(|> (/.general archive.empty ..analysis
- (type_literal (Ex (_ a) (-> a a)))
+ (type.literal (Ex (_ a) (-> a a)))
(list (` (.error# ""))))
//type.inferring
(//module.with 0 (product.left name))
@@ -207,7 +207,7 @@
(..fails? /.cannot_infer))))
(_.coverage [/.cannot_infer_argument]
(|> (/.general archive.empty ..analysis
- (type_literal (-> expected expected))
+ (type.literal (-> expected expected))
(list term/0))
(//type.expecting expected)
(//module.with 0 (product.left name))
@@ -267,11 +267,11 @@
(variant? {.#Named name variantT} lefts right? tagC)
cases_independent_of_parameters_conform_to_anything!
- (variant? (type_literal (Maybe type/0)) 0 #0 (' []))
+ (variant? (type.literal (Maybe type/0)) 0 #0 (' []))
cases_dependent_on_parameters_are_tettered_to_those_parameters!
- (and (variant? (type_literal (Maybe type/0)) 0 #1 term/0)
- (not (variant? (type_literal (Maybe type/0)) 0 #1 term/1)))
+ (and (variant? (type.literal (Maybe type/0)) 0 #1 term/0)
+ (not (variant? (type.literal (Maybe type/0)) 0 #1 term/1)))
only_bottom_conforms_to_tags_outside_of_range!
(`` (and (,, (with_template [<verdict> <term>]
@@ -281,24 +281,24 @@
[#1 (` (.error# ""))]))))
can_handle_universal_quantification!
- (and (variant?' (type_literal (All (_ a) (Maybe a)))
+ (and (variant?' (type.literal (All (_ a) (Maybe a)))
{.#Some Maybe}
0 #0 (' []))
- (variant?' (type_literal (All (_ a) (Maybe a)))
- {.#Some (type_literal (Maybe type/0))}
+ (variant?' (type.literal (All (_ a) (Maybe a)))
+ {.#Some (type.literal (Maybe type/0))}
0 #1 term/0)
- (not (variant?' (type_literal (All (_ a) (Maybe a)))
+ (not (variant?' (type.literal (All (_ a) (Maybe a)))
{.#Some Maybe}
0 #1 term/0)))
existential_types_do_not_affect_independent_cases!
- (variant?' (type_literal (Ex (_ a) (Maybe a)))
+ (variant?' (type.literal (Ex (_ a) (Maybe a)))
{.#None}
0 #0 (' []))
existential_types_affect_dependent_cases!
(`` (and (,, (with_template [<verdict> <term>]
- [(bit#= <verdict> (variant?' (type_literal (Ex (_ a) (Maybe a))) {.#None} 0 #1 <term>))]
+ [(bit#= <verdict> (variant?' (type.literal (Ex (_ a) (Maybe a))) {.#None} 0 #1 <term>))]
[#0 term/0]
[#1 (` (.error# ""))]))))]
@@ -415,13 +415,13 @@
..test|variant
..test|record
(_.coverage [/.invalid_type_application]
- (and (|> (/.general archive.empty ..analysis (type_literal (type/0 type/1)) (list term/0))
+ (and (|> (/.general archive.empty ..analysis (type.literal (type/0 type/1)) (list term/0))
(/phase.result state)
(..fails? /.invalid_type_application))
- (|> (/.variant lefts right? (type_literal (type/0 type/1)))
+ (|> (/.variant lefts right? (type.literal (type/0 type/1)))
(/phase.result state)
(..fails? /.invalid_type_application))
- (|> (/.record lefts (type_literal (type/0 type/1)))
+ (|> (/.record lefts (type.literal (type/0 type/1)))
(/phase.result state)
(..fails? /.invalid_type_application))))
))))
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux
index 9557ff88b..2b97e44dc 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis.lux
@@ -232,10 +232,10 @@
(let [state [extension.#bundle (extension/analysis.bundle ..eval)
extension.#state lux]
:record: {.#Named [module/0 @text]
- (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text])}
+ (type.literal [.Any .Bit .Nat .Int .Rev .Frac .Text])}
slots/* (list @any @bit @nat @int @rev @frac @text)
:variant: {.#Named [module/0 @text]
- (type_literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))}
+ (type.literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))}
tags/* (list @any @bit @nat @int @rev @frac @text)
can_analyse_unary!
@@ -289,7 +289,7 @@
(|> (do phase.monad
[_ (//module.declare_labels true slots/* false :record:)
.let [:either: {.#Named [module/0 module/0]
- (type_literal (Or .Any :record:))}]
+ (type.literal (Or .Any :record:))}]
_ (//module.declare_labels false (list @left @right) false :either:)
[:it: it] (|> (code.variant (list (code.local @left)))
(/.phase ..expander archive.empty)
@@ -312,7 +312,7 @@
(|> (do phase.monad
[_ (//module.declare_labels true slots/* false :record:)
.let [:either: {.#Named [module/0 module/0]
- (type_literal (Or .Any :record:))}]
+ (type.literal (Or .Any :record:))}]
_ (//module.declare_labels false (list @left @right) false :either:)
[:it: it] (|> (code.variant (list (code.local @right)
(` [])
@@ -366,7 +366,7 @@
(code.text text/0)))
(/.phase ..expander archive.empty)
//type.inferring)]
- (in (and (type#= (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text])
+ (in (and (type#= (type.literal [.Any .Bit .Nat .Int .Rev .Frac .Text])
:it:)
(when it
(//.tuple (list (//.unit)
@@ -396,7 +396,7 @@
(let [state [extension.#bundle (extension/analysis.bundle ..eval)
extension.#state lux]
:record: {.#Named [module/0 @text]
- (type_literal [.Any .Bit .Nat .Int .Rev .Frac .Text])}
+ (type.literal [.Any .Bit .Nat .Int .Rev .Frac .Text])}
slots/* (list @any @bit @nat @int @rev @frac @text)]
(|> (do phase.monad
[_ (//module.declare_labels true slots/* false :record:)
@@ -665,11 +665,11 @@
extension.#state lux]
:variant: {.#Named [module/0 module/0]
- (type_literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))}
+ (type.literal (Or .Any .Bit .Nat .Int .Rev .Frac .Text))}
tags/* (list @any @bit @nat @int @rev @frac @text)
:record: {.#Named [module/0 module/0]
- (type_literal (And .Any .Bit .Nat .Int .Rev .Frac .Text))}
+ (type.literal (And .Any .Bit .Nat .Int .Rev .Frac .Text))}
slots/* (list @any @bit @nat @int @rev @frac @text)
simple!
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux
index ba524b22b..1bfc8b7a7 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/complex.lux
@@ -184,12 +184,12 @@
(//phase#each product.right)
(//phase.result state)
(try.else false))
- (and (sum? (type_literal (Maybe tagT)) 0 false (` []))
- (sum? (type_literal (Maybe tagT)) 0 true tagC))
- (and (sum? (type_literal (All (_ a) (Maybe a))) 0 false (` []))
- (not (sum? (type_literal (All (_ a) (Maybe a))) 0 true tagC)))
- (and (sum? (type_literal (Ex (_ a) (Maybe a))) 0 false (` []))
- (sum? (type_literal (Ex (_ a) (Maybe a))) 0 true tagC)))))
+ (and (sum? (type.literal (Maybe tagT)) 0 false (` []))
+ (sum? (type.literal (Maybe tagT)) 0 true tagC))
+ (and (sum? (type.literal (All (_ a) (Maybe a))) 0 false (` []))
+ (not (sum? (type.literal (All (_ a) (Maybe a))) 0 true tagC)))
+ (and (sum? (type.literal (Ex (_ a) (Maybe a))) 0 false (` []))
+ (sum? (type.literal (Ex (_ a) (Maybe a))) 0 true tagC)))))
... (_.for [/.cannot_analyse_variant]
... (let [failure? (is (All (_ a) (-> (Exception a) (//analysis.Operation Any) Bit))
... (function (_ exception analysis)
@@ -204,7 +204,7 @@
... (|> (do //phase.monad
... [[@var varT] (//type.check check.var)]
... (|> (/.sum ..analysis lefts right? archive.empty tagC)
- ... (//type.expecting (type_literal (varT tagT)))))
+ ... (//type.expecting (type.literal (varT tagT)))))
... (failure? /.invalid_variant_type))))
... (_.coverage [/.cannot_infer_sum]
... (|> (do //phase.monad
@@ -326,9 +326,9 @@
(try.else false))))]
(and (product? productT expected)
(product? {.#Named name productT} expected)
- (product? (type_literal (Ex (_ a) [a a])) (list term/0 term/0))
- (not (product? (type_literal (All (_ a) [a a])) (list term/0 term/0)))
- (product? (type_literal (Triple type/0)) (list term/0 term/0 term/0))
+ (product? (type.literal (Ex (_ a) [a a])) (list term/0 term/0))
+ (not (product? (type.literal (All (_ a) [a a])) (list term/0 term/0)))
+ (product? (type.literal (Triple type/0)) (list term/0 term/0 term/0))
(|> (do //phase.monad
[[@var varT] (//type.check check.var)
_ (//type.check (check.check varT productT))
@@ -428,7 +428,7 @@
[[@var varT] (//type.check check.var)]
(|> expected
(/.product ..analysis archive.empty)
- (//type.expecting (type_literal (varT type/0)))))
+ (//type.expecting (type.literal (varT type/0)))))
(failure? /.invalid_tuple_type))))))
)))
@@ -651,13 +651,13 @@
..test|record
(_.coverage [/.not_a_quantified_type]
(and (|> (/.sum ..analysis lefts right? archive.empty term/0)
- (//type.expecting (type_literal (type/0 type/1)))
+ (//type.expecting (type.literal (type/0 type/1)))
(//phase.result state)
(..failure? /.not_a_quantified_type))
(|> types/*,terms/*
(list#each product.right)
(/.product ..analysis archive.empty)
- (//type.expecting (type_literal (type/0 type/1)))
+ (//type.expecting (type.literal (type/0 type/1)))
(//phase.result state)
(..failure? /.not_a_quantified_type))))
))))
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/function.lux
index 2472c55e3..2dcfc22ca 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/function.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/function.lux
@@ -132,11 +132,11 @@
... (function? (Ex (_ a) (-> a a)) term/0)
... (function? (Rec self (-> input/0 self)) $function/0)
- ... (function? (type_literal ((All (_ a) (-> a a)) output/0)) term/0)
- ... (not (function? (type_literal ((All (_ a) (-> a a)) output/1)) term/0))
+ ... (function? (type.literal ((All (_ a) (-> a a)) output/0)) term/0)
+ ... (not (function? (type.literal ((All (_ a) (-> a a)) output/1)) term/0))
- ... (function? (type_literal ((Ex (_ a) (-> a a)) output/0)) term/0)
- ... (not (function? (type_literal ((Ex (_ a) (-> a a)) output/1)) term/0))
+ ... (function? (type.literal ((Ex (_ a) (-> a a)) output/0)) term/0)
+ ... (not (function? (type.literal ((Ex (_ a) (-> a a)) output/1)) term/0))
... (function?' (-> input/0 input/1 input/0) (` ([(, $function/1) (, $argument/1)] (, $argument/0)))
... (function (_ [outer body])
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/when.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/when.lux
index f23e99dac..e42a02e2c 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/when.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/analysis/when.lux
@@ -97,12 +97,12 @@
(Tuple (All (_ a b c) input/0)
(All (_ a b c) input/1)
(All (_ a b c) input/2)))
- (tuple? (type_literal ((All (_ a b c) (Tuple a b c)) input/0 input/1 input/2))
+ (tuple? (type.literal ((All (_ a b c) (Tuple a b c)) input/0 input/1 input/2))
(Tuple input/0 input/1 input/2))
(|> (do check.monad
[[@var :var:] check.var
_ (check.bind (All (_ a b c) (Tuple a b c)) @var)]
- (/.tuple (type_literal (:var: input/0 input/1 input/2))))
+ (/.tuple (type.literal (:var: input/0 input/1 input/2))))
(check.result check.fresh_context)
(try#each (|>> product.right (type#= (Tuple input/0 input/1 input/2))))
(try.else false))
@@ -127,19 +127,19 @@
(exception.otherwise (text.contains? (the exception.#label /.non_tuple))))
(|> (do check.monad
[[@var :var:] check.var
- _ (/.tuple (type_literal (:var: input/0 input/1 input/2)))]
+ _ (/.tuple (type.literal (:var: input/0 input/1 input/2)))]
(in false))
(check.result check.fresh_context)
(exception.otherwise (text.contains? (the exception.#label /.non_tuple))))
(|> (do check.monad
- [_ (/.tuple (type_literal (input/0 input/1 input/2)))]
+ [_ (/.tuple (type.literal (input/0 input/1 input/2)))]
(in false))
(check.result check.fresh_context)
(exception.otherwise (text.contains? (the exception.#label /.non_tuple))))
(|> (do check.monad
[[@var :var:] check.var
_ (check.bind input/0 @var)
- _ (/.tuple (type_literal (:var: input/1 input/2)))]
+ _ (/.tuple (type.literal (:var: input/1 input/2)))]
(in false))
(check.result check.fresh_context)
(exception.otherwise (text.contains? (the exception.#label /.non_tuple))))))
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux
index 66d43c8c6..93ad48d8a 100644
--- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -73,7 +73,7 @@
(_.test "Can 'try' risky IO computations."
(check_success+ (` .try#)
(list (` (.error# "YOLO")))
- (type_literal (Either Text primT))))
+ (type.literal (Either Text primT))))
)))
(def i64
@@ -149,7 +149,7 @@
(_.test "Can convert frac number to text."
(check_success+ (symbol .f64_encoded#) (list subjectC) Text))
(_.test "Can convert text to frac number."
- (check_success+ (symbol .f64_decoded#) (list encodedC) (type_literal (Maybe Frac))))
+ (check_success+ (symbol .f64_decoded#) (list encodedC) (type.literal (Maybe Frac))))
)))
(def text
@@ -168,7 +168,7 @@
(_.test "Can concatenate one text to another."
(check_success+ (symbol .text_composite#) (list subjectC paramC) Text))
(_.test "Can find the index of a piece of text inside a larger one that (may) contain it."
- (check_success+ (symbol .text_index#) (list fromC paramC subjectC) (type_literal (Maybe Nat))))
+ (check_success+ (symbol .text_index#) (list fromC paramC subjectC) (type.literal (Maybe Nat))))
(_.test "Can query the size/length of a text."
(check_success+ (symbol .text_size#) (list subjectC) Nat))
(_.test "Can obtain the character code of a text at a given index."
diff --git a/stdlib/source/test/lux/meta/compiler/meta/cli/compiler.lux b/stdlib/source/test/lux/meta/compiler/meta/cli/compiler.lux
index c8de9bc39..e4164032a 100644
--- a/stdlib/source/test/lux/meta/compiler/meta/cli/compiler.lux
+++ b/stdlib/source/test/lux/meta/compiler/meta/cli/compiler.lux
@@ -37,7 +37,8 @@
(def .public test
Test
(<| (_.covering /._)
- (_.for [/.Compiler])
+ (_.for [/.Compiler
+ /.#definition /.#parameters])
(do [! random.monad]
[expected ..random]
(all _.and