From bbcd99e53750c6a6a75cb2410ebaa582db2d442a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 22 Sep 2006 01:59:40 +0000 Subject: [PATCH] allow regexps for pregexp pattern in match svn: r4410 --- collects/mzlib/private/match/match-error.ss | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/collects/mzlib/private/match/match-error.ss b/collects/mzlib/private/match/match-error.ss index b0de1cb7de..4dfd259389 100644 --- a/collects/mzlib/private/match/match-error.ss +++ b/collects/mzlib/private/match/match-error.ss @@ -64,14 +64,15 @@ ;; this makes pregexp errors a little more friendly (define (pregexp-match-with-error regex str) (if (or (string? regex) - (and (pair? regex) - (equal? ':sub (car regex)))) + (bytes? regex) + (regexp? regex) + (byte-regexp? regex)) (pregexp-match regex str) (error 'match:pregex (string-append - "this pattern expects either a S-regexp or a U-regexp," - " given " (format "~s" regex) "; " - "other argument was " (format "~s" str))))) + "this pattern expects either a string, byte string, regexp or byte regexp," + " given " (format "~e" regex) "; " + "other argument was " (format "~e" str))))) - ) \ No newline at end of file + )