771 references to CurrentToken
Microsoft.CodeAnalysis.CSharp (771)
Parser\DirectiveParser.cs (28)
50
SyntaxKind contextualKind = this.
CurrentToken
.ContextualKind;
89
result = (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken) ?
377
switch (this.
CurrentToken
.Kind)
398
if (this.
CurrentToken
.Kind == SyntaxKind.StringLiteralToken &&
399
(line.IsMissing || line.GetTrailingTriviaWidth() > 0 || this.
CurrentToken
.GetLeadingTriviaWidth() > 0)) //require separation between line number and file name
414
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.OpenParenToken);
433
var characterOffset = (
CurrentToken
.Kind == SyntaxKind.NumericLiteralToken) ?
546
SyntaxToken setting = this.
CurrentToken
.Kind switch
554
SyntaxToken target = this.
CurrentToken
.Kind switch
575
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WarningKeyword)
579
if (this.
CurrentToken
.Kind == SyntaxKind.DisableKeyword || this.
CurrentToken
.Kind == SyntaxKind.RestoreKeyword)
584
while (this.
CurrentToken
.Kind != SyntaxKind.EndOfDirectiveToken)
589
if (this.
CurrentToken
.Kind == SyntaxKind.NumericLiteralToken)
601
else if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
622
if (this.
CurrentToken
.Kind != SyntaxKind.CommaToken)
640
else if (this.
CurrentToken
.Kind == SyntaxKind.ChecksumKeyword)
729
if (this.
CurrentToken
.Kind != SyntaxKind.EndOfDirectiveToken &&
730
this.
CurrentToken
.Kind != SyntaxKind.EndOfFileToken)
749
while (this.
CurrentToken
.Kind != SyntaxKind.EndOfDirectiveToken &&
750
this.
CurrentToken
.Kind != SyntaxKind.EndOfFileToken)
757
SyntaxToken endOfDirective = this.
CurrentToken
.Kind == SyntaxKind.EndOfDirectiveToken
778
while (this.
CurrentToken
.Kind == SyntaxKind.BarBarToken)
791
while (this.
CurrentToken
.Kind == SyntaxKind.AmpersandAmpersandToken)
804
while (this.
CurrentToken
.Kind == SyntaxKind.EqualsEqualsToken || this.
CurrentToken
.Kind == SyntaxKind.ExclamationEqualsToken)
816
if (this.
CurrentToken
.Kind == SyntaxKind.ExclamationToken)
827
var k = this.
CurrentToken
.Kind;
Parser\DocumentationCommentParser.cs (90)
81
if (this.
CurrentToken
.Kind != SyntaxKind.EndOfDocumentationCommentToken)
101
bool endTag = this.
CurrentToken
.Kind == SyntaxKind.LessThanSlashToken;
108
while (this.
CurrentToken
.Kind != SyntaxKind.EndOfDocumentationCommentToken)
147
switch (this.
CurrentToken
.Kind)
171
switch (this.
CurrentToken
.Kind)
190
while (this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralToken
191
|| this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralNewLineToken
192
|| this.
CurrentToken
.Kind == SyntaxKind.XmlEntityLiteralToken)
218
if (this.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken)
258
if (this.
CurrentToken
.Kind != SyntaxKind.GreaterThanToken)
261
p => p.
CurrentToken
.Kind != SyntaxKind.GreaterThanToken,
328
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
344
p => p.
CurrentToken
.Kind != SyntaxKind.IdentifierName,
347
p => p.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken
348
|| p.
CurrentToken
.Kind == SyntaxKind.SlashGreaterThanToken
349
|| p.
CurrentToken
.Kind == SyntaxKind.LessThanToken
350
|| p.
CurrentToken
.Kind == SyntaxKind.LessThanSlashToken
351
|| p.
CurrentToken
.Kind == SyntaxKind.EndOfDocumentationCommentToken
352
|| p.
CurrentToken
.Kind == SyntaxKind.EndOfFileToken,
452
switch (this.
CurrentToken
.Kind)
525
SyntaxToken openQuote = EatToken(this.
CurrentToken
.Kind == SyntaxKind.SingleQuoteToken
532
SyntaxToken current = this.
CurrentToken
;
539
current = this.
CurrentToken
;
606
while (this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralToken
607
|| this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralNewLineToken
608
|| this.
CurrentToken
.Kind == SyntaxKind.XmlEntityLiteralToken
609
|| this.
CurrentToken
.Kind == SyntaxKind.LessThanToken)
631
if (IsNonAsciiQuotationMark(this.
CurrentToken
))
636
var quoteKind = this.
CurrentToken
.Kind == SyntaxKind.SingleQuoteToken
650
if (IsNonAsciiQuotationMark(this.
CurrentToken
))
685
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
725
while (this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralToken
726
|| this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralNewLineToken
727
|| this.
CurrentToken
.Kind == SyntaxKind.MinusMinusToken)
752
while (this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralToken
753
|| this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralNewLineToken)
774
while (this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralToken
775
|| this.
CurrentToken
.Kind == SyntaxKind.XmlTextLiteralNewLineToken)
900
else if (type.Kind != SyntaxKind.QualifiedName && this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
940
switch (
CurrentToken
.Kind)
949
case SyntaxKind.IdentifierToken when
CurrentToken
.ContextualKind == SyntaxKind.ExtensionKeyword:
973
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.ThisKeyword);
987
Debug.Assert(
CurrentToken
.ContextualKind == SyntaxKind.ExtensionKeyword);
990
TypeArgumentListSyntax? typeArguments = (
CurrentToken
.Kind == SyntaxKind.LessThanToken) ? ParseTypeArguments(typeArgumentsMustBeIdentifiers: true) : null;
991
CrefParameterListSyntax? parameters = (
CurrentToken
.Kind == SyntaxKind.OpenParenToken) ? ParseCrefParameterList() : null;
993
if (parameters is null ||
CurrentToken
.Kind != SyntaxKind.DotToken)
1018
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.OperatorKeyword);
1024
if (SyntaxFacts.IsAnyOverloadableOperator(
CurrentToken
.Kind))
1035
if (SyntaxFacts.IsUnaryOperatorDeclarationToken(
CurrentToken
.Kind) || SyntaxFacts.IsBinaryExpressionOperatorToken(
CurrentToken
.Kind))
1048
if (operatorToken.Kind == SyntaxKind.GreaterThanToken && LanguageParser.NoTriviaBetween(operatorToken,
CurrentToken
))
1050
if (
CurrentToken
.Kind == SyntaxKind.GreaterThanToken)
1054
if (LanguageParser.NoTriviaBetween(operatorToken2,
CurrentToken
) &&
1055
CurrentToken
.Kind is (SyntaxKind.GreaterThanToken or SyntaxKind.GreaterThanEqualsToken))
1091
else if (
CurrentToken
.Kind == SyntaxKind.EqualsToken)
1101
else if (
CurrentToken
.Kind == SyntaxKind.GreaterThanEqualsToken)
1159
if (LanguageParser.NoTriviaBetween(operatorToken,
CurrentToken
) &&
CurrentToken
.Kind == SyntaxKind.EqualsToken)
1181
(isConversion || SyntaxFacts.IsAnyOverloadableOperator(
CurrentToken
.Kind)))
1190
if (
CurrentToken
.Kind == SyntaxKind.UncheckedKeyword)
1207
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.ExplicitKeyword ||
1208
CurrentToken
.Kind == SyntaxKind.ImplicitKeyword);
1245
if (
CurrentToken
.Kind != openKind)
1255
while (
CurrentToken
.Kind == SyntaxKind.CommaToken || IsPossibleCrefParameter())
1259
if (
CurrentToken
.Kind != closeKind)
1270
Debug.Assert(
CurrentToken
.Kind != SyntaxKind.CommaToken);
1295
SyntaxKind kind = this.
CurrentToken
.Kind;
1317
switch (
CurrentToken
.Kind)
1327
if (
CurrentToken
.Kind == SyntaxKind.ReadOnlyKeyword && refKindOpt is not null)
1354
if (
CurrentToken
.Kind != SyntaxKind.LessThanToken)
1364
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.LessThanToken);
1382
var currentKind =
CurrentToken
.Kind;
1384
SyntaxFacts.IsPredefinedType(
CurrentToken
.Kind))
1444
if (SyntaxFacts.IsPredefinedType(
CurrentToken
.Kind))
1453
else if (
CurrentToken
.Kind == SyntaxKind.IdentifierToken && PeekToken(1).Kind == SyntaxKind.ColonColonToken)
1473
if (checkForMember && (leftName.IsMissing ||
CurrentToken
.Kind != SyntaxKind.DotToken))
1485
while (
CurrentToken
.Kind == SyntaxKind.DotToken)
1494
if (checkForMember && (rightName.IsMissing ||
CurrentToken
.Kind != SyntaxKind.DotToken))
1516
if (
CurrentToken
.Kind == SyntaxKind.QuestionToken)
1521
while (
CurrentToken
.Kind == SyntaxKind.AsteriskToken)
1526
if (
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
1532
while (
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
1538
while (this.
CurrentToken
.Kind != SyntaxKind.CloseBracketToken)
1540
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
1590
switch (
CurrentToken
.Kind)
1602
return
CurrentToken
.Text == SyntaxFacts.GetText(SyntaxKind.LessThanToken) ||
1603
IsNonAsciiQuotationMark(
CurrentToken
);
1658
switch (
CurrentToken
.Kind)
1670
return
CurrentToken
.Text == SyntaxFacts.GetText(SyntaxKind.LessThanToken) ||
1671
IsNonAsciiQuotationMark(
CurrentToken
);
Parser\LanguageParser.cs (606)
96
if (this.
CurrentToken
.Kind == SyntaxKind.EndOfFileToken)
251
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.NamespaceKeyword);
264
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
268
else if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || IsPossibleNamespaceMemberDeclaration())
586
switch (this.
CurrentToken
.Kind)
675
if (this.
CurrentToken
.ContextualKind != SyntaxKind.GlobalKeyword || this.PeekToken(1).Kind != SyntaxKind.UsingKeyword)
870
switch (this.
CurrentToken
.Kind)
879
return IsPossibleStartOfTypeDeclaration(this.
CurrentToken
.Kind);
885
if (this.
CurrentToken
.ContextualKind == SyntaxKind.PartialKeyword)
902
return this.
CurrentToken
.Kind == SyntaxKind.CloseBraceToken;
927
return this.
CurrentToken
.Kind == SyntaxKind.ExternKeyword
940
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ExternKeyword);
964
var globalToken = this.
CurrentToken
.ContextualKind == SyntaxKind.GlobalKeyword
968
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.UsingKeyword);
975
if (staticToken is null && unsafeToken != null && this.
CurrentToken
.Kind == SyntaxKind.StaticKeyword)
987
var isAliasToFunctionPointer = alias != null && this.
CurrentToken
.Kind == SyntaxKind.DelegateKeyword;
1006
type = _syntaxFactory.IdentifierName(CreateMissingToken(SyntaxKind.IdentifierToken, this.
CurrentToken
.Kind));
1029
return this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken
1049
if (this.
CurrentToken
.Kind != SyntaxKind.OpenBracketToken)
1067
if (SyntaxFacts.IsLiteralExpression(this.
CurrentToken
.Kind))
1111
return this.
CurrentToken
.Kind == SyntaxKind.CloseBracketToken
1116
=> IsSomeWord(this.
CurrentToken
.Kind) && this.PeekToken(1).Kind == SyntaxKind.ColonToken;
1161
if (this.
CurrentToken
.Kind == SyntaxKind.DotToken)
1167
if (this.
CurrentToken
.Kind == SyntaxKind.MinusGreaterThanToken)
1172
if (this.
CurrentToken
.Kind == SyntaxKind.QuestionToken &&
1185
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleAttribute(),
1186
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
1215
if (this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
1240
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleAttributeArgument(),
1241
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
1275
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
1366
var newMod = GetModifierExcludingScoped(this.
CurrentToken
);
1503
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.
CurrentToken
) != DeclarationModifiers.None);
1522
(this.
CurrentToken
.ContextualKind == SyntaxKind.PartialKeyword))
1539
var currentTokenKind = this.
CurrentToken
.Kind;
1561
var currentTokenKind = this.
CurrentToken
.Kind;
1579
if (SyntaxFacts.IsPredefinedType(this.
CurrentToken
.Kind))
1586
if (IsNonContextualModifier(this.
CurrentToken
))
1621
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.PartialKeyword);
1645
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.PartialKeyword);
1678
switch (this.
CurrentToken
.Kind)
1681
if (this.
CurrentToken
.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword)
1701
switch (this.
CurrentToken
.Kind)
1719
Debug.Assert(
CurrentToken
.ContextualKind is SyntaxKind.RecordKeyword or SyntaxKind.ExtensionKeyword);
1723
throw ExceptionUtilities.UnexpectedValue(this.
CurrentToken
.Kind);
1729
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword or SyntaxKind.InterfaceKeyword ||
1730
this.
CurrentToken
.ContextualKind is SyntaxKind.RecordKeyword or SyntaxKind.ExtensionKeyword);
1751
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
1764
var paramList =
CurrentToken
.Kind == SyntaxKind.OpenParenToken || isExtension
1776
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
1787
if (
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
1811
SyntaxKind kind = this.
CurrentToken
.Kind;
1847
? this.CreateMissingToken(SyntaxKind.CloseBraceToken, this.
CurrentToken
.Kind)
1870
if (this.
CurrentToken
.ContextualKind == SyntaxKind.RecordKeyword)
1873
recordModifier = this.
CurrentToken
.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword
1880
if (this.
CurrentToken
.Kind is SyntaxKind.StructKeyword or SyntaxKind.ClassKeyword &&
2034
SyntaxKind kind = this.
CurrentToken
.Kind;
2082
return this.IsPossibleMemberStart() || this.
CurrentToken
.Kind == SyntaxKind.CloseBraceToken;
2087
return this.
CurrentToken
.Kind is SyntaxKind.ColonToken or SyntaxKind.OpenBraceToken
2104
list.Add(this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken
2111
if (this.
CurrentToken
.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.SemicolonToken ||
2117
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
2131
if (GetModifierExcludingScoped(this.
CurrentToken
) != DeclarationModifiers.None)
2154
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleAttribute(),
2155
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || p.IsCurrentTokenWhereOfConstraintClause(),
2163
this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword &&
2170
while (this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
2188
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || this.IsCurrentTokenWhereOfConstraintClause())
2202
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
2203
|| ((_termState & TerminatorState.IsEndOfTypeSignature) != 0 && this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
2204
|| this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken
2205
|| this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
2209
else if (haveComma = (this.
CurrentToken
.Kind == SyntaxKind.CommaToken) || this.IsPossibleTypeParameterConstraint())
2249
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleTypeParameterConstraint(),
2250
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || p.IsCurrentTokenWhereOfConstraintClause(),
2257
switch (this.
CurrentToken
.Kind)
2266
return (this.
CurrentToken
.ContextualKind == SyntaxKind.AllowsKeyword && PeekToken(1).Kind == SyntaxKind.RefKeyword) || this.IsTrueIdentifier();
2268
return IsPredefinedType(this.
CurrentToken
.Kind);
2274
return this.
CurrentToken
.Kind switch
2286
this.
CurrentToken
.Kind == SyntaxKind.QuestionToken
2318
if (this.
CurrentToken
.ContextualKind == SyntaxKind.AllowsKeyword &&
2332
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken && PeekToken(1).Kind == SyntaxKind.RefKeyword)
2350
return CanStartMember(this.
CurrentToken
.Kind);
2411
switch (this.
CurrentToken
.Kind)
2421
if (
CurrentToken
.ContextualKind == SyntaxKind.RecordKeyword)
2558
switch (this.
CurrentToken
.Kind)
2600
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.OpenParenToken)
2634
if (this.
CurrentToken
.Kind == SyntaxKind.ConstKeyword)
2647
if (this.
CurrentToken
.Kind == SyntaxKind.EventKeyword)
2653
if (this.
CurrentToken
.Kind == SyntaxKind.FixedKeyword)
2665
if (this.
CurrentToken
.Kind == SyntaxKind.NamespaceKeyword)
2687
if (this.
CurrentToken
.Kind is not SyntaxKind.CloseBraceToken and not SyntaxKind.EndOfFileToken &&
2928
if (
CurrentToken
.Kind == SyntaxKind.UsingKeyword)
2933
if (
CurrentToken
.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword)
2948
if (GetModifierExcludingScoped(this.
CurrentToken
) != DeclarationModifiers.None &&
2949
this.
CurrentToken
.ContextualKind is not (SyntaxKind.PartialKeyword or SyntaxKind.AsyncKeyword or SyntaxKind.RequiredKeyword or SyntaxKind.FileKeyword) &&
2952
var misplacedModifier = this.
CurrentToken
;
3015
offset: incompleteMember.Width + incompleteMember.GetTrailingTriviaWidth() + this.
CurrentToken
.GetLeadingTriviaWidth(),
3016
this.
CurrentToken
.Width,
3018
this.
CurrentToken
.Text);
3082
|| this.
CurrentToken
.Kind is not SyntaxKind.OpenParenToken and not SyntaxKind.OpenBraceToken and not SyntaxKind.EqualsGreaterThanToken) &&
3190
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.OpenParenToken)
3196
if (this.
CurrentToken
.Kind == SyntaxKind.TildeToken)
3202
if (this.
CurrentToken
.Kind == SyntaxKind.ConstKeyword)
3208
if (this.
CurrentToken
.Kind == SyntaxKind.EventKeyword)
3214
if (this.
CurrentToken
.Kind == SyntaxKind.FixedKeyword)
3322
return this.
CurrentToken
.ContextualKind == SyntaxKind.ExtensionKeyword &&
3354
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
3359
if (this.
CurrentToken
.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword)
3397
return this.
CurrentToken
.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword or SyntaxKind.OperatorKeyword;
3455
var currentTokenKind = this.
CurrentToken
.Kind;
3472
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.ColonToken or SyntaxKind.EqualsGreaterThanToken);
3475
var token = this.
CurrentToken
.Kind is SyntaxKind.BaseKeyword or SyntaxKind.ThisKeyword
3479
var argumentList = this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken
3497
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.TildeToken);
3523
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
3531
blockBody = this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
3535
expressionBody = this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken
3546
else if (parseSemicolonAfterBlock && this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
3558
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
3564
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
3570
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken)
3586
=> this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken or SyntaxKind.OpenBraceToken;
3590
return this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken or SyntaxKind.OpenBraceToken;
3594
=> this.
CurrentToken
.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken;
3597
=> this.
CurrentToken
.Kind == (errored ? SyntaxKind.CloseParenToken : SyntaxKind.GreaterThanToken);
3600
=> this.
CurrentToken
.Kind == SyntaxKind.CloseBracketToken;
3617
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
3622
else if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
3625
var colonToken = this.
CurrentToken
;
3672
switch (this.
CurrentToken
.Kind)
3691
if (this.
CurrentToken
.Kind is not (SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword))
3695
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
3705
if (this.
CurrentToken
.Kind == SyntaxKind.OperatorKeyword)
3719
(IsMakingProgress(ref lastTokenPosition, assertIfFalse: false) && this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken))
3725
separatorKind = this.
CurrentToken
.Kind;
3747
if (this.
CurrentToken
.Kind != SyntaxKind.OperatorKeyword ||
3769
var style = this.
CurrentToken
.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword
3779
if (!style.IsMissing && explicitInterfaceOpt is not null && this.
CurrentToken
.Kind != SyntaxKind.OperatorKeyword && style.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia))
3811
bool couldBeParameterList = this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken;
3816
this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
3847
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
3864
if (this.
CurrentToken
.Kind == SyntaxKind.OperatorKeyword)
3874
(IsMakingProgress(ref lastTokenPosition, assertIfFalse: false) && this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken);
3913
if (
CurrentToken
.Kind == SyntaxKind.UncheckedKeyword)
3932
var firstToken = this.
CurrentToken
;
3965
if (SyntaxFacts.IsAnyOverloadableOperator(this.
CurrentToken
.Kind))
3974
if (this.
CurrentToken
.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword)
3977
(opTokenErrorOffset, opTokenErrorWidth) = (0, this.
CurrentToken
.Width);
4009
var tk = this.
CurrentToken
;
4016
tk = this.
CurrentToken
;
4148
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken)
4156
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
4165
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken
4200
if (this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken)
4208
var accessorList = this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
4216
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken)
4222
else if (this.
CurrentToken
.Kind == SyntaxKind.EqualsToken)
4234
else if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
4319
if (this.
CurrentToken
.Kind == SyntaxKind.CloseBraceToken)
4354
var refKeyword = this.
CurrentToken
.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression)
4365
static p => p.
CurrentToken
.Kind != SyntaxKind.CloseBraceToken && !p.IsPossibleAccessor(),
4372
return this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken
4374
|| SyntaxFacts.GetAccessorDeclarationKind(this.
CurrentToken
.ContextualKind) != SyntaxKind.None
4375
|| this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken // for accessor blocks w/ missing keyword
4376
|| this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken // for empty body accessors w/ missing keyword
4398
if (GetModifierExcludingScoped(this.
CurrentToken
) == DeclarationModifiers.None)
4546
var token = (first && !this.
CurrentToken
.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken();
4572
var token = (first && !this.
CurrentToken
.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken();
4628
bool currentTokenIsSemicolon = this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken;
4629
bool currentTokenIsArrow = this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken;
4630
bool currentTokenIsOpenBraceToken = this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken;
4812
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleParameter(),
4813
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
4820
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken;
4825
switch (this.
CurrentToken
.Kind)
4837
return IsParameterModifierExcludingScoped(this.
CurrentToken
) || IsPossibleScopedKeyword(isFunctionPointerParameter: false) || IsPredefinedType(this.
CurrentToken
.Kind);
4897
if (this.
CurrentToken
.Kind == SyntaxKind.ArgListKeyword)
4908
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken && IsCurrentTokenWhereOfConstraintClause())
4915
identifier = allowOptionalIdentifier && this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken
4921
if (identifier is not null && this.
CurrentToken
.Kind is SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind is SyntaxKind.CloseBracketToken)
4966
while (IsParameterModifierExcludingScoped(this.
CurrentToken
))
4968
if (this.
CurrentToken
.Kind is SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword)
4985
while (this.
CurrentToken
.Kind is SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword)
4998
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.FixedKeyword);
5016
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.EventKeyword);
5040
if (explicitInterfaceOpt != null && this.
CurrentToken
.Kind is not SyntaxKind.OpenBraceToken and not SyntaxKind.SemicolonToken)
5092
if (explicitInterfaceOpt != null && this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
5119
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
5172
if (this.
CurrentToken
.Kind == SyntaxKind.DotToken)
5188
return this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken;
5253
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
5257
else if (stopOnCloseParen && this.
CurrentToken
.Kind == SyntaxKind.CloseParenToken)
5261
else if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
5311
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken,
5312
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.SemicolonToken,
5466
var currentTokenKind = this.
CurrentToken
.Kind;
5477
currentTokenKind = this.
CurrentToken
.Kind;
5527
switch (this.
CurrentToken
.Kind)
5538
var refKeyword = isLocalOrField && !isConst && this.
CurrentToken
.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression)
5615
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsToken)
5651
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.OpenParenToken or SyntaxKind.LessThanToken);
5659
(this.
CurrentToken
.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken ||
5660
this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword))
5670
switch (this.
CurrentToken
.Kind)
5682
return this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
5689
return this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || this.IsPossibleExpression();
5708
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.DelegateKeyword);
5719
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
5741
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.EnumKeyword);
5756
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
5772
if (
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
5817
static p => p.
CurrentToken
.Kind is not SyntaxKind.CommaToken and not SyntaxKind.SemicolonToken && !p.IsPossibleEnumMemberDeclaration(),
5818
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
5833
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsToken)
5838
this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseBraceToken
5848
return this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken || this.IsTrueIdentifier();
5853
return this.
CurrentToken
.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken;
5892
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
5932
var ctk = this.
CurrentToken
.Kind;
5944
result = this.AddError(result, ErrorCode.ERR_InvalidExprTerm, this.
CurrentToken
.Text);
5970
if (this.
CurrentToken
.ContextualKind == SyntaxKind.PartialKeyword)
5983
return
CurrentToken
.ContextualKind == SyntaxKind.FieldKeyword &&
5990
if (this.
CurrentToken
.Kind != SyntaxKind.LessThanToken)
6020
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken,
6021
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
6033
if (this.
CurrentToken
.Kind is SyntaxKind.OpenBracketToken or SyntaxKind.InKeyword or SyntaxKind.OutKeyword)
6042
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
6061
this.
CurrentToken
.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null,
6078
if (this.
CurrentToken
.Kind == SyntaxKind.LessThanToken)
6088
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.LessThanToken);
6113
if (this.
CurrentToken
.Kind != SyntaxKind.LessThanToken)
6163
switch (this.
CurrentToken
.Kind)
6245
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.LessThanToken);
6255
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
6272
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
6278
if (this.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken)
6287
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
6322
isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken;
6349
isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken;
6371
isDefinitelyTypeArgumentList = this.
CurrentToken
.Kind == SyntaxKind.CommaToken;
6389
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken);
6391
if (this.
CurrentToken
.Kind != SyntaxKind.GreaterThanToken)
6397
if (this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken)
6406
if (lastScannedType is ScanTypeFlags.TupleType && this.
CurrentToken
.Kind is SyntaxKind.OpenParenToken)
6419
isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken;
6431
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.LessThanToken);
6441
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
6458
if (this.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken)
6465
if (tokenBreaksTypeArgumentList(this.
CurrentToken
))
6474
if (this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken && tokenBreaksTypeArgumentList(this.PeekToken(1)))
6483
if (this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken
6489
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken || this.IsPossibleType())
6559
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleType(),
6560
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken,
6568
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind != SyntaxKind.CloseBracketToken)
6584
var varianceToken = this.
CurrentToken
.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword
6611
this.
CurrentToken
.Kind is not SyntaxKind.CommaToken and not SyntaxKind.GreaterThanToken &&
6633
=> this.
CurrentToken
.Kind == SyntaxKind.GreaterThanToken;
6637
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.LessThanToken);
6675
if (this.
CurrentToken
.Kind == SyntaxKind.ThisKeyword)
6726
if (isEvent && this.
CurrentToken
.Kind is not SyntaxKind.OpenBraceToken and not SyntaxKind.SemicolonToken)
6797
separator = this.
CurrentToken
.Kind == SyntaxKind.ColonColonToken
6810
if (this.
CurrentToken
.Kind == SyntaxKind.ColonColonToken)
6839
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
6915
return this.
CurrentToken
.Kind == SyntaxKind.ColonColonToken
7045
var tk = this.
CurrentToken
.Kind;
7066
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken || !this.IsTrueIdentifier())
7073
if (this.
CurrentToken
.Kind == SyntaxKind.LessThanToken)
7088
if (this.
CurrentToken
.Kind == SyntaxKind.RefKeyword)
7093
if (this.
CurrentToken
.Kind == SyntaxKind.ReadOnlyKeyword)
7100
if (this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken or SyntaxKind.ColonColonToken)
7103
if (this.
CurrentToken
.Kind is SyntaxKind.ColonColonToken)
7117
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken);
7157
else if (IsPredefinedType(this.
CurrentToken
.Kind))
7163
else if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
7168
if (result == ScanTypeFlags.NotType || mode == ParseTypeMode.DefinitePattern && this.
CurrentToken
.Kind != SyntaxKind.OpenBracketToken)
7188
switch (this.
CurrentToken
.Kind)
7229
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
7234
if (this.
CurrentToken
.Kind != SyntaxKind.CloseBracketToken)
7267
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
7285
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken);
7287
if (this.
CurrentToken
.Kind == SyntaxKind.CloseParenToken)
7309
if (
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
7312
switch (
CurrentToken
)
7327
if (
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
7344
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.CommaToken);
7357
if (!IsPossibleFunctionPointerParameterListStart(
CurrentToken
))
7397
if (!validStartingToken &&
CurrentToken
.Kind == SyntaxKind.CloseParenToken)
7411
isNotExpectedFunction: static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken,
7432
if (this.
CurrentToken
.Kind == SyntaxKind.VoidKeyword && this.PeekToken(1).Kind != SyntaxKind.AsteriskToken)
7457
if (this.
CurrentToken
.Kind == SyntaxKind.RefKeyword)
7461
this.
CurrentToken
.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null,
7505
switch (this.
CurrentToken
.Kind)
7553
while (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken);
7574
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.QuestionToken);
7597
if (mode == ParseTypeMode.AfterIs && this.
CurrentToken
.Kind is SyntaxKind.OpenBracketToken)
7624
return this.
CurrentToken
.Kind != SyntaxKind.ColonToken;
7651
if (IsTrueIdentifier(this.
CurrentToken
))
7660
if (this.
CurrentToken
.ContextualKind is SyntaxKind.AsyncKeyword or SyntaxKind.AwaitKeyword or SyntaxKind.FromKeyword)
7714
if (this.
CurrentToken
.Kind is SyntaxKind.OpenBracketToken)
7723
this.
CurrentToken
.Kind is SyntaxKind.OpenParenToken or // ctor parameters
7758
while (IsMakingProgress(ref lastTokenPosition) && this.
CurrentToken
.Kind != SyntaxKind.CloseBracketToken)
7760
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
7773
if (this.
CurrentToken
.Kind != SyntaxKind.CloseBracketToken)
7814
if (this.
CurrentToken
.Kind != SyntaxKind.CloseParenToken)
7818
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
7853
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleExpression(),
7854
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.CloseBracketToken,
7860
if (IsPredefinedType(this.
CurrentToken
.Kind))
7864
if (token.Kind == SyntaxKind.VoidKeyword && this.
CurrentToken
.Kind != SyntaxKind.AsteriskToken)
7873
if (IsTrueIdentifier() || this.
CurrentToken
.Kind == SyntaxKind.ColonColonToken)
7878
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
7901
if (!IsPossibleFunctionPointerParameterListStart(
CurrentToken
))
7944
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.CommaToken);
7955
lessThanToken.IsMissing &&
CurrentToken
.Kind == SyntaxKind.CloseParenToken
7970
isNotExpectedFunction: static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken,
7978
if (
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
7982
switch (
CurrentToken
)
7986
managedSpecifier = EatContextualToken(
CurrentToken
.ContextualKind);
8006
if (
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
8024
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.CommaToken);
8054
=>
CurrentToken
.Kind == SyntaxKind.DelegateKeyword && PeekToken(1).Kind == SyntaxKind.AsteriskToken;
8065
while (this.
CurrentToken
.Kind == SyntaxKind.AsteriskToken)
8085
if (this.
CurrentToken
.Kind != SyntaxKind.OpenBracketToken)
8099
while (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
8109
var isCollectionExpression = this.
CurrentToken
.Kind
8122
|| IsExpectedBinaryOperator(this.
CurrentToken
.Kind)
8123
|| IsExpectedAssignmentOperator(this.
CurrentToken
.Kind)
8124
|| (this.
CurrentToken
.ContextualKind is SyntaxKind.SwitchKeyword or SyntaxKind.WithKeyword && this.PeekToken(1).Kind is SyntaxKind.OpenBraceToken);
8128
this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
8187
switch (this.
CurrentToken
.Kind)
8283
bool beginsWithAwait = this.
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword;
8318
if (this.
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword &&
8359
=>
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword && PeekToken(1).Kind == SyntaxKind.UsingKeyword;
8373
return this.
CurrentToken
.ContextualKind == SyntaxKind.YieldKeyword &&
8383
var tk = this.
CurrentToken
.Kind;
8411
tk = this.
CurrentToken
.ContextualKind;
8432
bool? typedIdentifier = IsPossibleTypedIdentifierStart(this.
CurrentToken
, this.PeekToken(1), allowThisKeyword: false);
8453
var tk = this.
CurrentToken
.ContextualKind;
8497
if (st == ScanTypeFlags.MustBeType && this.
CurrentToken
.Kind is not SyntaxKind.DotToken and not SyntaxKind.OpenParenToken)
8507
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
8515
return st == ScanTypeFlags.GenericTypeOrExpression && (IsDefiniteStatement() || IsTypeDeclarationStart() || IsAccessibilityModifier(
CurrentToken
.Kind));
8536
if (this.
CurrentToken
.Kind != SyntaxKind.UsingKeyword)
8602
if (this.
CurrentToken
.Kind is SyntaxKind.OpenBraceToken)
8623
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
8630
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsToken)
8639
return this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.SemicolonToken;
8657
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken || this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
8664
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
8756
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.DelegateKeyword);
8784
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken);
8793
if (scanResult == ScanTypeFlags.TupleType && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
8804
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.NewKeyword);
8949
CSharpSyntaxNode openBrace = isAccessorBody && this.
CurrentToken
.Kind != SyntaxKind.OpenBraceToken
9030
while (this.
CurrentToken
.Kind is not SyntaxKind.CloseBraceToken and not SyntaxKind.EndOfFileToken
9062
return this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken
9074
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.CloseBraceToken,
9082
var tk = this.
CurrentToken
.Kind;
9119
var tk = this.
CurrentToken
.Kind;
9164
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.OpenBraceToken or SyntaxKind.SemicolonToken;
9227
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.TryKeyword or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword);
9240
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword);
9254
if (this.
CurrentToken
.Kind == SyntaxKind.CatchKeyword)
9257
while (this.
CurrentToken
.Kind == SyntaxKind.CatchKeyword)
9263
if (this.
CurrentToken
.Kind == SyntaxKind.FinallyKeyword)
9298
return this.
CurrentToken
.Kind is SyntaxKind.CloseBraceToken or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword;
9303
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.CatchKeyword);
9310
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
9330
var keywordKind = this.
CurrentToken
.ContextualKind;
9362
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken
9371
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken
9379
return this.
CurrentToken
.Kind is SyntaxKind.CloseBraceToken
9386
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword);
9403
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.DoKeyword);
9427
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken;
9444
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ForKeyword);
9465
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ForKeyword);
9475
var condition = this.
CurrentToken
.Kind is not SyntaxKind.SemicolonToken and not SyntaxKind.CommaToken
9484
var incrementors = this.
CurrentToken
.Kind != SyntaxKind.CloseParenToken
9513
if (this.
CurrentToken
.ContextualKind == SyntaxKind.ScopedKeyword)
9522
isDeclaration = ScanType() != ScanTypeFlags.NotType && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken;
9526
else if (this.
CurrentToken
.Kind == SyntaxKind.RefKeyword)
9543
else if (this.
CurrentToken
.Kind != SyntaxKind.SemicolonToken)
9558
=> this.
CurrentToken
.Kind is SyntaxKind.CommaToken
9566
while (this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken or SyntaxKind.CommaToken)
9590
if (@this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken)
9594
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleExpression(),
9595
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind || p.
CurrentToken
.Kind == SyntaxKind.SemicolonToken,
9602
return this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken or SyntaxKind.CloseParenToken or SyntaxKind.OpenBraceToken;
9609
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ForEachKeyword || this.
CurrentToken
.Kind == SyntaxKind.ForKeyword);
9620
if (this.
CurrentToken
.Kind == SyntaxKind.ForKeyword)
9714
if (this.IsInAsync && this.
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword)
9722
if (this.
CurrentToken
.ContextualKind == SyntaxKind.ScopedKeyword)
9725
if (ScanType() != ScanTypeFlags.NotType && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
9772
return this.
CurrentToken
.Kind == SyntaxKind.CommaToken;
9774
return this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseParenToken;
9787
if (!this.
CurrentToken
.IsIdentifierVar())
9826
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.GotoKeyword);
9834
if (this.
CurrentToken
.Kind is SyntaxKind.CaseKeyword or SyntaxKind.DefaultKeyword)
9859
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.IfKeyword);
9872
var elseKeyword = this.
CurrentToken
.Kind != SyntaxKind.ElseKeyword ?
9883
if (this.
CurrentToken
.Kind != SyntaxKind.IfKeyword)
9924
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ElseKeyword);
9938
return this.
CurrentToken
.Kind != SyntaxKind.ElseKeyword
9947
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.LockKeyword);
9959
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ReturnKeyword);
9963
this.
CurrentToken
.Kind != SyntaxKind.SemicolonToken ? this.ParsePossibleRefExpression() : null,
9969
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.YieldKeyword);
9976
if (this.
CurrentToken
.Kind == SyntaxKind.BreakKeyword)
9985
if (this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken)
10006
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.SwitchKeyword or SyntaxKind.CaseKeyword);
10031
if (this.
CurrentToken
.Kind is SyntaxKind.CaseKeyword)
10076
return this.
CurrentToken
.Kind == SyntaxKind.CaseKeyword ||
10077
(this.
CurrentToken
.Kind == SyntaxKind.DefaultKeyword && this.PeekToken(1).Kind != SyntaxKind.OpenParenToken);
10091
if (this.
CurrentToken
.Kind == SyntaxKind.CaseKeyword)
10095
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
10107
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WhenKeyword && node is ExpressionSyntax ex)
10132
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.DefaultKeyword);
10154
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.ThrowKeyword);
10158
this.
CurrentToken
.Kind != SyntaxKind.SemicolonToken ? this.ParseExpressionCore() : null,
10164
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.UnsafeKeyword);
10232
if (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken)
10259
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken &&
10291
bool condition1 = st == ScanTypeFlags.MustBeType && this.
CurrentToken
.Kind != SyntaxKind.DotToken;
10292
bool condition2 = st != ScanTypeFlags.NotType && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken;
10300
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.WhileKeyword);
10335
else if (this.
CurrentToken
.Kind == SyntaxKind.UsingKeyword)
10431
if (this.
CurrentToken
.ContextualKind != SyntaxKind.ScopedKeyword)
10443
if (this.
CurrentToken
.Kind is (SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword))
10472
return this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken;
10474
else if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
10490
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
10498
done = (this.
CurrentToken
.Kind == SyntaxKind.CloseParenToken);
10511
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
10541
return
CurrentToken
.ContextualKind == SyntaxKind.UnderscoreToken
10548
if (this.
CurrentToken
.ContextualKind != SyntaxKind.WhenKeyword)
10632
switch (this.
CurrentToken
.Kind)
10645
while (IsDeclarationModifier(k = this.
CurrentToken
.ContextualKind) || IsAdditionalLocalFunctionModifier(k))
10682
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken);
10688
if (IsDeclarationModifier(this.
CurrentToken
.Kind) ||
10689
IsAdditionalLocalFunctionModifier(this.
CurrentToken
.Kind))
10696
if (ScanType() != ScanTypeFlags.NotType && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
10704
while (IsAdditionalLocalFunctionModifier(this.
CurrentToken
.ContextualKind));
10844
if (this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword)
10883
if (IsScript && this.
CurrentToken
.Kind == SyntaxKind.EndOfFileToken)
10927
SyntaxKind tk = this.
CurrentToken
.Kind;
10973
return this.IsTrueIdentifier() || this.
CurrentToken
.ContextualKind == SyntaxKind.FromKeyword;
11209
return (this.IsScript || this.IsInAsync) && this.
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword;
11214
if (this.
CurrentToken
.ContextualKind == SyntaxKind.AwaitKeyword)
11292
var tk = this.
CurrentToken
.Kind;
11334
if (this.
CurrentToken
.ContextualKind == SyntaxKind.FromKeyword && IsInQuery)
11341
this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.
CurrentToken
.Text));
11388
if (this.
CurrentToken
.Kind == SyntaxKind.QuestionToken && precedence <= Precedence.Conditional)
11486
if (this.
CurrentToken
.Kind != SyntaxKind.ColonToken &&
11504
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
11516
if (this.
CurrentToken
.Kind == SyntaxKind.EndOfFileToken && this.lexer.InterpolationFollowedByColon)
11575
var token1 = this.
CurrentToken
;
11677
if (operatorExpressionKind == SyntaxKind.SimpleAssignmentExpression &&
CurrentToken
.Kind == SyntaxKind.RefKeyword &&
11697
if (this.
CurrentToken
.Kind != SyntaxKind.DotToken)
11701
return nextToken.Kind == SyntaxKind.DotToken && NoTriviaBetween(this.
CurrentToken
, nextToken);
11719
if (this.
CurrentToken
is { Kind: SyntaxKind.DotToken } token3 &&
11789
var tk = this.
CurrentToken
.Kind;
11825
return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, this.
CurrentToken
.Text);
11854
return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, this.
CurrentToken
.Text);
11922
if (this.
CurrentToken
.Kind != SyntaxKind.DotToken || tk == SyntaxKind.VoidKeyword)
11957
switch (this.
CurrentToken
.Kind)
11969
expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.
CurrentToken
.Kind), expr, this.EatToken());
12004
if (this.
CurrentToken
.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia) &&
12038
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.BaseKeyword);
12052
if (precedence > Precedence.Assignment || !(this.
CurrentToken
.IsIdentifierVar() || IsPredefinedType(this.
CurrentToken
.Kind)))
12061
this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken && ScanDesignator() &&
12062
this.
CurrentToken
.Kind == SyntaxKind.EqualsToken;
12067
switch (this.
CurrentToken
.Kind)
12086
switch (this.
CurrentToken
.Kind)
12160
if (this.
CurrentToken
.Kind == SyntaxKind.QuestionToken)
12199
return this.
CurrentToken
.Kind != SyntaxKind.ColonToken;
12212
while (this.
CurrentToken
.Kind == SyntaxKind.ExclamationToken)
12248
=> this.
CurrentToken
.Kind switch
12307
openToken = this.
CurrentToken
.Kind is SyntaxKind.OpenParenToken or SyntaxKind.OpenBracketToken
12314
if (this.
CurrentToken
.Kind != closeKind && this.
CurrentToken
.Kind != SyntaxKind.SemicolonToken)
12342
else if (isIndexer && this.
CurrentToken
.Kind == closeKind)
12358
closeToken = this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken
12367
if (@this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken)
12371
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleArgumentExpression(),
12372
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind || p.
CurrentToken
.Kind == SyntaxKind.SemicolonToken,
12379
return this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken;
12384
return IsValidArgumentRefKindKeyword(this.
CurrentToken
.Kind) || this.IsPossibleExpression();
12402
var nameColon = this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.ColonToken
12409
if (IsValidArgumentRefKindKeyword(this.
CurrentToken
.Kind) &&
12411
!(this.
CurrentToken
.Kind == SyntaxKind.RefKeyword &&
12419
if (isIndexer && this.
CurrentToken
.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseBracketToken)
12423
else if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
12455
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
12533
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.OpenParenToken);
12564
Debug.Assert(
CurrentToken
.Kind == SyntaxKind.OpenParenToken);
12590
if (IsParameterModifierIncludingScoped(this.
CurrentToken
))
12616
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
12624
switch (this.
CurrentToken
.Kind)
12640
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken);
12668
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
12676
if (expression.Kind == SyntaxKind.IdentifierName && this.
CurrentToken
.Kind == SyntaxKind.ColonToken)
12697
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
12702
var argument = expression.Kind != SyntaxKind.IdentifierName || this.
CurrentToken
.Kind != SyntaxKind.ColonToken
12728
if (this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
12741
if (this.
CurrentToken
.Kind != SyntaxKind.CloseParenToken)
12748
if (forPattern && this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
12770
return !forPattern || this.
CurrentToken
.Kind switch
12795
return this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken || CanFollowCast(this.
CurrentToken
.Kind);
12801
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken &&
12810
return CanFollowCast(this.
CurrentToken
.Kind);
12841
return this.
CurrentToken
.ContextualKind is SyntaxKind.OrKeyword or SyntaxKind.AndKeyword;
12870
if (
CurrentToken
.Kind == SyntaxKind.OpenBracketToken)
12886
if (this.
CurrentToken
.Kind == SyntaxKind.StaticKeyword)
12891
else if (this.
CurrentToken
.ContextualKind == SyntaxKind.AsyncKeyword &&
12905
if (this.
CurrentToken
.Kind == SyntaxKind.EqualsGreaterThanToken)
12915
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
12923
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken &&
12934
if (this.
CurrentToken
.ContextualKind == SyntaxKind.AsyncKeyword &&
12943
if (st == ScanTypeFlags.NotType || this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
12960
if (this.
CurrentToken
.Kind == SyntaxKind.IdentifierToken &&
12968
if (this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
13040
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.NewKeyword);
13059
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken);
13080
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleCollectionElement(),
13081
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
13100
return this.
CurrentToken
.Kind == SyntaxKind.NewKeyword && this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken;
13108
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken);
13145
return this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken;
13160
return this.
CurrentToken
.Kind == SyntaxKind.OpenBracketToken;
13176
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken)
13186
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
13191
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken)
13213
if (this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
13224
switch (this.
CurrentToken
.Kind)
13343
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleExpression(),
13344
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
13353
this.
CurrentToken
.Kind == SyntaxKind.ColonToken
13356
this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
13367
this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
13395
Debug.Assert(this.
CurrentToken
.Kind is SyntaxKind.NewKeyword or SyntaxKind.StackAllocKeyword);
13422
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
13462
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleVariableInitializer(),
13463
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
13489
if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
13511
this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken ? this.ParseArrayInitializer() : null);
13528
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
13541
if (this.
CurrentToken
.Kind != SyntaxKind.OpenBraceToken)
13572
if (this.
CurrentToken
.Kind == SyntaxKind.StaticKeyword)
13578
if (this.
CurrentToken
.ContextualKind == SyntaxKind.AsyncKeyword &&
13593
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.AsyncKeyword);
13618
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken &&
13646
if (
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
13653
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
13666
var identifier = (this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.EqualsGreaterThanToken)
13683
=>
CurrentToken
.Kind == SyntaxKind.OpenBraceToken
13714
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleLambdaParameter(),
13715
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind,
13722
switch (this.
CurrentToken
.Kind)
13740
return IsPredefinedType(this.
CurrentToken
.Kind);
13751
if (IsParameterModifierIncludingScoped(this.
CurrentToken
))
13778
if (IsPredefinedType(this.
CurrentToken
.Kind))
13784
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken)
13794
if (this.IsTrueIdentifier(this.
CurrentToken
))
13821
=> IsTokenQueryContextualKeyword(this.
CurrentToken
);
13863
return this.
CurrentToken
.ContextualKind == SyntaxKind.FromKeyword &&
13916
return this.ScanType() != ScanTypeFlags.NotType && this.
CurrentToken
.Kind is SyntaxKind.IdentifierToken or SyntaxKind.InKeyword;
13938
switch (this.
CurrentToken
.ContextualKind)
13961
SelectOrGroupClauseSyntax selectOrGroupBy = this.
CurrentToken
.ContextualKind switch
13973
this.
CurrentToken
.ContextualKind == SyntaxKind.IntoKeyword
13980
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.FromKeyword);
13989
(this.
CurrentToken
.Kind != SyntaxKind.IdentifierToken || SyntaxFacts.IsQueryContextualKeyword(this.
CurrentToken
.ContextualKind)))
14013
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.JoinKeyword);
14026
into: this.
CurrentToken
.ContextualKind == SyntaxKind.IntoKeyword
14033
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.LetKeyword);
14037
SyntaxFacts.IsReservedKeyword(this.
CurrentToken
.Kind) && this.PeekToken(1).Kind == SyntaxKind.EqualsToken
14046
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.WhereKeyword);
14054
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.OrderByKeyword);
14062
while (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
14064
if (this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken)
14068
else if (this.
CurrentToken
.Kind == SyntaxKind.CommaToken)
14089
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken,
14090
static (p, _) => p.
CurrentToken
.Kind == SyntaxKind.CloseParenToken
14091
|| p.
CurrentToken
.Kind == SyntaxKind.SemicolonToken
14103
if (this.
CurrentToken
.ContextualKind is SyntaxKind.AscendingKeyword or SyntaxKind.DescendingKeyword)
14117
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.SelectKeyword);
14125
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.GroupKeyword);
14135
Debug.Assert(this.
CurrentToken
.ContextualKind == SyntaxKind.IntoKeyword);
14266
if (requireOneElement || this.
CurrentToken
.Kind != closeTokenKind)
14283
if (this.
CurrentToken
.Kind == closeTokenKind)
14294
nodes.AddSeparator(this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken
14301
if (this.
CurrentToken
.Kind == closeTokenKind)
14336
if (this.
CurrentToken
.Kind == separatorTokenKind)
14341
if (allowSemicolonAsSeparator && this.
CurrentToken
.Kind is SyntaxKind.SemicolonToken)
14430
if (this.
CurrentToken
.Kind == SyntaxKind.EndOfFileToken) return node;
14432
while (this.
CurrentToken
.Kind != SyntaxKind.EndOfFileToken)
Parser\LanguageParser_InterpolatedString.cs (3)
112
Debug.Assert(this.
CurrentToken
.Kind == SyntaxKind.InterpolatedStringToken);
537
if (this.
CurrentToken
.Kind != SyntaxKind.CommaToken)
550
var leading = this.
CurrentToken
.GetLeadingTrivia();
Parser\LanguageParser_Patterns.cs (32)
61
while (this.
CurrentToken
.ContextualKind == SyntaxKind.OrKeyword)
78
var tk =
CurrentToken
.Kind;
84
if (tk == SyntaxKind.IdentifierToken && this.
CurrentToken
.ContextualKind != SyntaxKind.UnderscoreToken &&
85
(this.
CurrentToken
.ContextualKind != SyntaxKind.NameOfKeyword || this.PeekToken(1).Kind != SyntaxKind.OpenParenToken))
107
while (this.
CurrentToken
.ContextualKind == SyntaxKind.AndKeyword)
121
switch (this.
CurrentToken
.Kind)
143
switch (this.
CurrentToken
.Kind)
160
if (this.
CurrentToken
.ContextualKind == SyntaxKind.NotKeyword)
175
var tk = this.
CurrentToken
.Kind;
187
if (
CurrentToken
.ContextualKind == SyntaxKind.UnderscoreToken)
192
switch (
CurrentToken
.Kind)
244
switch (this.
CurrentToken
.Kind)
276
(this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken || this.IsValidPatternDesignation(inSwitchArmPattern)))
285
if (this.
CurrentToken
.Kind == SyntaxKind.OpenParenToken && (type != null || !looksLikeCast()))
360
if (this.
CurrentToken
.Kind == SyntaxKind.OpenBraceToken)
386
if (
CurrentToken
.Kind == SyntaxKind.IdentifierToken)
388
switch (
CurrentToken
.ContextualKind)
477
if (this.
CurrentToken
.Kind != SyntaxKind.OpenParenToken)
509
if (this.
CurrentToken
.Kind == SyntaxKind.ColonToken && ConvertPatternToExpressionIfPossible(pattern, permitTypeArguments: true) is ExpressionSyntax expr)
530
this.
CurrentToken
.Kind is
543
if (@this.
CurrentToken
.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBraceToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken)
550
if (@this._termState.HasFlag(TerminatorState.IsExpressionOrPatternInCaseLabelOfSwitchStatement) && @this.
CurrentToken
.Kind is SyntaxKind.ColonToken)
559
if (@this._termState.HasFlag(TerminatorState.IsPatternInSwitchExpressionArm) && @this.
CurrentToken
.Kind is SyntaxKind.EqualsGreaterThanToken or SyntaxKind.ColonToken)
563
static p => p.
CurrentToken
.Kind != SyntaxKind.CommaToken && !p.IsPossibleSubpatternElement(),
564
static (p, closeKind) => p.
CurrentToken
.Kind == closeKind || p.
CurrentToken
.Kind == SyntaxKind.SemicolonToken,
584
while (this.
CurrentToken
.Kind != SyntaxKind.CloseBraceToken)
590
var errantCase = this.
CurrentToken
.Kind == SyntaxKind.CaseKeyword
609
this.
CurrentToken
.Kind == SyntaxKind.ColonToken
615
if (errantCase is null && switchExpressionCase.FullWidth == 0 && this.
CurrentToken
.Kind != SyntaxKind.CommaToken)
622
if (this.
CurrentToken
.Kind != SyntaxKind.CloseBraceToken)
624
var commaToken = this.
CurrentToken
.Kind == SyntaxKind.SemicolonToken
Parser\SyntaxParser.cs (12)
488
var ct = this.
CurrentToken
;
498
=> this.
CurrentToken
.Kind == kind ? this.EatToken() : null;
525
var ct = this.
CurrentToken
;
533
return CreateMissingToken(kind, this.
CurrentToken
.Kind);
541
var ct = this.
CurrentToken
;
548
var replacement = CreateMissingToken(expected, this.
CurrentToken
.Kind);
578
if (this.
CurrentToken
.Kind != kind)
592
if (this.
CurrentToken
.Kind != kind)
611
var token = this.
CurrentToken
;
649
if (this.
CurrentToken
.ContextualKind != kind)
663
var contextualKind = this.
CurrentToken
.ContextualKind;
847
var token = this.
CurrentToken
;