added a special case to the ->i error messages for when #:pre only has two things following
This commit is contained in:
parent
9a0d7b419b
commit
582c8362a6
|
@ -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 ()
|
||||
|
|
Loading…
Reference in New Issue
Block a user