correct a source location

pull/12/merge
Matthew Butterick 8 years ago
parent 1e7d5867a4
commit fd6c7426c4

@ -30,8 +30,9 @@
[(_ id-exp maybe-contract body-exp (... ...)) ; matches two, or four or more [(_ id-exp maybe-contract body-exp (... ...)) ; matches two, or four or more
(with-syntax ([(id (lambda args contract body-exp (... ...))) (values->list (normalize-definition stx (datum->syntax #'id-exp 'λ) #t #t))]) (with-syntax ([(id (lambda args contract body-exp (... ...))) (values->list (normalize-definition stx (datum->syntax #'id-exp 'λ) #t #t))])
;; lambda-exp = #'(lambda args body-exp (... ...)) ;; because the macro provides the `lambda` below, it takes the local srcloc by default
#'(id contract (lambda args body-exp (... ...))))] ;; so `syntax/loc` applies the original srcloc (associated with args and body-exp)
#`(id contract #,(syntax/loc stx (lambda args body-exp (... ...)))))]
[else ; matches zero or one arugments [else ; matches zero or one arugments
(error 'define-macro "not enough arguments")])) (error 'define-macro "not enough arguments")]))

Loading…
Cancel
Save