9 writes to Ch
System.Text.RegularExpressions.Generator (9)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (9)
61Ch = ch; 191Ch = '\0'; 199Ch = '\0'; 968Ch = RegexCharClass.SingletonChar(Str); 978Ch = RegexCharClass.SingletonChar(Str); 1440node.Ch = '\0'; 1454node.Ch = node.Str[node.Str.Length - 1]; 1924nextNode.Ch = nextNode.Str[nextNode.Str.Length - 1]; 3125Ch = '\0';
114 references to Ch
System.Text.RegularExpressions.Generator (114)
RegexGenerator.Emitter.cs (25)
3212$"{expr} {(node.IsOneFamily ? "!=" : "==")} {Literal(node.Ch)}"; 3644(literal.Range.LowInclusive <= node.Ch && node.Ch <= literal.Range.HighInclusive))) // for ranges, only allow when the range overlaps with the target, since there's no accelerated way to search for the union 3656overlap = literal.String[0] == node.Ch; 3658$"{startingPos} = {sliceSpan}.IndexOf({Literal(node.Ch)});" : 3659$"{startingPos} = {sliceSpan}.IndexOfAny({Literal(node.Ch)}, {Literal(literal.String[0])});"); 3663overlap = literal.SetChars.Contains(node.Ch); 3670(false, 2) => $"{startingPos} = {sliceSpan}.IndexOfAny({Literal(node.Ch)}, {Literal(literal.SetChars[0])}, {Literal(literal.SetChars[1])});", 3671(false, _) => $"{startingPos} = {sliceSpan}.IndexOfAny({EmitSearchValuesOrLiteral($"{node.Ch}{literal.SetChars}".AsSpan(), requiredHelpers)});", 3676overlap = literal.Range.LowInclusive == node.Ch; 3678$"{startingPos} = {sliceSpan}.IndexOf({Literal(node.Ch)});" : 3679$"{startingPos} = {sliceSpan}.IndexOfAny({Literal(node.Ch)}, {Literal(literal.Range.LowInclusive)});"); 3696$"if ((uint){startingPos} >= (uint){sliceSpan}.Length || {sliceSpan}[{startingPos}] == {Literal(node.Ch)})")) 4103EmitMultiCharString(new string(node.Ch, iterations), emitLengthCheck, clauseOnly: false, rtl); 4243$"{expr} {(node.IsOneFamily ? "==" : "!=")} {Literal(node.Ch)}"; 4288$"{expr} {(node.IsOneFamily ? "==" : "!=")} {Literal(node.Ch)}"; 4351$"{expr} {(node.IsOneFamily ? "==" : "!=")} {Literal(node.Ch)}"; 5026indexOfExpr = negate ? $"{last}IndexOfAnyExcept({Literal(node.Ch)})" : $"{last}IndexOf({Literal(node.Ch)})"; 5033indexOfExpr = negate ? $"{last}IndexOf({Literal(node.Ch)})" : $"{last}IndexOfAnyExcept({Literal(node.Ch)})"; 5560RegexNodeKind.Notone => $"Match any character other than {Literal(node.Ch)}{direction}.", 5561RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy => $"Match a character other than {Literal(node.Ch)} {DescribeLoop(node, rm)}{direction}.", 5562RegexNodeKind.One => $"Match {Literal(node.Ch)}{direction}.", 5563RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy => $"Match {Literal(node.Ch)} {DescribeLoop(node, rm)}{direction}.",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (70)
96new RegexNode(Kind, Options, Ch); 198Str = new string(Ch, N); 1138prevCharClass.AddChar(prev.Ch); 1147prevCharClass.AddChar(at.Ch); 1231required.Ch != other.Ch || 1358scratchChar[0] = startingNode.Ch; 1378if (startingSpan[0] != startingNode.Ch) 1438Debug.Assert(startingSpan[0] == node.Ch); 1501return IsOneFamily ? Ch : Str![0]; 1620return new StartingLiteralData(range: (node.Ch, node.Ch), negated: false); 1623return new StartingLiteralData(range: (node.Ch, node.Ch), negated: true); 1779prev.Str = prev.Ch.ToString(); 1783((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1784((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1847case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy when nextNode.Kind == currentNode.Kind && currentNode.Ch == nextNode.Ch: 1873case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.One && currentNode.Ch == nextNode.Ch: 1874case RegexNodeKind.Notoneloop or RegexNodeKind.Notonelazy when nextNode.Kind == RegexNodeKind.Notone && currentNode.Ch == nextNode.Ch: 1892currentNode.Ch == nextNode.Str![0]: 1897while (matchingCharsInMulti < nextNode.Str.Length && currentNode.Ch == nextNode.Str[matchingCharsInMulti]) 1941case RegexNodeKind.One when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch: 1942case RegexNodeKind.Notone when (nextNode.Kind is RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy) && currentNode.Ch == nextNode.Ch: 1956case RegexNodeKind.Notone when nextNode.Kind == currentNode.Kind && currentNode.Ch == nextNode.Ch: 2422case RegexNodeKind.One when node.Ch != subsequent.Ch: 2423case RegexNodeKind.Notone when node.Ch == subsequent.Ch: 2424case RegexNodeKind.Set when !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2425case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && node.Ch != subsequent.Ch: 2426case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when subsequent.M > 0 && node.Ch == subsequent.Ch: 2427case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2428case RegexNodeKind.Multi when node.Ch != subsequent.Str![0]: 2430case RegexNodeKind.EndZ or RegexNodeKind.Eol when node.Ch != '\n': 2431case RegexNodeKind.Boundary when node.M > 0 && RegexCharClass.IsBoundaryWordChar(node.Ch): 2432case RegexNodeKind.NonBoundary when node.M > 0 && !RegexCharClass.IsBoundaryWordChar(node.Ch): 2433case RegexNodeKind.ECMABoundary when node.M > 0 && RegexCharClass.IsECMAWordChar(node.Ch): 2434case RegexNodeKind.NonECMABoundary when node.M > 0 && !RegexCharClass.IsECMAWordChar(node.Ch): 2437case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && node.Ch != subsequent.Ch: 2438case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when subsequent.M == 0 && node.Ch == subsequent.Ch: 2439case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2452case RegexNodeKind.One when node.Ch == subsequent.Ch: 2453case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && node.Ch == subsequent.Ch: 2454case RegexNodeKind.Multi when node.Ch == subsequent.Str![0]: 2458case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && node.Ch == subsequent.Ch: 2471case RegexNodeKind.One when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2473case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2484case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2518case RegexNodeKind.One when !CharInStartingOrEndingSet(subsequent.Ch): 2520case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && !CharInStartingOrEndingSet(subsequent.Ch): 2531case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && !CharInStartingOrEndingSet(subsequent.Ch): 2978if (child.Ch >= 128 || 2979RegexCharClass.ParticipatesInCaseConversion(child.Ch)) 2984vsb.Append(child.Ch); 3124Str = new string(Ch, max); 3327sb.Append(" '").Append(RegexCharClass.DescribeChar(Ch)).Append('\'');
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNodeKind.cs (8)
16/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>.</remarks> 19/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>.</remarks> 31/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 36/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 45/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 49/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 59/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 65/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (11)
112case RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Onelazy or RegexNodeKind.Oneloopatomic when !ignoreCase || !RegexCharClass.ParticipatesInCaseConversion(node.Ch): 117sb.Append(node.Ch, reps); 423vsb.Append(node.Ch); 435vsb.Append(node.Ch, count); 603string setString = RegexCharClass.OneToStringClass(node.Ch); 611string setString = RegexCharClass.OneToStringClass(node.Ch); 958cc.AddChar(node.Ch); 967if (node.Ch > 0) 970cc.AddRange((char)0, (char)(node.Ch - 1)); 972if (node.Ch < char.MaxValue) 975cc.AddRange((char)(node.Ch + 1), char.MaxValue);