Identifiers in the template should only match pattern variables

from the same expansion step.  Fixes issue #366.
This commit is contained in:
Alex Shinn 2016-06-25 15:20:39 +09:00
parent 6d6654fd13
commit d0cb74bef4
3 changed files with 11 additions and 5 deletions

View file

@ -1,4 +0,0 @@
language: c
compiler:
- clang
- gcc

View file

@ -848,7 +848,7 @@
(cond
((identifier? t)
(cond
((find (lambda (v) (compare t (car v))) vars)
((find (lambda (v) (eq? t (car v))) vars)
=> (lambda (cell)
(if (<= (cdr cell) dim)
t

View file

@ -499,6 +499,16 @@
#f)
(test 1 x))
(let ()
(define-syntax foo
(syntax-rules ()
((foo bar y)
(define-syntax bar
(syntax-rules ()
((bar x) 'y))))))
(foo bar x)
(test 'x (bar 1)))
(test-end)
(test-begin "5 Program structure")