diff --git a/racket/collects/racket/match/compiler.rkt b/racket/collects/racket/match/compiler.rkt index 1a08c5ef75..55e59fd3d2 100644 --- a/racket/collects/racket/match/compiler.rkt +++ b/racket/collects/racket/match/compiler.rkt @@ -428,13 +428,16 @@ ([fail (make-rename-transformer (quote-syntax #,esc))]) #,(Row-rhs (car blocks)))]) - (if (Row-unmatch (car blocks)) - #`(call-with-continuation-prompt - (lambda () (let ([#,(Row-unmatch (car blocks)) - (lambda () (abort-current-continuation match-prompt-tag))]) + (define unmatch (Row-unmatch (car blocks))) + (if unmatch + (quasisyntax/loc unmatch + (call-with-continuation-prompt + (lambda () (let ([#,unmatch + (lambda () + (abort-current-continuation match-prompt-tag))]) rhs)) match-prompt-tag - (lambda () (#,esc))) + (lambda () (#,esc)))) #'rhs))]) ;; then compile the rest, with our name as the esc (loop (cdr blocks) #'f (cons #'[f (lambda () c)] acc)))))]) diff --git a/racket/collects/racket/match/gen-match.rkt b/racket/collects/racket/match/gen-match.rkt index 393cde3820..742cdb1443 100644 --- a/racket/collects/racket/match/gen-match.rkt +++ b/racket/collects/racket/match/gen-match.rkt @@ -55,7 +55,11 @@ 'match (format "wrong number of match clauses, expected ~a and got ~a" len lp) pats)) (define (mk unm rhs) (make-Row (for/list ([p (syntax->list pats)]) (parse p)) - #`(let () . #,rhs) unm null)) + (syntax-property + (quasisyntax/loc stx + (let () . #,rhs)) + 'feature-profile:pattern-matching 'antimark) + unm null)) (syntax-parse rhs [() (raise-syntax-error @@ -72,7 +76,12 @@ [_ (mk #f rhs)]))) (define/with-syntax body (compile* (syntax->list #'(xs ...)) parsed-clauses #'outer-fail)) - (quasisyntax/loc stx - (let ([xs exprs] ...) + (define/with-syntax (exprs* ...) + (for/list ([e (in-list (syntax->list #'(exprs ...)))]) + (syntax-property e 'feature-profile:pattern-matching 'antimark))) + (syntax-property + (quasisyntax/loc stx + (let ([xs exprs*] ...) (define (outer-fail) raise-error) - body))])) + body)) + 'feature-profile:pattern-matching #t)]))