add syntax locations to cond* macro

svn: r14868
This commit is contained in:
Sam Tobin-Hochstadt 2009-05-19 15:23:57 +00:00
parent 676f827ab0
commit f712495009

View File

@ -17,10 +17,11 @@
(define-syntax (cond* stx)
(syntax-case stx (else)
[(_ [pred expr id rhs] . rest)
#'(let ([id expr])
(if (pred id)
rhs
(cond . rest)))]
(quasisyntax/loc stx
(let ([id expr])
(if (pred id)
rhs
#,(syntax/loc #'rest (cond . rest)))))]
[(_ [else . rest]) #'(begin . rest)]
[(_ [p . rhs] . rest)
#'(if p (begin . rhs)