56 references to One
System.Text.RegularExpressions.Generator (56)
RegexGenerator.Emitter.cs (7)
748else if (root.Kind is RegexNodeKind.Multi or RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set) 1920case RegexNodeKind.One: 1933case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi): 1989new(RegexNodeKind.One, multi.Options, multi.Str[1]) : 2966case RegexNodeKind.One: 3159int repeatCount = child.Kind is RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set ? 1 : child.M; 5592RegexNodeKind.One => $"Match {Literal(node.Ch)}{direction}.",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (39)
121return new RegexNode(RegexNodeKind.One, options & ~RegexOptions.IgnoreCase, ch); 131return new RegexNode(RegexNodeKind.One, options, ch); 152Kind += kind - RegexNodeKind.One; 287case RegexNodeKind.One: 907case RegexNodeKind.One: 971Kind == RegexNodeKind.Set ? RegexNodeKind.One : 1106else if (at.Kind is RegexNodeKind.Set or RegexNodeKind.One or RegexNodeKind.Notone) 1135if (prev.Kind == RegexNodeKind.One) 1150if (at.Kind == RegexNodeKind.One) 1225case RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set: 1364if (startingNode.Kind == RegexNodeKind.One) 1384if (startingNode.Kind == RegexNodeKind.One) 1429new RegexNode(RegexNodeKind.One, startingNodeOptions, startingSpan[0]) : 1443if (node.Kind == RegexNodeKind.One) 1461node.Kind = RegexNodeKind.One; 1501return branch.Kind is RegexNodeKind.One or RegexNodeKind.Multi ? branch : null; 1507Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1522case RegexNodeKind.One: 1557case RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy: 1700else if (at.Kind is RegexNodeKind.Multi or RegexNodeKind.One) 1714if (prev.Kind == RegexNodeKind.One) 1721((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1722((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1811case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.One && currentNode.Ch == nextNode.Ch: 1861nextNode.Kind = RegexNodeKind.One; 1879case RegexNodeKind.One when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch: 2033RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set) 2350case RegexNodeKind.One when node.Ch != subsequent.Ch: 2380case RegexNodeKind.One when node.Ch == subsequent.Ch: 2399case RegexNodeKind.One when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2446case RegexNodeKind.One when !CharInStartingOrEndingSet(subsequent.Ch): 2588case RegexNodeKind.One: 2701case RegexNodeKind.One: 2855if (child.Kind is RegexNodeKind.One) 2947RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set => true, 2999case <= MultiVsRepeaterLimit when Kind == RegexNodeKind.One: 3014case RegexNodeKind.One: 3147public bool IsOneFamily => Kind is RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy; 3207case 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\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;