redex: syntax error fix for define-relation

please merge to the release branch
This commit is contained in:
Burke Fetscher 2013-04-11 22:34:29 -05:00
parent e6122d5fbd
commit 41d90c6dd5
2 changed files with 9 additions and 2 deletions

View File

@ -388,8 +388,11 @@
(define-syntax (define-relation stx)
(syntax-case stx ()
[(def-form-id lang . body)
(let-values ([(contract-name dom-ctcs codom-contracts pats)
(split-out-contract stx (syntax-e #'def-form-id) #'body #t)])
(begin
(unless (identifier? #'lang)
(raise-syntax-error #f "expected an identifier in the language position" stx #'lang))
(define-values (contract-name dom-ctcs codom-contracts pats)
(split-out-contract stx (syntax-e #'def-form-id) #'body #t))
(with-syntax* ([((name trms ...) rest ...) (car pats)]
[(mode-stx ...) #`(#:mode (name I))]
[(ctc-stx ...) (if dom-ctcs

View File

@ -24,3 +24,7 @@
first-where
(where any_d any_b)
first-post-where]))
(#rx"expected an identifier in the language position"
([not-lang [(R a)]])
(define-relation not-lang))