From 9310b1e14c6ac07ca2d176e86f578a0fbe728448 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 12 Oct 2018 11:34:03 -0600 Subject: [PATCH] cs: recognize more Scheme errors We'll want a better approach eventually. --- racket/src/cs/rumble/error.ss | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/racket/src/cs/rumble/error.ss b/racket/src/cs/rumble/error.ss index 48e6e2abe5..8986626e19 100644 --- a/racket/src/cs/rumble/error.ss +++ b/racket/src/cs/rumble/error.ss @@ -664,10 +664,13 @@ [else (|#%app| (cond - [(and (format-condition? v) - (or (string-prefix? "incorrect number of arguments" (condition-message v)) - (string-suffix? "values to single value return context" (condition-message v)) - (string-prefix? "incorrect number of values received in multiple value context" (condition-message v)))) + [(or (and (format-condition? v) + (or (string-prefix? "incorrect number of arguments" (condition-message v)) + (string-suffix? "values to single value return context" (condition-message v)) + (string-prefix? "incorrect number of values received in multiple value context" (condition-message v)))) + (and (message-condition? v) + (or (string-prefix? "incorrect argument count in call" (condition-message v)) + (string-prefix? "incorrect number of values from rhs" (condition-message v))))) exn:fail:contract:arity] [(and (format-condition? v) (who-condition? v) @@ -675,7 +678,8 @@ (string=? "undefined for ~s" (condition-message v))) exn:fail:contract:divide-by-zero] [(and (format-condition? v) - (string=? "attempt to reference undefined variable ~s" (condition-message v))) + (or (string=? "attempt to reference undefined variable ~s" (condition-message v)) + (string=? "attempt to assign undefined variable ~s" (condition-message v)))) (lambda (msg marks) (|#%app| exn:fail:contract:variable msg marks (car (condition-irritants v))))] [else