aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/lang
diff options
context:
space:
mode:
authorEduardo Julian2018-05-02 01:26:14 -0400
committerEduardo Julian2018-05-02 01:26:14 -0400
commit0f1be1eddc30bcff15b5da36b80f2b286fe0908d (patch)
tree1cf4ada83e13f23e2299dcb2f8118a13182e04bc /stdlib/source/lux/lang
parent4331551e030860116f5b6d23ad0d1259e1e7c048 (diff)
- Made the names of all exceptions lower-case.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/lang/syntax.lux8
-rw-r--r--stdlib/source/lux/lang/type/check.lux30
2 files changed, 19 insertions, 19 deletions
diff --git a/stdlib/source/lux/lang/syntax.lux b/stdlib/source/lux/lang/syntax.lux
index 1296cfaa5..0fefc1929 100644
--- a/stdlib/source/lux/lang/syntax.lux
+++ b/stdlib/source/lux/lang/syntax.lux
@@ -589,10 +589,10 @@
[tag #.Tag (p.after (l.this "#") (ident^ current-module aliases)) +1]
)
-(exception: #export (End-Of-File {module Text})
+(exception: #export (end-of-file {module Text})
module)
-(exception: #export (Unrecognized-Input {[file line column] Cursor})
+(exception: #export (unrecognized-input {[file line column] Cursor})
(format " File: " file "\n"
" Line: " (%n line) "\n"
"Column: " (%n column) "\n"))
@@ -618,8 +618,8 @@
(do @
[end? l.end?]
(if end?
- (p.fail (ex.construct End-Of-File current-module))
- (p.fail (ex.construct Unrecognized-Input where))))
+ (p.fail (ex.construct end-of-file current-module))
+ (p.fail (ex.construct unrecognized-input where))))
)))))
(def: #export (read current-module aliases [where offset source])
diff --git a/stdlib/source/lux/lang/type/check.lux b/stdlib/source/lux/lang/type/check.lux
index 8a32b2c4c..f71ac4150 100644
--- a/stdlib/source/lux/lang/type/check.lux
+++ b/stdlib/source/lux/lang/type/check.lux
@@ -14,22 +14,22 @@
(lang [type "type/" Eq<Type>])
))
-(exception: #export (Unknown-Type-Var {id Nat})
+(exception: #export (unknown-type-var {id Nat})
(nat/encode id))
-(exception: #export (Unbound-Type-Var {id Nat})
+(exception: #export (unbound-type-var {id Nat})
(nat/encode id))
-(exception: #export (Invalid-Type-Application {funcT Type} {argT Type})
+(exception: #export (invalid-type-application {funcT Type} {argT Type})
(type.to-text (#.Apply argT funcT)))
-(exception: #export (Cannot-Rebind-Var {id Nat} {type Type} {bound Type})
+(exception: #export (cannot-rebind-var {id Nat} {type Type} {bound Type})
($_ text/compose
" Var: " (nat/encode id) "\n"
" Wanted Type: " (type.to-text type) "\n"
"Current Type: " (type.to-text bound)))
-(exception: #export (Type-Check-Failed {expected Type} {actual Type})
+(exception: #export (type-check-failed {expected Type} {actual Type})
($_ text/compose
"Expected: " (type.to-text expected) "\n\n"
" Actual: " (type.to-text actual)))
@@ -179,7 +179,7 @@
(#e.Success [context <succeed>])
#.None
- (ex.throw Unknown-Type-Var id))))]
+ (ex.throw unknown-type-var id))))]
[bound? Bool false true]
[read (Maybe Type) #.None (#.Some bound)]
@@ -193,24 +193,24 @@
(#e.Success [context bound])
(#.Some #.None)
- (ex.throw Unbound-Type-Var id)
+ (ex.throw unbound-type-var id)
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: #export (write type id)
(-> Type Var (Check Unit))
(function (_ context)
(case (|> context (get@ #.var-bindings) (var::get id))
(#.Some (#.Some bound))
- (ex.throw Cannot-Rebind-Var [id type bound])
+ (ex.throw cannot-rebind-var [id type bound])
(#.Some #.None)
(#e.Success [(update@ #.var-bindings (var::put id (#.Some type)) context)
[]])
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: (update type id)
(-> Type Var (Check Unit))
@@ -221,7 +221,7 @@
[]])
#.None
- (ex.throw Unknown-Type-Var id))))
+ (ex.throw unknown-type-var id))))
(def: #export var
(Check [Var Type])
@@ -252,7 +252,7 @@
[?funcT' (read func-id)]
(case ?funcT'
#.None
- (throw Invalid-Type-Application [funcT argT])
+ (throw invalid-type-application [funcT argT])
(#.Some funcT')
(apply-type! funcT' argT)))
@@ -261,7 +261,7 @@
(function (_ context)
(case (type.apply (list argT) funcT)
#.None
- (ex.throw Invalid-Type-Application [funcT argT])
+ (ex.throw invalid-type-application [funcT argT])
(#.Some output)
(#e.Success [context output])))))
@@ -290,7 +290,7 @@
(#e.Success [context output])
#.None
- (ex.throw Unknown-Type-Var current)))))
+ (ex.throw unknown-type-var current)))))
(def: #export fresh-context
Type-Context
@@ -519,7 +519,7 @@
(if (is? expected actual)
(check/wrap assumptions)
(with-error-stack
- (function (_ _) (ex.construct Type-Check-Failed [expected actual]))
+ (function (_ _) (ex.construct type-check-failed [expected actual]))
(case [expected actual]
[(#.Var idE) (#.Var idA)]
(check-vars check' assumptions idE idA)