diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2004-11-25 09:32:08 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2008-01-09 16:10:55 +0100 |
commit | deb1e064154ac11cb71fda3730dd122d5e09c5a8 (patch) | |
tree | 85a6794f8f89855c48a96f044a6ee268e2cb6659 /testsuite | |
parent | 2e543b5d13add8ed8f83a71ec5c31770700d7358 (diff) | |
download | sed-deb1e064154ac11cb71fda3730dd122d5e09c5a8.tar.gz |
speed up .{1,2048}
2004-11-23 Paolo Bonzini <bonzini@gnu.org>
* regcomp.c (analyze_tree): Always call calc_epsdest.
(calc_inveclosure): Use re_node_set_insert_last.
(parse_dup_op): Lower X{1,5} to (X(X(X(XX?)?)?)?)?
rather than X?X?X?X?X?.
* regex_internal.h (re_node_set_insert_last): New declaration.
* regex_internal.c (re_node_set_insert_last): New function.
* PCRE.tests: Add testcases.
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-22
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/PCRE.tests | 19 | ||||
-rw-r--r-- | testsuite/tst-regex.c | 2 |
2 files changed, 19 insertions, 2 deletions
diff --git a/testsuite/PCRE.tests b/testsuite/PCRE.tests index 7ea5b9e..0fb9cad 100644 --- a/testsuite/PCRE.tests +++ b/testsuite/PCRE.tests @@ -2365,3 +2365,22 @@ No match 0: bc123bc 1: bc 2: bc + +/^a{2,5}$/ + aa + 0: aa + aaa + 0: aaa + aaaa + 0: aaaa + aaaaa + 0: aaaaa + *** Failers +No match + a +No match + b +No match + aaaaab +No match + aaaaaa diff --git a/testsuite/tst-regex.c b/testsuite/tst-regex.c index a016f31..f29fc92 100644 --- a/testsuite/tst-regex.c +++ b/testsuite/tst-regex.c @@ -18,11 +18,9 @@ #include "config.h" -#define _GNU_SOURCE 1 #include <alloca.h> #include <assert.h> #include <errno.h> -#include <error.h> #include <fcntl.h> #include <iconv.h> #include <locale.h> |