From d6b20a51d23da039a510f2344f6611ac64cee800 Mon Sep 17 00:00:00 2001 From: Casey Klein Date: Mon, 21 Jun 2010 11:24:30 -0500 Subject: [PATCH] Lifts mysterious restriction on patterns that now seems unnecessary. --- collects/redex/private/matcher.rkt | 2 +- collects/redex/tests/matcher-test.rkt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/collects/redex/private/matcher.rkt b/collects/redex/private/matcher.rkt index 6d88b7df7f..3bbe9eb335 100644 --- a/collects/redex/private/matcher.rkt +++ b/collects/redex/private/matcher.rkt @@ -1449,7 +1449,7 @@ before the pattern compiler is invoked. [`(variable-prefix ,vars) ribs] [`variable-not-otherwise-mentioned ribs] - [`hole (error 'match-pattern "cannot have a hole inside an ellipses")] + [`hole ribs] [(? symbol?) (cond [(regexp-match #rx"_!_" (symbol->string pattern)) diff --git a/collects/redex/tests/matcher-test.rkt b/collects/redex/tests/matcher-test.rkt index b03703c25d..3e4eeac33f 100644 --- a/collects/redex/tests/matcher-test.rkt +++ b/collects/redex/tests/matcher-test.rkt @@ -185,6 +185,7 @@ (test-empty '((name x a) ...) '() (list (make-test-mtch (make-bindings (list (make-bind 'x '()))) '() none))) (test-empty '((name x a) ...) '(a) (list (make-test-mtch (make-bindings (list (make-bind 'x '(a)))) '(a) none))) (test-empty '((name x a) ...) '(a a) (list (make-test-mtch (make-bindings (list (make-bind 'x '(a a)))) '(a a) none))) + (test-empty '(hole ...) '() (list (make-test-mtch (make-bindings empty) '() none))) (test-empty '(b ... a ...) '() (list (make-test-mtch (make-bindings empty) '() none))) (test-empty '(b ... a ...) '(a) (list (make-test-mtch (make-bindings empty) '(a) none)))