From e78faf06694703ec5beb2667603dee533b02763c Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 16 Oct 2009 21:33:57 +0000 Subject: [PATCH] fixed a bug that prevented uses of redex-match in the right-hand sides of reduction-relation definitions svn: r16344 --- collects/redex/private/reduction-semantics.ss | 4 ++-- collects/redex/private/tl-test.ss | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/collects/redex/private/reduction-semantics.ss b/collects/redex/private/reduction-semantics.ss index b914baafc5..c082c6546d 100644 --- a/collects/redex/private/reduction-semantics.ss +++ b/collects/redex/private/reduction-semantics.ss @@ -688,7 +688,7 @@ ;; are (morally) the same as the compile-pattern-bindings (bind-withs orig-name #'#t - lang + #'lang-id2 lang-nts sides/withs/freshs 'predicate @@ -741,7 +741,7 @@ (loop (cdr mtchs) acc)]))])) other-matches))))) name - (λ (lang) (let (test-case-compile-pattern-bindings ...) `lhs-w/extras)) + (λ (lang-id2) (let (test-case-compile-pattern-bindings ...) `lhs-w/extras)) lhs-source case-id))))))) diff --git a/collects/redex/private/tl-test.ss b/collects/redex/private/tl-test.ss index bda6a715f0..e6c82aa862 100644 --- a/collects/redex/private/tl-test.ss +++ b/collects/redex/private/tl-test.ss @@ -1203,6 +1203,17 @@ '(x y z)) (list '(x1 y1 z1 x y z))) + ;; test that redex match can be used in a side-condition + ;; with the same language that is used to define the + ;; reduction relation. + (test (apply-reduction-relation + (reduction-relation + empty-language + (--> any_1 3 + (side-condition (redex-match empty-language (any_1 any_2) (term any_1))))) + '(a b)) + '(3)) + (test (apply-reduction-relation (reduction-relation empty-language