Fix PR 10140

svn: r17473
This commit is contained in:
Sam Tobin-Hochstadt 2010-01-04 01:12:58 +00:00
parent b50ae83a27
commit b802c7dfd0
2 changed files with 10 additions and 6 deletions

View File

@ -42,11 +42,10 @@
(append-pats pat rpat) (append-pats pat rpat)
(raise-syntax-error 'match "non-list pattern inside unquote-splicing" (raise-syntax-error 'match "non-list pattern inside unquote-splicing"
stx #'p)))] stx #'p)))]
[(p dd) [(p dd . rest)
(ddk? #'dd) (ddk? #'dd)
(let* ([count (ddk? #'..)] (let* ([count (ddk? #'dd)]
[min (if (number? count) count #f)] [min (and (number? count) count)])
[max (if (number? count) count #f)])
(make-GSeq (make-GSeq
(parameterize ([match-...-nesting (add1 (match-...-nesting))]) (parameterize ([match-...-nesting (add1 (match-...-nesting))])
(list (list (pq #'p)))) (list (list (pq #'p))))
@ -55,7 +54,7 @@
(list #f) (list #f)
;; patterns in p get bound to lists ;; patterns in p get bound to lists
(list #f) (list #f)
(make-Null (make-Dummy #f)) (pq #'rest)
#f))] #f))]
[(a . b) (make-Pair (pq #'a) (pq #'b))] [(a . b) (make-Pair (pq #'a) (pq #'b))]
;; the hard cases ;; the hard cases

View File

@ -603,4 +603,9 @@
(match 3 (match 3
[(or) 1] [(or) 1]
[_ 4])) [_ 4]))
(comp '((1 2) 3)
(match `(begin 1 2 3)
[`(begin ,es ... ,en)
(list es en)]))
)) ))