Add source locations in match -> match* conversion
This commit is contained in:
parent
561fdc8db5
commit
7802f1deb7
|
@ -9,10 +9,14 @@
|
|||
;; this transforms `match'-style clauses into ones acceptable to `go'
|
||||
;; go : syntax syntax syntax [certifier] -> syntax
|
||||
(define (go/one parse/cert stx expr clauses [cert (syntax-local-certifier)])
|
||||
(define-syntax-class cl
|
||||
(pattern [p . rhs]
|
||||
#:with res (syntax/loc this-syntax [(p) . rhs])))
|
||||
(syntax-parse clauses
|
||||
[([p . rhs] ...)
|
||||
[(c:cl ...)
|
||||
(go parse/cert stx (quasisyntax/loc expr (#,expr))
|
||||
#'([(p) . rhs] ...) cert)]))
|
||||
#'(c.res ...)
|
||||
cert)]))
|
||||
|
||||
;; this parses the clauses using parse/cert, then compiles them
|
||||
;; go : syntax syntax syntax [certifier] -> syntax
|
||||
|
|
Loading…
Reference in New Issue
Block a user