2 writes to _currentToken
Microsoft.CodeAnalysis.Features (2)
EmbeddedLanguages\RegularExpressions\RegexParser.cs (2)
119
_currentToken
= _lexer.ScanNextToken(allowTrivia, _options);
476
_currentToken
= openBraceToken;
93 references to _currentToken
Microsoft.CodeAnalysis.Features (93)
EmbeddedLanguages\RegularExpressions\RegexParser.cs (93)
118
var previous =
_currentToken
;
170
Debug.Assert(
_currentToken
.Kind == RegexKind.EndOfFile);
172
var root = new RegexCompilationUnit(expression,
_currentToken
);
268
while (
_currentToken
.Kind == RegexKind.BarToken)
398
if (
_currentToken
.Kind == RegexKind.EndOfFile)
403
if (
_currentToken
.Kind == RegexKind.BarToken)
408
if (
_currentToken
.Kind == RegexKind.CloseParenToken)
425
return
_currentToken
.Kind switch
430
RegexKind.OpenBraceToken => TryParseNumericQuantifier(current,
_currentToken
),
437
if (
_currentToken
.Kind != RegexKind.QuestionToken)
523
if (
_currentToken
.Kind == RegexKind.CommaToken)
525
commaToken =
_currentToken
;
555
if (
_currentToken
.Kind != RegexKind.CloseBraceToken)
573
return
_currentToken
.Kind switch
578
RegexKind.BackslashToken => ParseEscape(
_currentToken
, allowTriviaAfterEnd: true),
593
var openBraceToken =
_currentToken
.With(kind: RegexKind.TextToken);
611
var token =
_currentToken
.With(kind: RegexKind.TextToken).AddDiagnosticIfNone(
612
new EmbeddedDiagnostic(FeaturesResources.Too_many_close_parens,
_currentToken
.GetSpan()));
656
switch (
_currentToken
.Kind)
659
return ParseGroupQuestion(openParenToken,
_currentToken
);
670
switch (
_currentToken
.Kind)
678
new EmbeddedDiagnostic(FeaturesResources.Not_enough_close_parens, GetTokenStartPositionSpan(
_currentToken
)));
729
switch (
_currentToken
.Kind)
738
openParenToken, questionToken,
_currentToken
);
757
if (
_currentToken
.Kind != RegexKind.CloseParenToken)
777
var innerOpenParenToken =
_currentToken
;
800
if (
_currentToken
.Kind == RegexKind.CloseParenToken)
802
innerCloseParenToken =
_currentToken
;
833
if (
_currentToken
.Kind != RegexKind.CloseParenToken)
839
innerCloseParenToken =
_currentToken
;
862
if (
_currentToken
.Kind != RegexKind.EndOfFile)
915
Debug.Assert(
_currentToken
.Kind == RegexKind.OpenParenToken);
947
switch (
_currentToken
.Kind)
951
openParenToken, questionToken, lessThanToken,
_currentToken
,
956
openParenToken, questionToken, lessThanToken,
_currentToken
,
985
if (
_currentToken
.Kind == RegexKind.MinusToken)
994
GetTokenSpanIncludingEOF(
_currentToken
)));
1013
if (
_currentToken
.Kind == RegexKind.MinusToken)
1031
if ((openToken.Kind == RegexKind.LessThanToken &&
_currentToken
.Kind == RegexKind.GreaterThanToken) ||
1032
(openToken.Kind == RegexKind.SingleQuoteToken &&
_currentToken
.Kind == RegexKind.SingleQuoteToken))
1034
return
_currentToken
;
1037
if (
_currentToken
.Kind == RegexKind.EndOfFile)
1047
_currentToken
.GetSpan()));
1062
var minusToken =
_currentToken
;
1071
GetTokenSpanIncludingEOF(
_currentToken
)));
1124
openParenToken, questionToken,
_currentToken
,
1129
openParenToken, questionToken,
_currentToken
,
1134
openParenToken, questionToken,
_currentToken
,
1139
openParenToken, questionToken,
_currentToken
,
1147
switch (
_currentToken
.Kind)
1170
openParenToken, questionToken, optionsToken,
_currentToken
,
1220
var openBracketToken =
_currentToken
;
1227
if (
_currentToken
.Kind == RegexKind.CaretToken)
1229
caretToken =
_currentToken
;
1240
while (
_currentToken
.Kind != RegexKind.EndOfFile)
1242
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1244
if (
_currentToken
.Kind == RegexKind.CloseBracketToken && builder.Count > 0)
1263
GetTokenStartPositionSpan(
_currentToken
)));
1284
if (
_currentToken
.Kind == RegexKind.MinusToken && !_lexer.IsAt("]"))
1289
if (
_currentToken
.Kind == RegexKind.OpenBracketToken)
1474
if (
_currentToken
.Kind == RegexKind.BackslashToken && _lexer.Position < _lexer.Text.Length)
1476
var backslashToken =
_currentToken
;
1481
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1483
var nextChar =
_currentToken
.VirtualChars[0];
1498
GetSpan(backslashToken,
_currentToken
)));
1532
_currentToken
.Kind == RegexKind.MinusToken &&
1544
if (!afterRangeMinus &&
_currentToken
.Kind == RegexKind.OpenBracketToken && _lexer.IsAt(":"))
1567
Debug.Assert(
_currentToken
.Kind == RegexKind.OpenBracketToken);
1580
if (
_currentToken
.Kind is not RegexKind.CloseBracketToken and not RegexKind.EndOfFile)
1602
if (
_currentToken
.Kind == RegexKind.EndOfFile)
1610
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1611
switch (
_currentToken
.VirtualChars[0].Value)
1648
if (
_currentToken
.Kind == RegexKind.EndOfFile)
1656
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1657
var ch =
_currentToken
.VirtualChars[0];
1775
var typeToken =
_currentToken
;
1811
(
_currentToken
.Kind == RegexKind.LessThanToken ||
_currentToken
.Kind == RegexKind.SingleQuoteToken))
1813
openToken =
_currentToken
;
1830
((openToken.Kind == RegexKind.LessThanToken &&
_currentToken
.Kind == RegexKind.GreaterThanToken) ||
1831
(openToken.Kind == RegexKind.SingleQuoteToken &&
_currentToken
.Kind == RegexKind.SingleQuoteToken)))
1844
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1846
var ch =
_currentToken
.VirtualChars[0];
1891
var typeToken =
_currentToken
;
1899
var typeToken =
_currentToken
;
1910
if (
_currentToken
.Kind == RegexKind.EndOfFile)
1918
Debug.Assert(
_currentToken
.VirtualChars.Length == 1);
1920
var ch =
_currentToken
.VirtualChars[0].Value;
1954
_currentToken
.GetSpan()));
1965
var typeToken =
_currentToken
;
2006
if (
_currentToken
.Kind != RegexKind.OpenBraceToken)
2012
openBraceToken =
_currentToken
;
2017
if (
_currentToken
.Kind != RegexKind.CloseBraceToken)