syntax: fix guard for multiple pattern variables under ...

Fix the part of `syntax`/`datum` that determines whether an exception
handler is needed to convert an error from `map` to one from
`syntax`/`datum`.
This commit is contained in:
Matthew Flatt 2017-07-14 06:57:32 -06:00
parent a22a3852c6
commit 2e77279be0
2 changed files with 11 additions and 1 deletions

View File

@ -743,6 +743,16 @@
(syntax-test #'(datum-case '(1 "x" -> y) (->) [(a b -> c) (define q 1)])
#rx"macro.rktl:.*no expression after a sequence of internal definitions")
(let ()
(define-syntax-rule (check-error clause)
(err/rt-test
(datum-case '((1 2) (3)) () clause)
(lambda (exn)
(and (regexp-match? #rx"incompatible ellipsis match counts for template"
(exn-message exn))))))
(check-error [((a ...) (b ...)) (datum ((a b) ...))])
(check-error [((a ...) (b ...)) (datum ((a 0 b) ...))])
(check-error [((a ...) (b ...)) (datum (((a) (b)) ...))]))
;; ----------------------------------------
;; Check `#%variable-reference' expansion to make sure

View File

@ -1136,7 +1136,7 @@
[(and (syntax? p)
(prefab-struct-key (syntax-e p)))
(loop (cdr (vector->list (struct->vector (syntax-e p)))) use-ellipsis? depth found)]
[else #f])))
[else found])))
(-define (no-ellipses? stx)
(cond