mirror of
https://github.com/kanaka/mal.git
synced 2024-11-23 12:14:45 +03:00
sml: fix mlton self-host. Full syntax err in catch*
In mlton mode, syntax errors caught in the try/catch block were being processed as "SyntaxError" without any additional context/message. Explicitly pass the full message always.
This commit is contained in:
parent
a2973ab0b8
commit
e9dd8c53e5
@ -71,6 +71,7 @@ and evalTry e [a, LIST ([SYMBOL "catch*", b, c],_)] = (eval e a handle ex => eva
|
||||
and evalCatch e b ex body = eval (bind [b, exnVal ex] e) body
|
||||
|
||||
and exnVal (MalException x) = x
|
||||
| exnVal (SyntaxError msg) = STRING msg
|
||||
| exnVal (NotDefined msg) = STRING msg
|
||||
| exnVal (NotApplicable msg) = STRING msg
|
||||
| exnVal (OutOfBounds msg) = STRING msg
|
||||
|
@ -71,6 +71,7 @@ and evalTry e [a, LIST ([SYMBOL "catch*", b, c],_)] = (eval e a handle ex => eva
|
||||
and evalCatch e b ex body = eval (bind [b, exnVal ex] e) body
|
||||
|
||||
and exnVal (MalException x) = x
|
||||
| exnVal (SyntaxError msg) = STRING msg
|
||||
| exnVal (NotDefined msg) = STRING msg
|
||||
| exnVal (NotApplicable msg) = STRING msg
|
||||
| exnVal (OutOfBounds msg) = STRING msg
|
||||
|
@ -41,6 +41,7 @@
|
||||
(try* (map throw (list "my err")) (catch* exc exc))
|
||||
;=>"my err"
|
||||
|
||||
|
||||
;;
|
||||
;; Testing builtin functions
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user