|
|
@ -22,13 +22,13 @@
|
|
|
|
pat-arg))
|
|
|
|
pat-arg))
|
|
|
|
|
|
|
|
|
|
|
|
(define (generate-bound-and-unbound-literals pats #:treat-as-bound [bound-id #f])
|
|
|
|
(define (generate-bound-and-unbound-literals pats #:treat-as-bound [bound-id #f])
|
|
|
|
|
|
|
|
(define literals (generate-literals pats))
|
|
|
|
(define-values (bound-literals unbound-literals)
|
|
|
|
(define-values (bound-literals unbound-literals)
|
|
|
|
(partition identifier-binding (for/list ([pat (in-list (generate-literals pats))]
|
|
|
|
(partition (λ (i) (or (identifier-binding i)
|
|
|
|
#:unless (and bound-id (bound-identifier=? pat bound-id)))
|
|
|
|
(and bound-id (bound-identifier=? i bound-id)))) literals))
|
|
|
|
pat)))
|
|
|
|
|
|
|
|
;; return as list of two lists so it's easy to match them in syntax pattern
|
|
|
|
;; return as list of two lists so it's easy to match them in syntax pattern
|
|
|
|
(list (if bound-id (cons bound-id bound-literals) bound-literals)
|
|
|
|
;; `syntax-parse` crabs if there are any duplicate ids, so remove them
|
|
|
|
unbound-literals))
|
|
|
|
(map (λ (ids) (remove-duplicates ids bound-identifier=?)) (list bound-literals unbound-literals)))
|
|
|
|
|
|
|
|
|
|
|
|
(define (all-...-follow-wildcards pats)
|
|
|
|
(define (all-...-follow-wildcards pats)
|
|
|
|
(define prev-datum (box #f))
|
|
|
|
(define prev-datum (box #f))
|
|
|
|