56 references to One
System.Text.RegularExpressions.Generator (56)
RegexGenerator.Emitter.cs (7)
774
else if (root.Kind is RegexNodeKind.Multi or RegexNodeKind.
One
or RegexNodeKind.Notone or RegexNodeKind.Set)
1906
case RegexNodeKind.
One
:
1919
case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.
One
or RegexNodeKind.Set or RegexNodeKind.Multi):
1977
new(RegexNodeKind.
One
, multi.Options, multi.Str[1]) :
2934
case RegexNodeKind.
One
:
3128
int repeatCount = child.Kind is RegexNodeKind.
One
or RegexNodeKind.Notone or RegexNodeKind.Set ? 1 : child.M;
5561
RegexNodeKind.
One
=> $"Match {Literal(node.Ch)}{direction}.",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (39)
121
return new RegexNode(RegexNodeKind.
One
, options & ~RegexOptions.IgnoreCase, ch);
131
return new RegexNode(RegexNodeKind.
One
, options, ch);
152
Kind += kind - RegexNodeKind.
One
;
287
case RegexNodeKind.
One
:
907
case RegexNodeKind.
One
:
971
Kind == RegexNodeKind.Set ? RegexNodeKind.
One
:
1106
else if (at.Kind is RegexNodeKind.Set or RegexNodeKind.
One
)
1135
if (prev.Kind == RegexNodeKind.
One
)
1145
if (at.Kind == RegexNodeKind.
One
)
1216
case RegexNodeKind.
One
or RegexNodeKind.Notone or RegexNodeKind.Set:
1355
if (startingNode.Kind == RegexNodeKind.
One
)
1375
if (startingNode.Kind == RegexNodeKind.
One
)
1420
new RegexNode(RegexNodeKind.
One
, startingNodeOptions, startingSpan[0]) :
1434
if (node.Kind == RegexNodeKind.
One
)
1452
node.Kind = RegexNodeKind.
One
;
1492
return branch.Kind is RegexNodeKind.
One
or RegexNodeKind.Multi ? branch : null;
1498
Debug.Assert(Kind is RegexNodeKind.
One
or RegexNodeKind.Multi || (IsOneFamily && M > 0));
1583
case RegexNodeKind.
One
:
1618
case RegexNodeKind.
One
or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy:
1761
else if (at.Kind is RegexNodeKind.Multi or RegexNodeKind.
One
)
1775
if (prev.Kind == RegexNodeKind.
One
)
1782
((at.Kind == RegexNodeKind.
One
) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) :
1783
((at.Kind == RegexNodeKind.
One
) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str);
1872
case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.
One
&& currentNode.Ch == nextNode.Ch:
1922
nextNode.Kind = RegexNodeKind.
One
;
1940
case RegexNodeKind.
One
when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch:
2094
RegexNodeKind.
One
or RegexNodeKind.Notone or RegexNodeKind.Set)
2415
case RegexNodeKind.
One
when node.Ch != subsequent.Ch:
2445
case RegexNodeKind.
One
when node.Ch == subsequent.Ch:
2464
case RegexNodeKind.
One
when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!):
2511
case RegexNodeKind.
One
when !CharInStartingOrEndingSet(subsequent.Ch):
2653
case RegexNodeKind.
One
:
2766
case RegexNodeKind.
One
:
2920
if (child.Kind is RegexNodeKind.
One
)
3012
RegexNodeKind.
One
or RegexNodeKind.Notone or RegexNodeKind.Set => true,
3064
case <= MultiVsRepeaterLimit when Kind == RegexNodeKind.
One
:
3079
case RegexNodeKind.
One
:
3212
public bool IsOneFamily => Kind is RegexNodeKind.
One
or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy;
3272
case 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)
112
case RegexNodeKind.
One
or RegexNodeKind.Oneloop or RegexNodeKind.Onelazy or RegexNodeKind.Oneloopatomic when !ignoreCase || !RegexCharClass.ParticipatesInCaseConversion(node.Ch):
114
int reps = node.Kind is RegexNodeKind.
One
? 1 : Math.Min(node.M, MaxPrefixLength);
119
return node.Kind is RegexNodeKind.
One
|| reps == node.N;
422
case RegexNodeKind.
One
:
600
case RegexNodeKind.
One
:
954
case RegexNodeKind.
One
or RegexNodeKind.Oneloop or RegexNodeKind.Onelazy or RegexNodeKind.Oneloopatomic:
959
return node.Kind is RegexNodeKind.
One
|| node.M > 0 ? true : null;