mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8225198: Optimize regex tree for greedy quantifiers of type {N,}
Reviewed-by: redestad, bchristi
This commit is contained in:
parent
4098f0ecdd
commit
90e6c1cc36
2 changed files with 20 additions and 48 deletions
|
@ -195,7 +195,13 @@ class PrintPattern {
|
|||
pstr = gcp.predicate.toString();
|
||||
else
|
||||
pstr = "Single \"" + pstr + "\"";
|
||||
str = name + " " + pstr + ((gcp.cmin == 0) ? "*" : "+");
|
||||
str = name + " " + pstr;
|
||||
if (gcp.cmin == 0)
|
||||
str += "*";
|
||||
else if (gcp.cmin == 1)
|
||||
str += "+";
|
||||
else
|
||||
str += "{" + gcp.cmin + ",}";
|
||||
print(node, str, depth);
|
||||
} else if (node instanceof Pattern.BackRef) {
|
||||
str = "GroupBackRef " + ((Pattern.BackRef)node).groupIndex / 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue