diff options
Diffstat (limited to 'new-luxc/test/test/luxc/lang/analysis/structure.lux')
-rw-r--r-- | new-luxc/test/test/luxc/lang/analysis/structure.lux | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/new-luxc/test/test/luxc/lang/analysis/structure.lux b/new-luxc/test/test/luxc/lang/analysis/structure.lux index cc31622a1..58212359e 100644 --- a/new-luxc/test/test/luxc/lang/analysis/structure.lux +++ b/new-luxc/test/test/luxc/lang/analysis/structure.lux @@ -12,8 +12,8 @@ (coll [list "list/" Functor<List>] ["S" set])) ["r" math/random "r/" Monad<Random>] - [meta] - (meta [code]) + [macro] + (macro [code]) (lang [type "type/" Eq<Type>] (type ["tc" check])) test) @@ -47,7 +47,7 @@ (|> (&;with-scope (&;with-type variantT (@;analyse-sum analyse choice valueC))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ sumA]) [(la;unfold-variant sumA) (#;Some [tag last? valueA])]) @@ -58,13 +58,13 @@ false))) (test "Can analyse sum through bound type-vars." (|> (&;with-scope - (do meta;Monad<Meta> + (do macro;Monad<Meta> [[_ varT] (&;with-type-env tc;var) _ (&;with-type-env (tc;check varT variantT))] (&;with-type varT (@;analyse-sum analyse choice valueC)))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ sumA]) [(la;unfold-variant sumA) (#;Some [tag last? valueA])]) @@ -75,11 +75,11 @@ false))) (test "Cannot analyse sum through unbound type-vars." (|> (&;with-scope - (do meta;Monad<Meta> + (do macro;Monad<Meta> [[_ varT] (&;with-type-env tc;var)] (&;with-type varT (@;analyse-sum analyse choice valueC)))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success _) false @@ -89,7 +89,7 @@ (|> (&;with-scope (&;with-type (type;ex-q +1 +variantT) (@;analyse-sum analyse +choice +valueC))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success _) true @@ -99,7 +99,7 @@ (|> (&;with-scope (&;with-type (type;univ-q +1 +variantT) (@;analyse-sum analyse +choice +valueC))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success _) (not (n.= choice +choice)) @@ -123,7 +123,7 @@ (test "Can analyse product." (|> (&;with-type (type;tuple (list/map product;left primitives)) (@;analyse-product analyse (list/map product;right primitives))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success tupleA) (n.= size (list;size (la;unfold-tuple tupleA))) @@ -132,7 +132,7 @@ (test "Can infer product." (|> (@common;with-unknown-type (@;analyse-product analyse (list/map product;right primitives))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success [_type tupleA]) (and (type/= (type;tuple (list/map product;left primitives)) _type) @@ -143,7 +143,7 @@ (test "Can analyse pseudo-product (singleton tuple)" (|> (&;with-type singletonT (analyse (` [(~ singletonC)]))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success singletonA) true @@ -151,13 +151,13 @@ false))) (test "Can analyse product through bound type-vars." (|> (&;with-scope - (do meta;Monad<Meta> + (do macro;Monad<Meta> [[_ varT] (&;with-type-env tc;var) _ (&;with-type-env (tc;check varT (type;tuple (list/map product;left primitives))))] (&;with-type varT (@;analyse-product analyse (list/map product;right primitives))))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success [_ tupleA]) (n.= size (list;size (la;unfold-tuple tupleA))) @@ -167,7 +167,7 @@ (|> (&;with-scope (&;with-type (type;ex-q +1 +tupleT) (@;analyse-product analyse (list/map product;right +primitives)))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success _) true @@ -177,7 +177,7 @@ (|> (&;with-scope (&;with-type (type;univ-q +1 +tupleT) (@;analyse-product analyse (list/map product;right +primitives)))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (#e;Success _) false @@ -188,7 +188,7 @@ (def: (check-variant-inference variantT choice size analysis) (-> Type Nat Nat (Meta [Module Scope Type la;Analysis]) Bool) (|> analysis - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ _ sumT sumA]) [(la;unfold-variant sumA) (#;Some [tag last? valueA])]) @@ -202,7 +202,7 @@ (def: (check-record-inference tupleT size analysis) (-> Type Nat (Meta [Module Scope Type la;Analysis]) Bool) (|> analysis - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ _ productT productA]) [(la;unfold-tuple productA) membersA]) @@ -238,7 +238,7 @@ ($_ seq (test "Can infer tagged sum." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false namedT)] (&;with-scope (@common;with-unknown-type @@ -246,7 +246,7 @@ (check-variant-inference variantT choice size))) (test "Tagged sums specialize when type-vars get bound." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false named-polyT)] (&;with-scope (@common;with-unknown-type @@ -254,7 +254,7 @@ (check-variant-inference variantT choice size))) (test "Tagged sum inference retains universal quantification when type-vars are not bound." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false named-polyT)] (&;with-scope (@common;with-unknown-type @@ -262,12 +262,12 @@ (check-variant-inference polyT other-choice size))) (test "Can specialize generic tagged sums." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false named-polyT)] (&;with-scope (&;with-type variantT (@;analyse-tagged-sum analyse [module-name other-choice-tag] other-choiceC))))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ _ sumA]) [(la;unfold-variant sumA) (#;Some [tag last? valueA])]) @@ -302,7 +302,7 @@ ($_ seq (test "Can infer record." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false namedT)] (&;with-scope (@common;with-unknown-type @@ -310,7 +310,7 @@ (check-record-inference tupleT size))) (test "Records specialize when type-vars get bound." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false named-polyT)] (&;with-scope (@common;with-unknown-type @@ -318,12 +318,12 @@ (check-record-inference tupleT size))) (test "Can specialize generic records." (|> (@module;with-module +0 module-name - (do meta;Monad<Meta> + (do macro;Monad<Meta> [_ (@module;declare-tags tags false named-polyT)] (&;with-scope (&;with-type tupleT (@;analyse-record analyse recordC))))) - (meta;run (init-compiler [])) + (macro;run (init-compiler [])) (case> (^multi (#e;Success [_ _ productA]) [(la;unfold-tuple productA) membersA]) |