add syntax locations to cond* macro

svn: r14868

original commit: f71249500992e1b9a0729b1340d7ecc20cd8d563
This commit is contained in:
Sam Tobin-Hochstadt 2009-05-19 15:23:57 +00:00
commit 164416b707
2 changed files with 7 additions and 4 deletions

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)

View File

@ -100,6 +100,8 @@
[(All (a ...) (a ... -> Number))
(-polydots (a) ((list) [a a] . ->... . N))]
[(Any -> Boolean : Number) (make-pred-ty -Number)]
))
;; FIXME - add tests for parse-values-type, parse-tc-results