syntax-parse: improved error for non-syntax attribute in syntax template

This commit is contained in:
Ryan Culpepper 2010-11-11 14:47:52 -07:00
parent eeb7facdd6
commit a2c4574688

View File

@ -130,7 +130,11 @@
(raise-syntax-error
#f
(format "attribute is bound to non-syntax value: ~e" value)
(quote-syntax #,(attribute-mapping-name self)))))))))
(quote-syntax #,(or (let loop ([p (syntax-property stx 'disappeared-use)])
(cond [(identifier? p) p]
[(pair? p) (or (loop (car p)) (loop (cdr p)))]
[else #f]))
(attribute-mapping-name self))))))))))
;; check-syntax : nat any -> boolean
;; Returns #t if value is a (listof^depth syntax)