Track disappeared uses of match expanders within match forms (#1349)

This commit is contained in:
Alexis King 2016-06-27 11:13:12 -07:00 committed by Sam Tobin-Hochstadt
parent b9445023c1
commit 517c3cfef9
2 changed files with 64 additions and 63 deletions

View File

@ -21,6 +21,7 @@
;; this parses the clauses using parse, then compiles them
;; go : syntax syntax syntax -> syntax
(define (go parse stx es clauses)
(with-disappeared-uses
(syntax-parse clauses
[([pats . rhs] ...)
(parameterize ([orig-stx stx])
@ -81,4 +82,4 @@
(let ([xs exprs*] ...)
(define (outer-fail) raise-error)
body))
'feature-profile:pattern-matching #t)]))
'feature-profile:pattern-matching #t)])))

View File

@ -1,6 +1,7 @@
#lang racket/base
(require racket/struct-info
racket/syntax
"patterns.rkt"
"parse-helper.rkt"
"parse-quasi.rkt"
@ -29,8 +30,7 @@
(lambda (x y) (eq? (syntax-e x) (syntax-e y)))
[(expander args ...)
(and (identifier? #'expander)
(match-expander? (syntax-local-value #'expander
(lambda () #f))))
(syntax-local-value/record #'expander match-expander?))
(match-expander-transform
rearm+parse #'expander disarmed-stx match-expander-proc
"This expander only works with the legacy match syntax")]