709 references to CurrentToken
Microsoft.CodeAnalysis.CSharp (709)
Parser\DirectiveParser.cs (28)
50SyntaxKind contextualKind = this.CurrentToken.ContextualKind; 89result = (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) ? 366switch (this.CurrentToken.Kind) 387if (this.CurrentToken.Kind == SyntaxKind.StringLiteralToken && 388(line.IsMissing || line.GetTrailingTriviaWidth() > 0 || this.CurrentToken.GetLeadingTriviaWidth() > 0)) //require separation between line number and file name 403Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 422var characterOffset = (CurrentToken.Kind == SyntaxKind.NumericLiteralToken) ? 535SyntaxToken setting = this.CurrentToken.Kind switch 543SyntaxToken target = this.CurrentToken.Kind switch 564if (this.CurrentToken.ContextualKind == SyntaxKind.WarningKeyword) 568if (this.CurrentToken.Kind == SyntaxKind.DisableKeyword || this.CurrentToken.Kind == SyntaxKind.RestoreKeyword) 573while (this.CurrentToken.Kind != SyntaxKind.EndOfDirectiveToken) 578if (this.CurrentToken.Kind == SyntaxKind.NumericLiteralToken) 590else if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 611if (this.CurrentToken.Kind != SyntaxKind.CommaToken) 629else if (this.CurrentToken.Kind == SyntaxKind.ChecksumKeyword) 692if (this.CurrentToken.Kind != SyntaxKind.EndOfDirectiveToken && 693this.CurrentToken.Kind != SyntaxKind.EndOfFileToken) 712while (this.CurrentToken.Kind != SyntaxKind.EndOfDirectiveToken && 713this.CurrentToken.Kind != SyntaxKind.EndOfFileToken) 720SyntaxToken endOfDirective = this.CurrentToken.Kind == SyntaxKind.EndOfDirectiveToken 741while (this.CurrentToken.Kind == SyntaxKind.BarBarToken) 754while (this.CurrentToken.Kind == SyntaxKind.AmpersandAmpersandToken) 767while (this.CurrentToken.Kind == SyntaxKind.EqualsEqualsToken || this.CurrentToken.Kind == SyntaxKind.ExclamationEqualsToken) 779if (this.CurrentToken.Kind == SyntaxKind.ExclamationToken) 790var k = this.CurrentToken.Kind;
Parser\DocumentationCommentParser.cs (74)
81if (this.CurrentToken.Kind != SyntaxKind.EndOfDocumentationCommentToken) 101bool endTag = this.CurrentToken.Kind == SyntaxKind.LessThanSlashToken; 108while (this.CurrentToken.Kind != SyntaxKind.EndOfDocumentationCommentToken) 147switch (this.CurrentToken.Kind) 171switch (this.CurrentToken.Kind) 190while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 191|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken 192|| this.CurrentToken.Kind == SyntaxKind.XmlEntityLiteralToken) 218if (this.CurrentToken.Kind == SyntaxKind.GreaterThanToken) 258if (this.CurrentToken.Kind != SyntaxKind.GreaterThanToken) 328if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 452switch (this.CurrentToken.Kind) 525SyntaxToken openQuote = EatToken(this.CurrentToken.Kind == SyntaxKind.SingleQuoteToken 532SyntaxToken current = this.CurrentToken; 539current = this.CurrentToken; 606while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 607|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken 608|| this.CurrentToken.Kind == SyntaxKind.XmlEntityLiteralToken 609|| this.CurrentToken.Kind == SyntaxKind.LessThanToken) 631if (IsNonAsciiQuotationMark(this.CurrentToken)) 636var quoteKind = this.CurrentToken.Kind == SyntaxKind.SingleQuoteToken 650if (IsNonAsciiQuotationMark(this.CurrentToken)) 685if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 725while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 726|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken 727|| this.CurrentToken.Kind == SyntaxKind.MinusMinusToken) 752while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 753|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken) 774while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 775|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken) 900else if (type.Kind != SyntaxKind.QualifiedName && this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 940switch (CurrentToken.Kind) 971Debug.Assert(CurrentToken.Kind == SyntaxKind.ThisKeyword); 983Debug.Assert(CurrentToken.Kind == SyntaxKind.OperatorKeyword); 989if (SyntaxFacts.IsAnyOverloadableOperator(CurrentToken.Kind)) 1002if (SyntaxFacts.IsUnaryOperatorDeclarationToken(CurrentToken.Kind) || SyntaxFacts.IsBinaryExpressionOperatorToken(CurrentToken.Kind)) 1015if (operatorToken.Kind == SyntaxKind.GreaterThanToken && operatorToken.GetTrailingTriviaWidth() == 0 && CurrentToken.GetLeadingTriviaWidth() == 0) 1017if (CurrentToken.Kind == SyntaxKind.GreaterThanToken) 1021if (operatorToken2.GetTrailingTriviaWidth() == 0 && CurrentToken.GetLeadingTriviaWidth() == 0 && 1022CurrentToken.Kind is (SyntaxKind.GreaterThanToken or SyntaxKind.GreaterThanEqualsToken)) 1069else if (CurrentToken.Kind == SyntaxKind.EqualsToken) 1079else if (CurrentToken.Kind == SyntaxKind.GreaterThanEqualsToken) 1115(isConversion || SyntaxFacts.IsAnyOverloadableOperator(CurrentToken.Kind))) 1124if (CurrentToken.Kind == SyntaxKind.UncheckedKeyword) 1141Debug.Assert(CurrentToken.Kind == SyntaxKind.ExplicitKeyword || 1142CurrentToken.Kind == SyntaxKind.ImplicitKeyword); 1179if (CurrentToken.Kind != openKind) 1189while (CurrentToken.Kind == SyntaxKind.CommaToken || IsPossibleCrefParameter()) 1193if (CurrentToken.Kind != closeKind) 1204Debug.Assert(CurrentToken.Kind != SyntaxKind.CommaToken); 1229SyntaxKind kind = this.CurrentToken.Kind; 1251switch (CurrentToken.Kind) 1261if (CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword && refKindOpt is not null) 1288if (CurrentToken.Kind != SyntaxKind.LessThanToken) 1310var currentKind = CurrentToken.Kind; 1312SyntaxFacts.IsPredefinedType(CurrentToken.Kind)) 1372if (SyntaxFacts.IsPredefinedType(CurrentToken.Kind)) 1381else if (CurrentToken.Kind == SyntaxKind.IdentifierToken && PeekToken(1).Kind == SyntaxKind.ColonColonToken) 1401if (checkForMember && (leftName.IsMissing || CurrentToken.Kind != SyntaxKind.DotToken)) 1413while (CurrentToken.Kind == SyntaxKind.DotToken) 1422if (checkForMember && (rightName.IsMissing || CurrentToken.Kind != SyntaxKind.DotToken)) 1444if (CurrentToken.Kind == SyntaxKind.QuestionToken) 1449while (CurrentToken.Kind == SyntaxKind.AsteriskToken) 1454if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 1460while (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 1466while (this.CurrentToken.Kind != SyntaxKind.CloseBracketToken) 1468if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 1518switch (CurrentToken.Kind) 1530return CurrentToken.Text == SyntaxFacts.GetText(SyntaxKind.LessThanToken) || 1531IsNonAsciiQuotationMark(CurrentToken); 1586switch (CurrentToken.Kind) 1598return CurrentToken.Text == SyntaxFacts.GetText(SyntaxKind.LessThanToken) || 1599IsNonAsciiQuotationMark(CurrentToken);
Parser\LanguageParser.cs (563)
97if (this.CurrentToken.Kind == SyntaxKind.EndOfFileToken) 252Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NamespaceKeyword); 265if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 269else if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken || IsPossibleNamespaceMemberDeclaration()) 587switch (this.CurrentToken.Kind) 676if (this.CurrentToken.ContextualKind != SyntaxKind.GlobalKeyword || this.PeekToken(1).Kind != SyntaxKind.UsingKeyword) 863switch (this.CurrentToken.Kind) 872return IsPossibleStartOfTypeDeclaration(this.CurrentToken.Kind); 878if (this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword) 895return this.CurrentToken.Kind == SyntaxKind.CloseBraceToken; 920return this.CurrentToken.Kind == SyntaxKind.ExternKeyword 933Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ExternKeyword); 957var globalToken = this.CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword 961Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UsingKeyword); 968if (staticToken is null && unsafeToken != null && this.CurrentToken.Kind == SyntaxKind.StaticKeyword) 980var isAliasToFunctionPointer = alias != null && this.CurrentToken.Kind == SyntaxKind.DelegateKeyword; 999type = WithAdditionalDiagnostics(CreateMissingIdentifierName(), GetExpectedTokenError(SyntaxKind.IdentifierToken, this.CurrentToken.Kind)); 1022return this.CurrentToken.Kind == SyntaxKind.OpenBracketToken 1042if (this.CurrentToken.Kind != SyntaxKind.OpenBracketToken) 1060if (SyntaxFacts.IsLiteralExpression(this.CurrentToken.Kind)) 1104return this.CurrentToken.Kind == SyntaxKind.CloseBracketToken 1109=> IsSomeWord(this.CurrentToken.Kind) && this.PeekToken(1).Kind == SyntaxKind.ColonToken; 1154if (this.CurrentToken.Kind == SyntaxKind.DotToken) 1160if (this.CurrentToken.Kind == SyntaxKind.MinusGreaterThanToken) 1165if (this.CurrentToken.Kind == SyntaxKind.QuestionToken && 1208if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 1268if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 1359var newMod = GetModifierExcludingScoped(this.CurrentToken); 1496Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None); 1515(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword)) 1532var currentTokenKind = this.CurrentToken.Kind; 1554var currentTokenKind = this.CurrentToken.Kind; 1572if (SyntaxFacts.IsPredefinedType(this.CurrentToken.Kind)) 1579if (IsNonContextualModifier(this.CurrentToken)) 1614Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1655Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1670switch (this.CurrentToken.Kind) 1673if (this.CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword) 1693switch (this.CurrentToken.Kind) 1711Debug.Assert(CurrentToken.ContextualKind == SyntaxKind.RecordKeyword); 1715throw ExceptionUtilities.UnexpectedValue(this.CurrentToken.Kind); 1721Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword or SyntaxKind.InterfaceKeyword || 1722this.CurrentToken.ContextualKind == SyntaxKind.RecordKeyword); 1741var paramList = CurrentToken.Kind == SyntaxKind.OpenParenToken 1753if (this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 1764if (CurrentToken.Kind == SyntaxKind.SemicolonToken) 1788SyntaxKind kind = this.CurrentToken.Kind; 1826closeBrace = WithAdditionalDiagnostics(closeBrace, this.GetExpectedTokenError(SyntaxKind.CloseBraceToken, this.CurrentToken.Kind)); 1853if (this.CurrentToken.ContextualKind == SyntaxKind.RecordKeyword) 1856recordModifier = this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword 1863if (this.CurrentToken.Kind is SyntaxKind.StructKeyword or SyntaxKind.ClassKeyword && 1998SyntaxKind kind = this.CurrentToken.Kind; 2046return this.IsPossibleMemberStart() || this.CurrentToken.Kind == SyntaxKind.CloseBraceToken; 2051return this.CurrentToken.Kind is SyntaxKind.ColonToken or SyntaxKind.OpenBraceToken 2068list.Add(this.CurrentToken.Kind == SyntaxKind.OpenParenToken 2075if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.SemicolonToken || 2081if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 2095if (GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None) 2127this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword && 2134while (this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 2152if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken || this.IsCurrentTokenWhereOfConstraintClause()) 2166if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 2167|| ((_termState & TerminatorState.IsEndOfRecordOrClassOrStructOrInterfaceSignature) != 0 && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 2168|| this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken 2169|| this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 2173else if (haveComma = (this.CurrentToken.Kind == SyntaxKind.CommaToken) || this.IsPossibleTypeParameterConstraint()) 2221switch (this.CurrentToken.Kind) 2230return (this.CurrentToken.ContextualKind == SyntaxKind.AllowsKeyword && PeekToken(1).Kind == SyntaxKind.RefKeyword) || this.IsTrueIdentifier(); 2232return IsPredefinedType(this.CurrentToken.Kind); 2238return this.CurrentToken.Kind switch 2250this.CurrentToken.Kind == SyntaxKind.QuestionToken 2282if (this.CurrentToken.ContextualKind == SyntaxKind.AllowsKeyword && 2296if (this.CurrentToken.Kind == SyntaxKind.CommaToken && PeekToken(1).Kind == SyntaxKind.RefKeyword) 2314return CanStartMember(this.CurrentToken.Kind); 2375switch (this.CurrentToken.Kind) 2385if (CurrentToken.ContextualKind == SyntaxKind.RecordKeyword) 2521switch (this.CurrentToken.Kind) 2567if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.OpenParenToken) 2601if (this.CurrentToken.Kind == SyntaxKind.ConstKeyword) 2614if (this.CurrentToken.Kind == SyntaxKind.EventKeyword) 2620if (this.CurrentToken.Kind == SyntaxKind.FixedKeyword) 2632if (this.CurrentToken.Kind == SyntaxKind.NamespaceKeyword) 2654if (this.CurrentToken.Kind is not SyntaxKind.CloseBraceToken and not SyntaxKind.EndOfFileToken && 2899if (CurrentToken.Kind == SyntaxKind.UsingKeyword) 2904if (CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword) 2919if (GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None && 2920this.CurrentToken.ContextualKind is not (SyntaxKind.PartialKeyword or SyntaxKind.AsyncKeyword or SyntaxKind.RequiredKeyword or SyntaxKind.FileKeyword) && 2923var misplacedModifier = this.CurrentToken; 2967incompleteMember.FullWidth + this.CurrentToken.GetLeadingTriviaWidth(), 2968this.CurrentToken.Width, 2970this.CurrentToken.Text); 2987|| this.CurrentToken.Kind is not SyntaxKind.OpenParenToken and not SyntaxKind.OpenBraceToken and not SyntaxKind.EqualsGreaterThanToken) && 3015if (IsStartOfPropertyBody(this.CurrentToken.Kind) || 3016(this.CurrentToken.Kind is SyntaxKind.SemicolonToken && IsStartOfPropertyBody(this.PeekToken(1).Kind))) 3069if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.OpenParenToken) 3075if (this.CurrentToken.Kind == SyntaxKind.TildeToken) 3081if (this.CurrentToken.Kind == SyntaxKind.ConstKeyword) 3087if (this.CurrentToken.Kind == SyntaxKind.EventKeyword) 3093if (this.CurrentToken.Kind == SyntaxKind.FixedKeyword) 3225if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 3230if (this.CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword) 3270return this.CurrentToken.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword or SyntaxKind.OperatorKeyword; 3312var initializer = this.CurrentToken.Kind == SyntaxKind.ColonToken 3331var kind = this.CurrentToken.Kind == SyntaxKind.BaseKeyword 3336if (this.CurrentToken.Kind is SyntaxKind.BaseKeyword or SyntaxKind.ThisKeyword) 3348var argumentList = this.CurrentToken.Kind == SyntaxKind.OpenParenToken 3360Debug.Assert(this.CurrentToken.Kind == SyntaxKind.TildeToken); 3386if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 3394blockBody = this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 3398expressionBody = this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken 3409else if (parseSemicolonAfterBlock && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 3421if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 3427if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 3433if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken) 3449=> this.CurrentToken.Kind is SyntaxKind.SemicolonToken or SyntaxKind.OpenBraceToken; 3453return this.CurrentToken.Kind is SyntaxKind.SemicolonToken or SyntaxKind.OpenBraceToken; 3457=> this.CurrentToken.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken; 3460=> this.CurrentToken.Kind == (errored ? SyntaxKind.CloseParenToken : SyntaxKind.GreaterThanToken); 3463=> this.CurrentToken.Kind == SyntaxKind.CloseBracketToken; 3480if (this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 3485else if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 3488var colonToken = this.CurrentToken; 3538switch (this.CurrentToken.Kind) 3557if (this.CurrentToken.Kind is not (SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword)) 3561if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 3571if (this.CurrentToken.Kind == SyntaxKind.OperatorKeyword) 3585(IsMakingProgress(ref lastTokenPosition, assertIfFalse: false) && this.CurrentToken.Kind != SyntaxKind.OpenParenToken)) 3591separatorKind = this.CurrentToken.Kind; 3613if (this.CurrentToken.Kind != SyntaxKind.OperatorKeyword || 3635var style = this.CurrentToken.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword 3645if (!style.IsMissing && explicitInterfaceOpt is not null && this.CurrentToken.Kind != SyntaxKind.OperatorKeyword && style.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia)) 3677bool couldBeParameterList = this.CurrentToken.Kind == SyntaxKind.OpenParenToken; 3682this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 3713if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 3730if (this.CurrentToken.Kind == SyntaxKind.OperatorKeyword) 3740(IsMakingProgress(ref lastTokenPosition, assertIfFalse: false) && this.CurrentToken.Kind != SyntaxKind.OpenParenToken); 3779if (CurrentToken.Kind == SyntaxKind.UncheckedKeyword) 3798var firstToken = this.CurrentToken; 3831if (SyntaxFacts.IsAnyOverloadableOperator(this.CurrentToken.Kind)) 3840if (this.CurrentToken.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword) 3874var tk = this.CurrentToken; 3879tk = this.CurrentToken; 3984if (this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken) 3992if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4001if (this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken 4036if (this.CurrentToken.Kind is SyntaxKind.SemicolonToken) 4042Debug.Assert(IsStartOfPropertyBody(this.CurrentToken.Kind)); 4044var accessorList = this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 4052if (this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken) 4060else if (this.CurrentToken.Kind == SyntaxKind.EqualsToken) 4072else if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4126if (this.CurrentToken.Kind == SyntaxKind.CloseBraceToken) 4161var refKeyword = this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 4179return this.CurrentToken.Kind == SyntaxKind.IdentifierToken 4181|| SyntaxFacts.GetAccessorDeclarationKind(this.CurrentToken.ContextualKind) != SyntaxKind.None 4182|| this.CurrentToken.Kind == SyntaxKind.OpenBraceToken // for accessor blocks w/ missing keyword 4183|| this.CurrentToken.Kind == SyntaxKind.SemicolonToken // for empty body accessors w/ missing keyword 4205if (GetModifierExcludingScoped(this.CurrentToken) == DeclarationModifiers.None) 4353var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 4379var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4435bool currentTokenIsSemicolon = this.CurrentToken.Kind == SyntaxKind.SemicolonToken; 4436bool currentTokenIsArrow = this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken; 4437bool currentTokenIsOpenBraceToken = this.CurrentToken.Kind == SyntaxKind.OpenBraceToken; 4622return this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken; 4627switch (this.CurrentToken.Kind) 4639return IsParameterModifierExcludingScoped(this.CurrentToken) || IsPossibleScopedKeyword(isFunctionPointerParameter: false) || IsPredefinedType(this.CurrentToken.Kind); 4691if (this.CurrentToken.Kind == SyntaxKind.ArgListKeyword) 4702if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && IsCurrentTokenWhereOfConstraintClause()) 4712if (this.CurrentToken.Kind is SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind is SyntaxKind.CloseBracketToken) 4754while (IsParameterModifierExcludingScoped(this.CurrentToken)) 4756if (this.CurrentToken.Kind is SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword) 4773while (this.CurrentToken.Kind is (SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword or SyntaxKind.ReadOnlyKeyword)) 4786Debug.Assert(this.CurrentToken.Kind == SyntaxKind.FixedKeyword); 4804Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EventKeyword); 4828if (explicitInterfaceOpt != null && this.CurrentToken.Kind is not SyntaxKind.OpenBraceToken and not SyntaxKind.SemicolonToken) 4880if (explicitInterfaceOpt != null && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4907if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4960if (this.CurrentToken.Kind == SyntaxKind.DotToken) 4976return this.CurrentToken.Kind == SyntaxKind.SemicolonToken; 5041if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 5045else if (stopOnCloseParen && this.CurrentToken.Kind == SyntaxKind.CloseParenToken) 5049else if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 5253var currentTokenKind = this.CurrentToken.Kind; 5263currentTokenKind = this.CurrentToken.Kind; 5314switch (this.CurrentToken.Kind) 5325var refKeyword = isLocalOrField && !isConst && this.CurrentToken.Kind == SyntaxKind.RefKeyword && !this.IsPossibleLambdaExpression(Precedence.Expression) 5402if (this.CurrentToken.Kind == SyntaxKind.EqualsToken) 5438Debug.Assert(this.CurrentToken.Kind is SyntaxKind.OpenParenToken or SyntaxKind.LessThanToken); 5446(this.CurrentToken.Kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken || 5447this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword)) 5457switch (this.CurrentToken.Kind) 5469return this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 5476return this.CurrentToken.Kind == SyntaxKind.OpenBraceToken || this.IsPossibleExpression(); 5495Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DelegateKeyword); 5506if (this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 5528Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EnumKeyword); 5543if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 5559if (CurrentToken.Kind == SyntaxKind.SemicolonToken) 5620if (this.CurrentToken.Kind == SyntaxKind.EqualsToken) 5625this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseBraceToken 5635return this.CurrentToken.Kind == SyntaxKind.OpenBracketToken || this.IsTrueIdentifier(); 5640return this.CurrentToken.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken; 5679if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 5719var ctk = this.CurrentToken.Kind; 5731result = this.AddError(result, ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text); 5757if (this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword) 5770return CurrentToken.ContextualKind == SyntaxKind.FieldKeyword && 5777if (this.CurrentToken.Kind != SyntaxKind.LessThanToken) 5819if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind != SyntaxKind.CloseBracketToken) 5823if (this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword) 5840if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind != SyntaxKind.CloseBracketToken) 5850this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 5867if (this.CurrentToken.Kind == SyntaxKind.LessThanToken) 5877Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 5902if (this.CurrentToken.Kind != SyntaxKind.LessThanToken) 5952switch (this.CurrentToken.Kind) 6034Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6044while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 6061if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken) 6067if (this.CurrentToken.Kind == SyntaxKind.GreaterThanToken) 6076if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 6111isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken; 6138isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken; 6160isDefinitelyTypeArgumentList = this.CurrentToken.Kind == SyntaxKind.CommaToken; 6178while (this.CurrentToken.Kind == SyntaxKind.CommaToken); 6180if (this.CurrentToken.Kind != SyntaxKind.GreaterThanToken) 6186if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken) 6195if (lastScannedType is ScanTypeFlags.TupleType && this.CurrentToken.Kind is SyntaxKind.OpenParenToken) 6208isDefinitelyTypeArgumentList = isDefinitelyTypeArgumentList || this.CurrentToken.Kind is SyntaxKind.CloseParenToken; 6220Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6230while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 6247if (this.CurrentToken.Kind == SyntaxKind.GreaterThanToken) 6254if (tokenBreaksTypeArgumentList(this.CurrentToken)) 6263if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken && tokenBreaksTypeArgumentList(this.PeekToken(1))) 6272if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken 6278if (this.CurrentToken.Kind == SyntaxKind.CommaToken || this.IsPossibleType()) 6357if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken && this.PeekToken(1).Kind != SyntaxKind.CloseBracketToken) 6373var varianceToken = this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword 6400this.CurrentToken.Kind is not SyntaxKind.CommaToken and not SyntaxKind.GreaterThanToken && 6422=> this.CurrentToken.Kind == SyntaxKind.GreaterThanToken; 6426Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6464if (this.CurrentToken.Kind == SyntaxKind.ThisKeyword) 6515if (isEvent && this.CurrentToken.Kind is not SyntaxKind.OpenBraceToken and not SyntaxKind.SemicolonToken) 6586separator = this.CurrentToken.Kind == SyntaxKind.ColonColonToken 6599if (this.CurrentToken.Kind == SyntaxKind.ColonColonToken) 6628if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 6704return this.CurrentToken.Kind == SyntaxKind.ColonColonToken 6834var tk = this.CurrentToken.Kind; 6855if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken || !this.IsTrueIdentifier()) 6862if (this.CurrentToken.Kind == SyntaxKind.LessThanToken) 6877if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 6882if (this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword) 6889if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken or SyntaxKind.ColonColonToken) 6892if (this.CurrentToken.Kind is SyntaxKind.ColonColonToken) 6906Debug.Assert(this.CurrentToken.Kind is SyntaxKind.IdentifierToken); 6946else if (IsPredefinedType(this.CurrentToken.Kind)) 6952else if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 6957if (result == ScanTypeFlags.NotType || mode == ParseTypeMode.DefinitePattern && this.CurrentToken.Kind != SyntaxKind.OpenBracketToken) 6977switch (this.CurrentToken.Kind) 7018while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 7023if (this.CurrentToken.Kind != SyntaxKind.CloseBracketToken) 7056if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 7074while (this.CurrentToken.Kind == SyntaxKind.CommaToken); 7076if (this.CurrentToken.Kind == SyntaxKind.CloseParenToken) 7098if (CurrentToken.Kind == SyntaxKind.IdentifierToken) 7101switch (CurrentToken) 7116if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 7133Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7146if (!IsPossibleFunctionPointerParameterListStart(CurrentToken)) 7186if (!validStartingToken && CurrentToken.Kind == SyntaxKind.CloseParenToken) 7200isNotExpectedFunction: static p => p.CurrentToken.Kind != SyntaxKind.CommaToken, 7221if (this.CurrentToken.Kind == SyntaxKind.VoidKeyword && this.PeekToken(1).Kind != SyntaxKind.AsteriskToken) 7246if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 7250this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7294switch (this.CurrentToken.Kind) 7342while (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken); 7363Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 7386if (mode == ParseTypeMode.AfterIs && this.CurrentToken.Kind is SyntaxKind.OpenBracketToken) 7413return this.CurrentToken.Kind != SyntaxKind.ColonToken; 7440if (IsTrueIdentifier(this.CurrentToken)) 7449if (this.CurrentToken.ContextualKind is SyntaxKind.AsyncKeyword or SyntaxKind.AwaitKeyword or SyntaxKind.FromKeyword) 7503if (this.CurrentToken.Kind is SyntaxKind.OpenBracketToken) 7512this.CurrentToken.Kind is SyntaxKind.OpenParenToken or // ctor parameters 7547while (IsMakingProgress(ref lastTokenPosition) && this.CurrentToken.Kind != SyntaxKind.CloseBracketToken) 7549if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 7562if (this.CurrentToken.Kind != SyntaxKind.CloseBracketToken) 7607if (this.CurrentToken.Kind != SyntaxKind.CloseParenToken) 7611while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 7653if (IsPredefinedType(this.CurrentToken.Kind)) 7657if (token.Kind == SyntaxKind.VoidKeyword && this.CurrentToken.Kind != SyntaxKind.AsteriskToken) 7666if (IsTrueIdentifier() || this.CurrentToken.Kind == SyntaxKind.ColonColonToken) 7671if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 7694if (!IsPossibleFunctionPointerParameterListStart(CurrentToken)) 7737Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7748lessThanToken.IsMissing && CurrentToken.Kind == SyntaxKind.CloseParenToken 7771if (CurrentToken.Kind == SyntaxKind.IdentifierToken) 7775switch (CurrentToken) 7779managedSpecifier = EatContextualToken(CurrentToken.ContextualKind); 7799if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 7817Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7847=> CurrentToken.Kind == SyntaxKind.DelegateKeyword && PeekToken(1).Kind == SyntaxKind.AsteriskToken; 7858while (this.CurrentToken.Kind == SyntaxKind.AsteriskToken) 7878if (this.CurrentToken.Kind != SyntaxKind.OpenBracketToken) 7892while (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken) 7902var isCollectionExpression = this.CurrentToken.Kind 7915|| IsExpectedBinaryOperator(this.CurrentToken.Kind) 7916|| IsExpectedAssignmentOperator(this.CurrentToken.Kind) 7917|| (this.CurrentToken.ContextualKind is SyntaxKind.SwitchKeyword or SyntaxKind.WithKeyword && this.PeekToken(1).Kind is SyntaxKind.OpenBraceToken); 7921this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 7980switch (this.CurrentToken.Kind) 8076bool beginsWithAwait = this.CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword; 8112if (this.CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword && 8153=> CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword && PeekToken(1).Kind == SyntaxKind.UsingKeyword; 8167return this.CurrentToken.ContextualKind == SyntaxKind.YieldKeyword && 8177var tk = this.CurrentToken.Kind; 8205tk = this.CurrentToken.ContextualKind; 8226bool? typedIdentifier = IsPossibleTypedIdentifierStart(this.CurrentToken, this.PeekToken(1), allowThisKeyword: false); 8247var tk = this.CurrentToken.ContextualKind; 8291if (st == ScanTypeFlags.MustBeType && this.CurrentToken.Kind is not SyntaxKind.DotToken and not SyntaxKind.OpenParenToken) 8296if (st == ScanTypeFlags.NotType || this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 8319if (this.CurrentToken.Kind != SyntaxKind.UsingKeyword) 8385if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken) 8406if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 8413if (this.CurrentToken.Kind == SyntaxKind.EqualsToken) 8422return this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.SemicolonToken; 8440if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken || this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 8447if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 8531Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 8676CSharpSyntaxNode openBrace = isAccessorBody && this.CurrentToken.Kind != SyntaxKind.OpenBraceToken 8757while (this.CurrentToken.Kind is not SyntaxKind.CloseBraceToken and not SyntaxKind.EndOfFileToken 8789return this.CurrentToken.Kind == SyntaxKind.SemicolonToken 8801static (p, _) => p.CurrentToken.Kind == SyntaxKind.CloseBraceToken, 8809var tk = this.CurrentToken.Kind; 8873return this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.OpenBraceToken or SyntaxKind.SemicolonToken; 8936Debug.Assert(this.CurrentToken.Kind is SyntaxKind.TryKeyword or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 8949Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 8963if (this.CurrentToken.Kind == SyntaxKind.CatchKeyword) 8966while (this.CurrentToken.Kind == SyntaxKind.CatchKeyword) 8972if (this.CurrentToken.Kind == SyntaxKind.FinallyKeyword) 9007return this.CurrentToken.Kind is SyntaxKind.CloseBraceToken or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword; 9012Debug.Assert(this.CurrentToken.Kind == SyntaxKind.CatchKeyword); 9019if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 9039var keywordKind = this.CurrentToken.ContextualKind; 9071return this.CurrentToken.Kind is SyntaxKind.CloseParenToken 9080return this.CurrentToken.Kind is SyntaxKind.CloseParenToken 9088return this.CurrentToken.Kind is SyntaxKind.CloseBraceToken 9095Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 9112Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DoKeyword); 9136return this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken; 9153Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9174Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9184var condition = this.CurrentToken.Kind is not SyntaxKind.SemicolonToken and not SyntaxKind.CommaToken 9193var incrementors = this.CurrentToken.Kind != SyntaxKind.CloseParenToken 9222if (this.CurrentToken.ContextualKind == SyntaxKind.ScopedKeyword) 9231isDeclaration = ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind == SyntaxKind.IdentifierToken; 9235else if (this.CurrentToken.Kind == SyntaxKind.RefKeyword) 9252else if (this.CurrentToken.Kind != SyntaxKind.SemicolonToken) 9267=> this.CurrentToken.Kind is SyntaxKind.CommaToken 9275while (this.CurrentToken.Kind is SyntaxKind.SemicolonToken or SyntaxKind.CommaToken) 9299if (@this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken) 9311return this.CurrentToken.Kind is SyntaxKind.SemicolonToken or SyntaxKind.CloseParenToken or SyntaxKind.OpenBraceToken; 9318Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForEachKeyword || this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9329if (this.CurrentToken.Kind == SyntaxKind.ForKeyword) 9423if (this.IsInAsync && this.CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword) 9431if (this.CurrentToken.ContextualKind == SyntaxKind.ScopedKeyword) 9434if (ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 9481return this.CurrentToken.Kind == SyntaxKind.CommaToken; 9483return this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseParenToken; 9496if (!this.CurrentToken.IsIdentifierVar()) 9535Debug.Assert(this.CurrentToken.Kind == SyntaxKind.GotoKeyword); 9543if (this.CurrentToken.Kind is SyntaxKind.CaseKeyword or SyntaxKind.DefaultKeyword) 9568Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 9581var elseKeyword = this.CurrentToken.Kind != SyntaxKind.ElseKeyword ? 9592if (this.CurrentToken.Kind != SyntaxKind.IfKeyword) 9633Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ElseKeyword); 9647return this.CurrentToken.Kind != SyntaxKind.ElseKeyword 9656Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LockKeyword); 9668Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ReturnKeyword); 9672this.CurrentToken.Kind != SyntaxKind.SemicolonToken ? this.ParsePossibleRefExpression() : null, 9678Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.YieldKeyword); 9685if (this.CurrentToken.Kind == SyntaxKind.BreakKeyword) 9694if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 9715Debug.Assert(this.CurrentToken.Kind is SyntaxKind.SwitchKeyword or SyntaxKind.CaseKeyword); 9740if (this.CurrentToken.Kind is SyntaxKind.CaseKeyword) 9785return this.CurrentToken.Kind == SyntaxKind.CaseKeyword || 9786(this.CurrentToken.Kind == SyntaxKind.DefaultKeyword && this.PeekToken(1).Kind != SyntaxKind.OpenParenToken); 9800if (this.CurrentToken.Kind == SyntaxKind.CaseKeyword) 9804if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 9816if (this.CurrentToken.ContextualKind == SyntaxKind.WhenKeyword && node is ExpressionSyntax ex) 9841Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DefaultKeyword); 9863Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ThrowKeyword); 9867this.CurrentToken.Kind != SyntaxKind.SemicolonToken ? this.ParseExpressionCore() : null, 9873Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UnsafeKeyword); 9941if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 9968if (this.CurrentToken.Kind == SyntaxKind.ColonToken && 10000bool condition1 = st == ScanTypeFlags.MustBeType && this.CurrentToken.Kind != SyntaxKind.DotToken; 10001bool condition2 = st != ScanTypeFlags.NotType && this.CurrentToken.Kind == SyntaxKind.IdentifierToken; 10009Debug.Assert(this.CurrentToken.Kind == SyntaxKind.WhileKeyword); 10044else if (this.CurrentToken.Kind == SyntaxKind.UsingKeyword) 10137if (this.CurrentToken.ContextualKind == SyntaxKind.ScopedKeyword) 10143if (this.CurrentToken.Kind is not (SyntaxKind.RefKeyword or SyntaxKind.OutKeyword or SyntaxKind.InKeyword)) 10149? this.CurrentToken.Kind is not (SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken) 10150: this.CurrentToken.Kind != SyntaxKind.IdentifierToken)) 10172if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 10180done = (this.CurrentToken.Kind == SyntaxKind.CloseParenToken); 10193if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 10223return CurrentToken.ContextualKind == SyntaxKind.UnderscoreToken 10230if (this.CurrentToken.ContextualKind != SyntaxKind.WhenKeyword) 10314switch (this.CurrentToken.Kind) 10327while (IsDeclarationModifier(k = this.CurrentToken.ContextualKind) || IsAdditionalLocalFunctionModifier(k)) 10366Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken); 10372if (IsDeclarationModifier(this.CurrentToken.Kind) || 10373IsAdditionalLocalFunctionModifier(this.CurrentToken.Kind)) 10380if (ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 10388while (IsAdditionalLocalFunctionModifier(this.CurrentToken.ContextualKind)); 10529if (this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword) 10572if (IsScript && this.CurrentToken.Kind == SyntaxKind.EndOfFileToken) 10616SyntaxKind tk = this.CurrentToken.Kind; 10662return this.IsTrueIdentifier() || this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword; 10898return (this.IsScript || this.IsInAsync) && this.CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword; 10903if (this.CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword) 10981var tk = this.CurrentToken.Kind; 11023if (this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword && IsInQuery) 11030this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11077if (this.CurrentToken.Kind == SyntaxKind.QuestionToken && precedence <= Precedence.Conditional) 11156if (operatorExpressionKind == SyntaxKind.SimpleAssignmentExpression && CurrentToken.Kind == SyntaxKind.RefKeyword && 11185var token1 = this.CurrentToken; 11294if (this.CurrentToken.Kind != SyntaxKind.ColonToken && 11309if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 11321if (this.CurrentToken.Kind == SyntaxKind.EndOfFileToken && this.lexer.InterpolationFollowedByColon) 11376=> IsAtDotDotToken(this.CurrentToken, this.PeekToken(1)); 11393if (this.CurrentToken is { Kind: SyntaxKind.DotToken } token3 && 11463var tk = this.CurrentToken.Kind; 11499return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text); 11528return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text); 11595if (this.CurrentToken.Kind != SyntaxKind.DotToken || tk == SyntaxKind.VoidKeyword) 11630switch (this.CurrentToken.Kind) 11642expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11677if (this.CurrentToken.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia) && 11714Debug.Assert(this.CurrentToken.Kind == SyntaxKind.BaseKeyword); 11728if (precedence > Precedence.Assignment || !(this.CurrentToken.IsIdentifierVar() || IsPredefinedType(this.CurrentToken.Kind))) 11737this.CurrentToken.Kind == SyntaxKind.OpenParenToken && ScanDesignator() && 11738this.CurrentToken.Kind == SyntaxKind.EqualsToken; 11743switch (this.CurrentToken.Kind) 11762switch (this.CurrentToken.Kind) 11794Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 11820return this.CurrentToken.Kind != SyntaxKind.ColonToken; 11829Debug.Assert(this.CurrentToken.Kind is SyntaxKind.DotToken or SyntaxKind.OpenBracketToken); 11830ExpressionSyntax expr = this.CurrentToken.Kind switch 11843while (this.CurrentToken.Kind == SyntaxKind.ExclamationToken) 11847switch (this.CurrentToken.Kind) 11933openToken = this.CurrentToken.Kind is SyntaxKind.OpenParenToken or SyntaxKind.OpenBracketToken 11940if (this.CurrentToken.Kind != closeKind && this.CurrentToken.Kind != SyntaxKind.SemicolonToken) 11968else if (isIndexer && this.CurrentToken.Kind == closeKind) 11984closeToken = this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken 11993if (@this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken) 12005return this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken; 12010return IsValidArgumentRefKindKeyword(this.CurrentToken.Kind) || this.IsPossibleExpression(); 12028var nameColon = this.CurrentToken.Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.ColonToken 12035if (IsValidArgumentRefKindKeyword(this.CurrentToken.Kind) && 12037!(this.CurrentToken.Kind == SyntaxKind.RefKeyword && 12045if (isIndexer && this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseBracketToken) 12049else if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 12081if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 12154Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12239Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12266if (IsParameterModifierExcludingScoped(this.CurrentToken) || this.CurrentToken.ContextualKind == SyntaxKind.ScopedKeyword) 12295if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken) 12303switch (this.CurrentToken.Kind) 12319Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenParenToken); 12347if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 12355if (expression.Kind == SyntaxKind.IdentifierName && this.CurrentToken.Kind == SyntaxKind.ColonToken) 12376while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 12381var argument = expression.Kind != SyntaxKind.IdentifierName || this.CurrentToken.Kind != SyntaxKind.ColonToken 12407if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 12420if (this.CurrentToken.Kind != SyntaxKind.CloseParenToken) 12427if (forPattern && this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 12449return !forPattern || this.CurrentToken.Kind switch 12474return this.CurrentToken.Kind == SyntaxKind.OpenBracketToken || CanFollowCast(this.CurrentToken.Kind); 12480if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken && 12489return CanFollowCast(this.CurrentToken.Kind); 12520return this.CurrentToken.ContextualKind is SyntaxKind.OrKeyword or SyntaxKind.AndKeyword; 12549if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 12565if (this.CurrentToken.Kind == SyntaxKind.StaticKeyword) 12570else if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 12584if (this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken) 12594if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 12602if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && 12613if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 12622if (st == ScanTypeFlags.NotType || this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 12639if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && 12647if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 12719Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 12738Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBracketToken); 12779return this.CurrentToken.Kind == SyntaxKind.NewKeyword && this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken; 12787Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBraceToken); 12824return this.CurrentToken.Kind == SyntaxKind.OpenBraceToken; 12834return this.CurrentToken.Kind == SyntaxKind.OpenBracketToken; 12850if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken) 12860if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 12865if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken) 12887if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 12898switch (this.CurrentToken.Kind) 13028this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 13039this.CurrentToken.Kind == SyntaxKind.OpenBraceToken 13067Debug.Assert(this.CurrentToken.Kind is SyntaxKind.NewKeyword or SyntaxKind.StackAllocKeyword); 13094if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13161if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13183this.CurrentToken.Kind == SyntaxKind.OpenBraceToken ? this.ParseArrayInitializer() : null); 13211if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 13224if (this.CurrentToken.Kind != SyntaxKind.OpenBraceToken) 13255if (this.CurrentToken.Kind == SyntaxKind.StaticKeyword) 13261if (this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword && 13276Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword); 13301if (this.CurrentToken.Kind == SyntaxKind.ColonToken && 13338if (CurrentToken.Kind != SyntaxKind.OpenParenToken) 13345if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 13358var identifier = (this.CurrentToken.Kind != SyntaxKind.IdentifierToken && this.PeekToken(1).Kind == SyntaxKind.EqualsGreaterThanToken) 13375=> CurrentToken.Kind == SyntaxKind.OpenBraceToken 13414switch (this.CurrentToken.Kind) 13432return IsPredefinedType(this.CurrentToken.Kind); 13443if (IsParameterModifierExcludingScoped(this.CurrentToken) || this.CurrentToken.ContextualKind == SyntaxKind.ScopedKeyword) 13471if (IsPredefinedType(this.CurrentToken.Kind)) 13477if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 13487if (this.IsTrueIdentifier(this.CurrentToken)) 13513=> IsTokenQueryContextualKeyword(this.CurrentToken); 13555return this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword && 13608return this.ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind is SyntaxKind.IdentifierToken or SyntaxKind.InKeyword; 13633switch (this.CurrentToken.ContextualKind) 13657SelectOrGroupClauseSyntax selectOrGroupBy = this.CurrentToken.ContextualKind switch 13669this.CurrentToken.ContextualKind == SyntaxKind.IntoKeyword 13676Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword); 13685(this.CurrentToken.Kind != SyntaxKind.IdentifierToken || SyntaxFacts.IsQueryContextualKeyword(this.CurrentToken.ContextualKind))) 13709Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.JoinKeyword); 13722into: this.CurrentToken.ContextualKind == SyntaxKind.IntoKeyword 13729Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.LetKeyword); 13739Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword); 13747Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.OrderByKeyword); 13755while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13757if (this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken) 13761else if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13796if (this.CurrentToken.ContextualKind is SyntaxKind.AscendingKeyword or SyntaxKind.DescendingKeyword) 13810Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.SelectKeyword); 13818Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.GroupKeyword); 13828Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.IntoKeyword); 13959if (requireOneElement || this.CurrentToken.Kind != closeTokenKind) 13976if (this.CurrentToken.Kind == closeTokenKind) 13982nodes.AddSeparator(this.CurrentToken.Kind == SyntaxKind.SemicolonToken 13989if (this.CurrentToken.Kind == closeTokenKind) 14024if (this.CurrentToken.Kind == separatorTokenKind) 14029if (allowSemicolonAsSeparator && this.CurrentToken.Kind is SyntaxKind.SemicolonToken) 14118if (this.CurrentToken.Kind == SyntaxKind.EndOfFileToken) return node; 14120while (this.CurrentToken.Kind != SyntaxKind.EndOfFileToken)
Parser\LanguageParser_InterpolatedString.cs (3)
40Debug.Assert(this.CurrentToken.Kind == SyntaxKind.InterpolatedStringToken); 410if (this.CurrentToken.Kind != SyntaxKind.CommaToken) 423var leading = this.CurrentToken.GetLeadingTrivia();
Parser\LanguageParser_Patterns.cs (29)
61while (this.CurrentToken.ContextualKind == SyntaxKind.OrKeyword) 78var tk = CurrentToken.Kind; 84if (tk == SyntaxKind.IdentifierToken && this.CurrentToken.ContextualKind != SyntaxKind.UnderscoreToken && 85(this.CurrentToken.ContextualKind != SyntaxKind.NameOfKeyword || this.PeekToken(1).Kind != SyntaxKind.OpenParenToken)) 107while (this.CurrentToken.ContextualKind == SyntaxKind.AndKeyword) 121switch (this.CurrentToken.Kind) 143switch (this.CurrentToken.Kind) 160if (this.CurrentToken.ContextualKind == SyntaxKind.NotKeyword) 175var tk = this.CurrentToken.Kind; 187if (CurrentToken.ContextualKind == SyntaxKind.UnderscoreToken) 192switch (CurrentToken.Kind) 244switch (this.CurrentToken.Kind) 276(this.CurrentToken.Kind == SyntaxKind.OpenParenToken || this.IsValidPatternDesignation(inSwitchArmPattern))) 285if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken && (type != null || !looksLikeCast())) 360if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken) 386if (CurrentToken.Kind == SyntaxKind.IdentifierToken) 388switch (CurrentToken.ContextualKind) 477if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 509if (this.CurrentToken.Kind == SyntaxKind.ColonToken && ConvertPatternToExpressionIfPossible(pattern, permitTypeArguments: true) is ExpressionSyntax expr) 530this.CurrentToken.Kind is 543if (@this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBraceToken or SyntaxKind.CloseBracketToken or SyntaxKind.SemicolonToken) 550if (@this._termState.HasFlag(TerminatorState.IsExpressionOrPatternInCaseLabelOfSwitchStatement) && @this.CurrentToken.Kind is SyntaxKind.ColonToken) 559if (@this._termState.HasFlag(TerminatorState.IsPatternInSwitchExpressionArm) && @this.CurrentToken.Kind is SyntaxKind.EqualsGreaterThanToken or SyntaxKind.ColonToken) 584while (this.CurrentToken.Kind != SyntaxKind.CloseBraceToken) 590var errantCase = this.CurrentToken.Kind == SyntaxKind.CaseKeyword 609this.CurrentToken.Kind == SyntaxKind.ColonToken 615if (errantCase is null && switchExpressionCase.FullWidth == 0 && this.CurrentToken.Kind != SyntaxKind.CommaToken) 622if (this.CurrentToken.Kind != SyntaxKind.CloseBraceToken) 624var commaToken = this.CurrentToken.Kind == SyntaxKind.SemicolonToken
Parser\SyntaxParser.cs (12)
488var ct = this.CurrentToken; 498=> this.CurrentToken.Kind == kind ? this.EatToken() : null; 525var ct = this.CurrentToken; 533return CreateMissingToken(kind, this.CurrentToken.Kind, reportError: true); 541var ct = this.CurrentToken; 548var replacement = CreateMissingToken(expected, this.CurrentToken.Kind, reportError: true); 584if (this.CurrentToken.Kind != kind) 598if (this.CurrentToken.Kind != kind) 610var token = this.CurrentToken; 632if (this.CurrentToken.ContextualKind != kind) 646var contextualKind = this.CurrentToken.ContextualKind; 736SyntaxToken ct = this.CurrentToken;