Skip to content

Commit bed7000

Browse files
authored
Simplify/fix loop descriptions in regex source generator (#118341)
- There's no need to say "greedily and atomically"... "atomically" covers it. - "lazily and atomically" doesn't make sense... "lazily" covers it.
1 parent f981bc2 commit bed7000

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5813,9 +5813,8 @@ private static string DescribeLoop(RegexNode node, RegexMethod rm)
58135813
_ when node.M == node.N => "exactly",
58145814
RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloopatomic => "atomically",
58155815
RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop => "greedily",
5816-
RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy => "lazily",
5817-
RegexNodeKind.Loop => rm.Analysis.IsAtomicByAncestor(node) ? "greedily and atomically" : "greedily",
5818-
_ /* RegexNodeKind.Lazyloop */ => rm.Analysis.IsAtomicByAncestor(node) ? "lazily and atomically" : "lazily",
5816+
RegexNodeKind.Loop => rm.Analysis.IsAtomicByAncestor(node) ? "atomically" : "greedily",
5817+
_ => "lazily", // Onelazy or Notonelazy or Setlazy or Lazyloop
58195818
};
58205819

58215820
string bounds =

0 commit comments

Comments
 (0)