1 write to _lexer
Microsoft.CodeAnalysis.Features (1)
EmbeddedLanguages\RegularExpressions\RegexParser.cs (1)
95
_lexer
= new RegexLexer(text);
101 references to _lexer
Microsoft.CodeAnalysis.Features (101)
EmbeddedLanguages\RegularExpressions\RegexParser.cs (101)
119
_currentToken =
_lexer
.ScanNextToken(allowTrivia, _options);
169
Debug.Assert(
_lexer
.Position ==
_lexer
.Text.Length);
179
_lexer
.Text, root, diagnostics.ToImmutable(),
468
var start =
_lexer
.Position;
477
_lexer
.Position = start;
512
var firstNumber =
_lexer
.TryScanNumber();
527
var start =
_lexer
.Position;
528
secondNumberToken =
_lexer
.TryScanNumber();
567
_lexer
.Position = position;
594
var start =
_lexer
.Position;
650
var start =
_lexer
.Position;
663
_lexer
.Position = start;
712
? new TextSpan(
_lexer
.Text.Last().Span.End, 0)
718
var optionsToken =
_lexer
.TryScanOptions();
724
var afterQuestionPos =
_lexer
.Position;
771
_lexer
.Position = afterQuestionPos - 1;
778
var afterInnerOpenParen =
_lexer
.Position;
780
var captureToken =
_lexer
.TryScanNumberOrCaptureName();
825
_lexer
.Position = afterInnerOpenParen;
835
_lexer
.Position = afterInnerOpenParen;
865
_lexer
.Position--;
877
_lexer
.Position--;
878
if (
_lexer
.IsAt("(?#"))
880
var pos =
_lexer
.Position;
881
var comment =
_lexer
.ScanComment(options: default);
883
_lexer
.Position = pos;
896
else if (
_lexer
.IsAt("(?'"))
902
else if (
_lexer
.IsAt("(?<"))
904
if (!
_lexer
.IsAt("(?<!") &&
905
!
_lexer
.IsAt("(?<="))
942
var start =
_lexer
.Position;
961
_lexer
.Position = start;
969
if (
_lexer
.Position ==
_lexer
.Text.Length)
978
var captureToken =
_lexer
.TryScanNumberOrCaptureName();
1050
_lexer
.Position--;
1063
var secondCapture =
_lexer
.TryScanNumberOrCaptureName();
1284
if (_currentToken.Kind == RegexKind.MinusToken && !
_lexer
.IsAt("]"))
1474
if (_currentToken.Kind == RegexKind.BackslashToken &&
_lexer
.Position <
_lexer
.Text.Length)
1506
_lexer
.Position--;
1525
_lexer
.Position--;
1533
_lexer
.IsAt("["))
1544
if (!afterRangeMinus && _currentToken.Kind == RegexKind.OpenBracketToken &&
_lexer
.IsAt(":"))
1546
var beforeBracketPos =
_lexer
.Position - 1;
1550
var captureName =
_lexer
.TryScanCaptureName();
1551
if (captureName.HasValue &&
_lexer
.IsAt(":]"))
1553
_lexer
.Position += 2;
1554
var textChars =
_lexer
.GetSubPattern(beforeBracketPos,
_lexer
.Position);
1565
_lexer
.Position = beforeBracketPos;
1597
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1637
_lexer
.Position--;
1643
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1665
_lexer
.Position--;
1671
_lexer
.Position--;
1675
_lexer
.Position--;
1681
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1696
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1697
var start =
_lexer
.Position;
1701
while (
_lexer
.Position <
_lexer
.Text.Length &&
1702
_lexer
.Text[
_lexer
.Position] is var ch &&
1711
_lexer
.Position++;
1715
bestPosition =
_lexer
.Position;
1723
_lexer
.GetSubPattern(start, bestPosition)).With(value: capVal);
1728
_lexer
.Position = start;
1735
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1736
var start =
_lexer
.Position;
1738
var number =
_lexer
.TryScanNumber();
1751
_lexer
.Position = start;
1757
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1758
Debug.Assert(
_lexer
.Text[
_lexer
.Position].Value is '<' or '\'');
1760
var afterBackslashPosition =
_lexer
.Position;
1765
_lexer
.Position = afterBackslashPosition;
1776
var afterBackslashPosition =
_lexer
.Position - @"k".Length;
1792
_lexer
.Position = afterBackslashPosition;
1810
if (
_lexer
.Position <
_lexer
.Text.Length &&
1820
var captureToken =
_lexer
.TryScanNumberOrCaptureName();
1840
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] == '\\');
1849
_lexer
.Position--;
1850
var octalDigits =
_lexer
.ScanOctalCharacters(_options);
1892
var hexChars =
_lexer
.ScanHexCharacters(4);
1900
var hexChars =
_lexer
.ScanHexCharacters(2);
1964
Debug.Assert(
_lexer
.Text[
_lexer
.Position - 1] is var ch && (ch == 'P' || ch == 'p'));
1967
var start =
_lexer
.Position;
1997
if (
_lexer
.Text.Length -
_lexer
.Position < "{x}".Length)
2013
var category =
_lexer
.TryScanEscapeCategory();