redex: syntax error fix for define-relation
please merge to the release branch
This commit is contained in:
parent
e6122d5fbd
commit
41d90c6dd5
|
@ -388,8 +388,11 @@
|
||||||
(define-syntax (define-relation stx)
|
(define-syntax (define-relation stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(def-form-id lang . body)
|
[(def-form-id lang . body)
|
||||||
(let-values ([(contract-name dom-ctcs codom-contracts pats)
|
(begin
|
||||||
(split-out-contract stx (syntax-e #'def-form-id) #'body #t)])
|
(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)]
|
(with-syntax* ([((name trms ...) rest ...) (car pats)]
|
||||||
[(mode-stx ...) #`(#:mode (name I))]
|
[(mode-stx ...) #`(#:mode (name I))]
|
||||||
[(ctc-stx ...) (if dom-ctcs
|
[(ctc-stx ...) (if dom-ctcs
|
||||||
|
|
|
@ -24,3 +24,7 @@
|
||||||
first-where
|
first-where
|
||||||
(where any_d any_b)
|
(where any_d any_b)
|
||||||
first-post-where]))
|
first-post-where]))
|
||||||
|
|
||||||
|
(#rx"expected an identifier in the language position"
|
||||||
|
([not-lang [(R a)]])
|
||||||
|
(define-relation not-lang))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user