63 references to One
System.Text.RegularExpressions.Generator (63)
RegexGenerator.Emitter.cs (8)
775else if (root.Kind is RegexNodeKind.Multi or RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set) 1909case RegexNodeKind.One: 1922case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi): 1980new(RegexNodeKind.One, multi.Options, multi.Str[1]) : 2937case RegexNodeKind.One: 3131int repeatCount = child.Kind is RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set ? 1 : child.M; 3500RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy => 5604RegexNodeKind.One => $"Match {Literal(node.Ch)}{direction}.",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (41)
121return new RegexNode(RegexNodeKind.One, options & ~RegexOptions.IgnoreCase, ch); 131return new RegexNode(RegexNodeKind.One, options, ch); 152Kind += kind - RegexNodeKind.One; 287case RegexNodeKind.One: 725case RegexNodeKind.One: 962case RegexNodeKind.One: 1026Kind == RegexNodeKind.Set ? RegexNodeKind.One : 1161else if (at.Kind is RegexNodeKind.Set or RegexNodeKind.One) 1190if (prev.Kind == RegexNodeKind.One) 1200if (at.Kind == RegexNodeKind.One) 1263case RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set: 1414if (startingNode.Kind == RegexNodeKind.One) 1434if (startingNode.Kind == RegexNodeKind.One) 1479new RegexNode(RegexNodeKind.One, startingNodeOptions, startingSpan[0]) : 1493if (node.Kind == RegexNodeKind.One) 1511node.Kind = RegexNodeKind.One; 1551return branch.Kind is RegexNodeKind.One or RegexNodeKind.Multi ? branch : null; 1557Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1642case RegexNodeKind.One: 1677case RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy: 1820else if (at.Kind is RegexNodeKind.Multi or RegexNodeKind.One) 1834if (prev.Kind == RegexNodeKind.One) 1841((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1842((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1931case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.One && currentNode.Ch == nextNode.Ch: 1981nextNode.Kind = RegexNodeKind.One; 1999case RegexNodeKind.One when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch: 2159RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set && 2413case RegexNodeKind.One when CharInLoopSet(loopNode, literal.Ch): // e.g. \w+a\s : 'a' is in \w, check \s is disjoint 2538case RegexNodeKind.One when node.Ch != subsequent.Ch: 2568case RegexNodeKind.One when node.Ch == subsequent.Ch: 2587case RegexNodeKind.One when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2634case RegexNodeKind.One when !CharInStartingOrEndingSet(subsequent.Ch): 2843case RegexNodeKind.One: 2956case RegexNodeKind.One: 3133if (child.Kind is RegexNodeKind.One) 3245RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set => true, 3297case <= MultiVsRepeaterLimit when Kind == RegexNodeKind.One: 3312case RegexNodeKind.One: 3453public bool IsOneFamily => Kind is RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy; 3513case RegexNodeKind.One:
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNodeKind.cs (3)
26/// <remarks>The characters are specified in <see cref="RegexNode.Str"/>. This is purely a representational optimization, equivalent to multiple <see cref="One"/> nodes concatenated together.</remarks> 32/// This is purely a representational optimization, equivalent to a <see cref="Loop"/> wrapped around a <see cref="One"/>. 46/// This is purely a representational optimization, equivalent to a <see cref="Lazyloop"/> wrapped around a <see cref="One"/>.
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (4)
1742lookbehindCr.AddChild(new RegexNode(RegexNodeKind.One, lookbehindOptsNoCase, '\r')); 1747crThenLf.AddChild(new RegexNode(RegexNodeKind.One, lookaheadOptsNoCase, '\n')); 1770crlfEnd.AddChild(new RegexNode(RegexNodeKind.One, lookaheadOptsNoCase, '\r')); 1771crlfEnd.AddChild(new RegexNode(RegexNodeKind.One, lookaheadOptsNoCase, '\n'));
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (7)
112case RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Onelazy or RegexNodeKind.Oneloopatomic when !ignoreCase || !RegexCharClass.ParticipatesInCaseConversion(node.Ch): 114int reps = node.Kind is RegexNodeKind.One ? 1 : Math.Min(node.M, MaxPrefixLength); 119return node.Kind is RegexNodeKind.One || reps == node.N; 422case RegexNodeKind.One: 600case RegexNodeKind.One: 954case RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Onelazy or RegexNodeKind.Oneloopatomic: 959return node.Kind is RegexNodeKind.One || node.M > 0 ? true : null;