improved error message in the case where ->i is used as an identifier

This commit is contained in:
Robby Findler 2010-08-10 16:00:51 -05:00
parent d15fc5c102
commit 5fb1c730ba

View File

@ -49,6 +49,8 @@ code does the parsing and validation of the syntax.
(struct pre/post (vars exp)) (struct pre/post (vars exp))
(define (parse-->i stx) (define (parse-->i stx)
(if (identifier? stx)
(raise-syntax-error #f "expected ->i to follow an open parenthesis" stx)
(let-values ([(raw-mandatory-doms raw-optional-doms (let-values ([(raw-mandatory-doms raw-optional-doms
id/rest-id pre-cond range post-cond) id/rest-id pre-cond range post-cond)
(pull-out-pieces stx)]) (pull-out-pieces stx)])
@ -61,7 +63,7 @@ code does the parsing and validation of the syntax.
post-cond)]) post-cond)])
(ensure-wf-names stx candidate) (ensure-wf-names stx candidate)
(ensure-no-cycles stx candidate) (ensure-no-cycles stx candidate)
candidate))) candidate))))
(define (ensure-wf-names stx istx) (define (ensure-wf-names stx istx)
(let ([km (make-hash)] (let ([km (make-hash)]