aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis/case
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/analysis/case.lux38
-rw-r--r--new-luxc/source/luxc/lang/analysis/case/coverage.lux14
2 files changed, 26 insertions, 26 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/case.lux b/new-luxc/source/luxc/lang/analysis/case.lux
index 69a975b52..5d4c592aa 100644
--- a/new-luxc/source/luxc/lang/analysis/case.lux
+++ b/new-luxc/source/luxc/lang/analysis/case.lux
@@ -11,8 +11,8 @@
[text]
text/format
(coll [list "list/" Fold<List> Monoid<List> Functor<List>]))
- [meta]
- (meta [code])
+ [macro]
+ (macro [code])
(lang [type]
(type ["tc" check])))
(luxc ["&" lang]
@@ -46,7 +46,7 @@
(-> Type (Meta Type))
(case caseT
(#;Var id)
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[?caseT' (&;with-type-env
(tc;read id))]
(case ?caseT'
@@ -60,7 +60,7 @@
(simplify-case-type unnamedT)
(^or (#;UnivQ _) (#;ExQ _))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[ex-id exT] (&;with-type-env
tc;existential)]
(simplify-case-type (maybe;assume (type;apply (list exT) caseT))))
@@ -68,7 +68,7 @@
(#;Apply inputT funcT)
(case funcT
(#;Var funcT-id)
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[funcT' (&;with-type-env
(do tc;Monad<Check>
[?funct' (tc;read funcT-id)]
@@ -83,13 +83,13 @@
_
(case (type;apply (list inputT) funcT)
(#;Some outputT)
- (:: meta;Monad<Meta> wrap outputT)
+ (:: macro;Monad<Meta> wrap outputT)
#;None
(&;throw Cannot-Simplify-Type-For-Pattern-Matching (%type caseT))))
_
- (:: meta;Monad<Meta> wrap caseT)))
+ (:: macro;Monad<Meta> wrap caseT)))
## This function handles several concerns at once, but it must be that
## way because those concerns are interleaved when doing
@@ -112,7 +112,7 @@
(case pattern
[cursor (#;Symbol ["" name])]
(&;with-cursor cursor
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[outputA (&scope;with-local [name inputT]
next)
idx &scope;next-local]
@@ -125,7 +125,7 @@
(^template [<type> <code-tag>]
[cursor (<code-tag> test)]
(&;with-cursor cursor
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[_ (&;with-type-env
(tc;check inputT <type>))
outputA next]
@@ -139,7 +139,7 @@
(^ [cursor (#;Tuple (list))])
(&;with-cursor cursor
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[_ (&;with-type-env
(tc;check inputT Unit))
outputA next]
@@ -150,7 +150,7 @@
[cursor (#;Tuple sub-patterns)]
(&;with-cursor cursor
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[inputT' (simplify-case-type inputT)]
(case inputT'
(#;Product _)
@@ -191,7 +191,7 @@
)))
[cursor (#;Record record)]
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[record (structureA;normalize record)
[members recordT] (structureA;order record)
_ (&;with-type-env
@@ -204,7 +204,7 @@
(^ [cursor (#;Form (list& [_ (#;Nat idx)] values))])
(&;with-cursor cursor
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[inputT' (simplify-case-type inputT)]
(case inputT'
(#;Sum _)
@@ -216,14 +216,14 @@
(n.< num-cases idx))
(if (and (n.> num-cases size-sum)
(n.= (n.dec num-cases) idx))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[testP nextA] (analyse-pattern #;None
(type;variant (list;drop (n.dec num-cases) flat-sum))
(` [(~@ values)])
next)]
(wrap [(` ("lux case variant" (~ (code;nat idx)) (~ (code;nat num-cases)) (~ testP)))
nextA]))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[testP nextA] (analyse-pattern #;None case-type (` [(~@ values)]) next)]
(wrap [(` ("lux case variant" (~ (code;nat idx)) (~ (code;nat num-cases)) (~ testP)))
nextA])))
@@ -238,9 +238,9 @@
(^ [cursor (#;Form (list& [_ (#;Tag tag)] values))])
(&;with-cursor cursor
- (do meta;Monad<Meta>
- [tag (meta;normalize tag)
- [idx group variantT] (meta;resolve-tag tag)
+ (do macro;Monad<Meta>
+ [tag (macro;normalize tag)
+ [idx group variantT] (macro;resolve-tag tag)
_ (&;with-type-env
(tc;check inputT variantT))]
(analyse-pattern (#;Some (list;size group)) inputT (` ((~ (code;nat idx)) (~@ values))) next)))
@@ -256,7 +256,7 @@
(&;throw Cannot-Have-Empty-Branches "")
(#;Cons [patternH bodyH] branchesT)
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[inputT inputA] (commonA;with-unknown-type
(analyse inputC))
outputH (analyse-pattern #;None inputT patternH (analyse bodyH))
diff --git a/new-luxc/source/luxc/lang/analysis/case/coverage.lux b/new-luxc/source/luxc/lang/analysis/case/coverage.lux
index c41cfb2a4..283e21d02 100644
--- a/new-luxc/source/luxc/lang/analysis/case/coverage.lux
+++ b/new-luxc/source/luxc/lang/analysis/case/coverage.lux
@@ -9,7 +9,7 @@
text/format
(coll [list "list/" Fold<List>]
[dict #+ Dict]))
- [meta "meta/" Monad<Meta>])
+ [macro "macro/" Monad<Meta>])
(luxc ["&" lang]
(lang ["la" analysis])))
@@ -52,7 +52,7 @@
## Unit [] amounts to exhaustive coverage because there is only one
## possible value, so matching against it covers all cases.
(^or (^code ("lux case bind" (~ _))) (^code ("lux case tuple" [])))
- (meta/wrap #Exhaustive)
+ (macro/wrap #Exhaustive)
(^code ("lux case tuple" [(~ singleton)]))
(determine singleton)
@@ -61,13 +61,13 @@
## are too many possibilities as far as values go.
(^or [_ (#;Nat _)] [_ (#;Int _)] [_ (#;Deg _)]
[_ (#;Frac _)] [_ (#;Text _)])
- (meta/wrap #Partial)
+ (macro/wrap #Partial)
## Bools are the exception, since there is only "true" and
## "false", which means it is possible for boolean
## pattern-matching to become exhaustive if complementary parts meet.
[_ (#;Bool value)]
- (meta/wrap (#Bool value))
+ (macro/wrap (#Bool value))
## Tuple patterns can be exhaustive if there is exhaustiveness for all of
## their sub-patterns.
@@ -75,10 +75,10 @@
(loop [subs subs]
(case subs
#;Nil
- (meta/wrap #Exhaustive)
+ (macro/wrap #Exhaustive)
(#;Cons sub subs')
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[pre (determine sub)
post (recur subs')]
(if (exhaustive? post)
@@ -88,7 +88,7 @@
## Variant patterns can be shown to be exhaustive if all the possible
## cases are handled exhaustively.
(^code ("lux case variant" (~ [_ (#;Nat tag-id)]) (~ [_ (#;Nat num-tags)]) (~ sub)))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[=sub (determine sub)]
(wrap (#Variant num-tags
(|> (dict;new number;Hash<Nat>)