From 582c8362a6ef4de85df19b38ca31df70f8113ab2 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 6 Jan 2011 19:29:02 -0600 Subject: [PATCH] added a special case to the ->i error messages for when #:pre only has two things following --- collects/racket/contract/private/arr-i-parse.rkt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/collects/racket/contract/private/arr-i-parse.rkt b/collects/racket/contract/private/arr-i-parse.rkt index 6a034f3c24..25b543b736 100644 --- a/collects/racket/contract/private/arr-i-parse.rkt +++ b/collects/racket/contract/private/arr-i-parse.rkt @@ -360,10 +360,17 @@ code does the parsing and validation of the syntax. [_ (values #f leftover)])] [(pre-cond leftover) (syntax-case leftover () - [(#:pre (id ...) pre-cond . leftover) + [(#:pre (id ...) pre-cond . pre-leftover) (begin + (syntax-case #'pre-leftover () + [() (raise-syntax-error + #f + "expected #:pre to be followed by at least three subterms (a sequence of identifiers, the pre-condition and the range contract), but found only two" + stx + (car (syntax->list leftover)))] + [x (void)]) (for-each (λ (x) (check-id stx x)) (syntax->list #'(id ...))) - (values (pre/post (syntax->list #'(id ...)) #'pre-cond) #'leftover))] + (values (pre/post (syntax->list #'(id ...)) #'pre-cond) #'pre-leftover))] [_ (values #f leftover)])] [(range leftover) (syntax-case leftover ()