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.lux23
1 files changed, 14 insertions, 9 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/case.lux b/new-luxc/source/luxc/lang/analysis/case.lux
index c40bb2ac3..a9731a1d7 100644
--- a/new-luxc/source/luxc/lang/analysis/case.lux
+++ b/new-luxc/source/luxc/lang/analysis/case.lux
@@ -22,13 +22,18 @@
[".A" structure]
(case [".A" coverage])))))
-(exception: #export Cannot-Match-Type-With-Pattern)
-(exception: #export Sum-Type-Has-No-Case)
-(exception: #export Unrecognized-Pattern-Syntax)
-(exception: #export Cannot-Simplify-Type-For-Pattern-Matching)
-(exception: #export Cannot-Have-Empty-Branches)
-(exception: #export Non-Exhaustive-Pattern-Matching)
-(exception: #export Symbols-Must-Be-Unqualified-Inside-Patterns)
+(do-template [<name>]
+ [(exception: #export (<name> {message Text})
+ message)]
+
+ [Cannot-Match-Type-With-Pattern]
+ [Sum-Type-Has-No-Case]
+ [Unrecognized-Pattern-Syntax]
+ [Cannot-Simplify-Type-For-Pattern-Matching]
+ [Cannot-Have-Empty-Branches]
+ [Non-Exhaustive-Pattern-Matching]
+ [Symbols-Must-Be-Unqualified-Inside-Patterns]
+ )
(def: (pattern-error type pattern)
(-> Type Code Text)
@@ -204,7 +209,7 @@
[[memberP+ thenA] (list/fold (: (All [a]
(-> [Type Code] (Meta [(List la.Pattern) a])
(Meta [(List la.Pattern) a])))
- (function [[memberT memberC] then]
+ (function (_ [memberT memberC] then)
(do @
[[memberP [memberP+ thenA]] ((:! (All [a] (-> (Maybe Nat) Type Code (Meta a) (Meta [la.Pattern a])))
analyse-pattern)
@@ -292,7 +297,7 @@
(analyse inputC))
outputH (analyse-pattern #.None inputT patternH (analyse bodyH))
outputT (monad.map @
- (function [[patternT bodyT]]
+ (function (_ [patternT bodyT])
(analyse-pattern #.None inputT patternT (analyse bodyT)))
branchesT)
outputHC (|> outputH product.left coverageA.determine)