fix size calculation of ? repeat

svn: r8208
This commit is contained in:
Matthew Flatt 2008-01-04 17:05:10 +00:00
parent 90f8b75f33
commit 77e126f085
2 changed files with 6 additions and 0 deletions

View File

@ -795,6 +795,8 @@
(#"[\1]" #"\1" (#"\1"))
(#"\\10()()()()()()()()()()" #"a" #f)
(#"a(?<=)b" #"ab" (#"ab")) ;; << added "=" to pattern
(#"(?<=qq)b*" #"aqbbbqqbb" (#"bb")) ;; << added
(#"(?<=q?q)b*" #"aqbbbqqbb" (#"bbb")) ;; << added
(#"()" #"a" (#"" #""))
#"[\\x]"
#"[\\x]"

View File

@ -848,6 +848,10 @@ regpiece(int *flagp, int parse_flags, int at_start)
} else
*flagp = (op != '+') ? WORST : HASWIDTH;
*flagp |= SPSTART;
if ((op == '?') && (flags & SPFIXED)) {
*flagp |= SPFIXED;
regmatchmin = 0;
}
if (regparsestr[regparse+1] == '?') {
greedy = 0;