aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis/case.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/analysis/case.lux38
1 files changed, 19 insertions, 19 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))