File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 539539 (rule (sym-append 'lower-unsound- impl)
540540 (add-unsound spec-expr)
541541 impl-expr
542+ '(lowering))
543+ (rule (sym-append 'lower-sound- impl)
544+ (add-sound-with-wildcard spec-expr)
545+ impl-expr
542546 '(lowering))))))))
543547
544548;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Original file line number Diff line number Diff line change 88(provide *rules*
99 *sound-rules*
1010 (struct-out rule)
11- add-unsound)
11+ add-unsound
12+ add-sound-with-wildcard)
1213
1314;; A rule represents "find-and-replacing" `input` by `output`. Both
1415;; are patterns, meaning that symbols represent pattern variables.
3637 [(list op args ... ) (cons (sym-append "unsound- " op) (map add-unsound args))]
3738 [_ expr]))
3839
40+ (define (add-sound-with-wildcard expr)
41+ (match expr
42+ [(list op args ... )
43+ (cons (sym-append "sound- " op)
44+ (append (map add-sound-with-wildcard args) (list '_ )))]
45+ [_ expr]))
46+
3947(define-syntax define-rule
4048 (syntax-rules ()
4149 [(define-rule rname group input output)
You can’t perform that action at this time.
0 commit comments