fix R6RS template handling of consecutive ellipses
svn: r10824
This commit is contained in:
parent
04af3c8f01
commit
6e668cbb00
|
@ -227,7 +227,14 @@
|
||||||
(identifier? #'ellipses)
|
(identifier? #'ellipses)
|
||||||
(free-identifier=? #'ellipses #'(... ...)))
|
(free-identifier=? #'ellipses #'(... ...)))
|
||||||
(box (cons (loop #'expr #f #f)
|
(box (cons (loop #'expr #f #f)
|
||||||
(loop #'rest #f #t)))]
|
(let rloop ([rest #'rest])
|
||||||
|
(syntax-case rest ()
|
||||||
|
[(ellipses . rest)
|
||||||
|
(and (identifier? #'ellipses)
|
||||||
|
(free-identifier=? #'ellipses #'(... ...)))
|
||||||
|
;; keep going:
|
||||||
|
(rloop #'rest)]
|
||||||
|
[else (loop rest #f #t)]))))]
|
||||||
[(a . b) (let ([a (loop #'a in-ellipses? #f)]
|
[(a . b) (let ([a (loop #'a in-ellipses? #f)]
|
||||||
[b (loop #'b in-ellipses? counting?)])
|
[b (loop #'b in-ellipses? counting?)])
|
||||||
(if (or a b counting?)
|
(if (or a b counting?)
|
||||||
|
|
|
@ -195,6 +195,14 @@
|
||||||
(test (syntax-case #'(1) ()
|
(test (syntax-case #'(1) ()
|
||||||
[(_) (syntax->datum #'_)])
|
[(_) (syntax->datum #'_)])
|
||||||
'_)
|
'_)
|
||||||
|
(test (syntax-case '((a) (b c)) ()
|
||||||
|
[((x ...) ...)
|
||||||
|
#'(x ... ...)])
|
||||||
|
'(a b c))
|
||||||
|
(test (syntax-case #'((a) (b c)) ()
|
||||||
|
[((x ...) ...)
|
||||||
|
(map syntax->datum #'(x ... ...))])
|
||||||
|
'(a b c))
|
||||||
|
|
||||||
(test (identifier? 'x) #f)
|
(test (identifier? 'x) #f)
|
||||||
(test (identifier? #'x) #t)
|
(test (identifier? #'x) #t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user