diff --git a/collects/redex/private/reduction-semantics.ss b/collects/redex/private/reduction-semantics.ss index 3035a74eff..b571764bbc 100644 --- a/collects/redex/private/reduction-semantics.ss +++ b/collects/redex/private/reduction-semantics.ss @@ -38,21 +38,22 @@ #'(let ([lang-x lang]) (let ([cp-x (compile-pattern lang-x `side-conditions-rewritten #t)] ...) (λ (exp) - (let/ec k - (let ([match (match-pattern cp-x exp)]) - (when match - (unless (null? (cdr match)) - (redex-error - 'term-match/single - "pattern ~s matched term ~e multiple ways" - 'pattern - exp)) - (k (term-let/error-name - term-match/single - ([names/ellipses (lookup-binding (mtch-bindings (car match)) 'names)] ...) - rhs)))) - ... - (redex-error 'term-match/single "no patterns matched ~e" exp))))))))])) + ((let/ec k + (let ([match (match-pattern cp-x exp)]) + (when match + (unless (null? (cdr match)) + (redex-error + 'term-match/single + "pattern ~s matched term ~e multiple ways" + 'pattern + exp)) + (k (λ () + (term-let/error-name + term-match/single + ([names/ellipses (lookup-binding (mtch-bindings (car match)) 'names)] ...) + rhs))))) + ... + (redex-error 'term-match/single "no patterns matched ~e" exp)))))))))])) (define-syntax (term-match stx) (syntax-case stx () diff --git a/collects/redex/private/tl-test.ss b/collects/redex/private/tl-test.ss index 4dc69b3a85..a1b345baf8 100644 --- a/collects/redex/private/tl-test.ss +++ b/collects/redex/private/tl-test.ss @@ -1344,6 +1344,14 @@ '(1 1)) 1) + (test (call-with-values + (λ () + ((term-match/single empty-language + [() (values 1 2)]) + '())) + list) + '(1 2)) + (test (let ([x 0]) (cons ((term-match empty-language [(any_a ... number_1 any_b ...)