Add disappeared-use properties for struct ids.

Fix bug with handling of identifier as second arg to `define-match-expander'

svn: r16201
This commit is contained in:
Sam Tobin-Hochstadt 2009-10-01 18:59:12 +00:00
parent 224a9546b8
commit 65d804d286
2 changed files with 24 additions and 20 deletions

View File

@ -1,5 +1,4 @@
#lang scheme/base
(module match scheme/base
(require scheme/match/match (require scheme/match/match
(for-syntax scheme/base)) (for-syntax scheme/base))
(provide (except-out (all-from-out scheme/match/match) (provide (except-out (all-from-out scheme/match/match)
@ -18,5 +17,5 @@
[(_ id expr expr2) (define-match-expander id [(_ id expr expr2) (define-match-expander id
expr expr
no-old-match-form no-old-match-form
expr2)]))) (#%expression expr2))]))

View File

@ -93,7 +93,12 @@
[acc (cond [(null? acc) acc] [acc (cond [(null? acc) acc]
[(not (car acc)) (cdr acc)] [(not (car acc)) (cdr acc)]
[else acc])]) [else acc])])
(make-Struct id pred (get-lineage (cert struct-name)) acc (make-Struct id
(syntax-property
pred
'disappeared-use (list struct-name))
(get-lineage (cert struct-name))
acc
(cond [(eq? '_ (syntax-e pats)) (cond [(eq? '_ (syntax-e pats))
(map make-Dummy acc)] (map make-Dummy acc)]
[(syntax->list pats) [(syntax->list pats)