847 references to Kind
Microsoft.CodeAnalysis.CSharp (847)
Declarations\DeclarationTreeBuilder.cs (4)
1054if (member.Kind == SyntaxKind.MethodDeclaration) 1081switch (member.Kind) 1131switch (member.Kind) 1229switch (member.Kind)
Parser\DirectiveParser.cs (31)
89result = (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) ? 247if (keyword.Kind == SyntaxKind.DefineKeyword) 282bool isError = keyword.Kind == SyntaxKind.ErrorKeyword; 296if (t.Kind == SyntaxKind.WhitespaceTrivia) 366switch (this.CurrentToken.Kind) 375if (isActive && !line.IsMissing && line.Kind == SyntaxKind.NumericLiteralToken) 387if (this.CurrentToken.Kind == SyntaxKind.StringLiteralToken && 403Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 422var characterOffset = (CurrentToken.Kind == SyntaxKind.NumericLiteralToken) ? 476else if (token.Kind == SyntaxKind.NumericLiteralToken) 535SyntaxToken setting = this.CurrentToken.Kind switch 543SyntaxToken target = this.CurrentToken.Kind switch 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) 771left = SyntaxFactory.BinaryExpression(SyntaxFacts.GetBinaryExpression(op.Kind), left, op, right); 779if (this.CurrentToken.Kind == SyntaxKind.ExclamationToken) 790var k = this.CurrentToken.Kind;
Parser\DocumentationCommentParser.cs (79)
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 533if ((current.Kind == SyntaxKind.XmlTextLiteralToken || current.Kind == SyntaxKind.XmlEntityLiteralToken) && 534current.ValueText != SyntaxFacts.GetText(openQuote.Kind) && 540if ((current.Kind == SyntaxKind.XmlTextLiteralToken || current.Kind == SyntaxKind.XmlEntityLiteralToken) && 556SyntaxKind quoteKind = startQuote.Kind; 574SyntaxKind quoteKind = startQuote.Kind; 592SyntaxKind quoteKind = startQuote.Kind; 606while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 607|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken 608|| this.CurrentToken.Kind == SyntaxKind.XmlEntityLiteralToken 609|| this.CurrentToken.Kind == SyntaxKind.LessThanToken) 612if (token.Kind == SyntaxKind.LessThanToken) 636var quoteKind = this.CurrentToken.Kind == SyntaxKind.SingleQuoteToken 685if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 725while (this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralToken 726|| this.CurrentToken.Kind == SyntaxKind.XmlTextLiteralNewLineToken 727|| this.CurrentToken.Kind == SyntaxKind.MinusMinusToken) 730if (token.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) 1022CurrentToken.Kind is (SyntaxKind.GreaterThanToken or SyntaxKind.GreaterThanEqualsToken)) 1026if (operatorToken3.Kind == SyntaxKind.GreaterThanToken) 1069else if (CurrentToken.Kind == SyntaxKind.EqualsToken) 1079else if (CurrentToken.Kind == SyntaxKind.GreaterThanEqualsToken) 1103Debug.Assert(SyntaxFacts.IsAnyOverloadableOperator(operatorToken.Kind)); 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) 1263if (refKindOpt.Kind != SyntaxKind.RefKeyword) 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) 1586switch (CurrentToken.Kind)
Parser\LanguageParser.cs (652)
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) 662if (isGlobal && (this.PeekToken(1).Kind == SyntaxKind.OpenParenToken || (!IsScript && IsPossibleTopLevelUsingLocalDeclarationStatement()))) 676if (this.CurrentToken.ContextualKind != SyntaxKind.GlobalKeyword || this.PeekToken(1).Kind != SyntaxKind.UsingKeyword) 863switch (this.CurrentToken.Kind) 872return IsPossibleStartOfTypeDeclaration(this.CurrentToken.Kind); 884else if (this.PeekToken(1).Kind == SyntaxKind.NamespaceKeyword) 895return this.CurrentToken.Kind == SyntaxKind.CloseBraceToken; 920return this.CurrentToken.Kind == SyntaxKind.ExternKeyword 921&& this.PeekToken(1) is { Kind: SyntaxKind.IdentifierToken, ContextualKind: SyntaxKind.AliasKeyword } 922&& this.PeekToken(2).Kind == SyntaxKind.IdentifierToken 923&& this.PeekToken(3).Kind == SyntaxKind.SemicolonToken; 933Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ExternKeyword); 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)); 1011if (type.IsMissing && this.PeekToken(1).Kind == SyntaxKind.SemicolonToken) 1022return this.CurrentToken.Kind == SyntaxKind.OpenBracketToken 1024&& this.PeekToken(2).Kind == SyntaxKind.ColonToken; 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 && 1166this.PeekToken(1).Kind == SyntaxKind.DotToken) 1208if (this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 1268if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 1270switch (this.PeekToken(1).Kind) 1292=> GetModifierExcludingScoped(token.Kind, token.ContextualKind); 1388else if (nextToken.Kind == SyntaxKind.NamespaceKeyword) 1394nextToken.Kind is SyntaxKind.EnumKeyword or SyntaxKind.DelegateKeyword || 1395(IsPossibleStartOfTypeDeclaration(nextToken.Kind) && GetModifierExcludingScoped(nextToken) != DeclarationModifiers.None)) 1470Debug.Assert(modTok.Kind is not (SyntaxKind.OutKeyword or SyntaxKind.InKeyword)); 1476if (token.Kind == SyntaxKind.StructKeyword) 1496Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None); 1532var currentTokenKind = this.CurrentToken.Kind; 1535(currentTokenKind is SyntaxKind.ExplicitKeyword or SyntaxKind.ImplicitKeyword && PeekToken(1).Kind == SyntaxKind.OperatorKeyword)) 1554var currentTokenKind = this.CurrentToken.Kind; 1572if (SyntaxFacts.IsPredefinedType(this.CurrentToken.Kind)) 1616switch (nextToken.Kind) 1670switch (this.CurrentToken.Kind) 1673if (this.CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword) 1693switch (this.CurrentToken.Kind) 1715throw ExceptionUtilities.UnexpectedValue(this.CurrentToken.Kind); 1721Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword or SyntaxKind.InterfaceKeyword || 1741var paramList = CurrentToken.Kind == SyntaxKind.OpenParenToken 1764if (CurrentToken.Kind == SyntaxKind.SemicolonToken) 1788SyntaxKind kind = this.CurrentToken.Kind; 1796var member = this.ParseMemberDeclaration(keyword.Kind); 1826closeBrace = WithAdditionalDiagnostics(closeBrace, this.GetExpectedTokenError(SyntaxKind.CloseBraceToken, this.CurrentToken.Kind)); 1856recordModifier = this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword 1863if (this.CurrentToken.Kind is SyntaxKind.StructKeyword or SyntaxKind.ClassKeyword && 1865this.PeekToken(2).Kind is SyntaxKind.IdentifierToken) 1876recordModifier = SyntaxFactory.MissingToken(misplacedToken.Kind); 1892switch (keyword.Kind) 1943SyntaxKind declarationKind = recordModifier?.Kind == SyntaxKind.StructKeyword ? SyntaxKind.RecordStructDeclaration : SyntaxKind.RecordDeclaration; 1961throw ExceptionUtilities.UnexpectedValue(keyword.Kind); 1998SyntaxKind kind = this.CurrentToken.Kind; 2002!(kind == SyntaxKind.DelegateKeyword && this.PeekToken(1).Kind is SyntaxKind.OpenBraceToken or SyntaxKind.OpenParenToken)) 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) 2128this.PeekToken(1).Kind == SyntaxKind.IdentifierToken && 2129this.PeekToken(2).Kind == SyntaxKind.ColonToken; 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 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 2271PeekToken(1).Kind == SyntaxKind.AsteriskToken 2283PeekToken(1).Kind == SyntaxKind.RefKeyword) 2296if (this.CurrentToken.Kind == SyntaxKind.CommaToken && PeekToken(1).Kind == SyntaxKind.RefKeyword) 2314return CanStartMember(this.CurrentToken.Kind); 2375switch (this.CurrentToken.Kind) 2521switch (this.CurrentToken.Kind) 2524if (this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken) 2531if (this.PeekToken(1).Kind == SyntaxKind.OpenParenToken) 2538switch (this.PeekToken(1).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) 2987|| this.CurrentToken.Kind is not SyntaxKind.OpenParenToken and not SyntaxKind.OpenBraceToken and not SyntaxKind.EqualsGreaterThanToken) && 3007if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 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) 3208if (identifierOrThisOpt.Kind != SyntaxKind.IdentifierToken) 3225if (this.CurrentToken.Kind != SyntaxKind.IdentifierToken) 3230if (this.CurrentToken.ContextualKind == SyntaxKind.GlobalKeyword && this.PeekToken(1).Kind == SyntaxKind.UsingKeyword) 3241var kind = this.PeekToken(1).Kind; 3248IsStartOfPropertyBody(this.PeekToken(2).Kind)) 3270return this.CurrentToken.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword or SyntaxKind.OperatorKeyword; 3292if (token.Kind != SyntaxKind.None) 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; 3485else if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 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 || 3618else if (this.PeekToken(1).Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword) 3620possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(2).Kind); 3624possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(1).Kind); 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); 3747if (separator?.Kind == SyntaxKind.ColonColonToken) 3767if (separator.Kind != SyntaxKind.DotToken) 3769separator = WithAdditionalDiagnostics(separator, GetExpectedTokenError(SyntaxKind.DotToken, separator.Kind, separator.GetLeadingTriviaWidth(), separator.Width)); 3779if (CurrentToken.Kind == SyntaxKind.UncheckedKeyword) 3799if (firstToken.Kind is SyntaxKind.ExplicitKeyword or SyntaxKind.ImplicitKeyword && 3800this.PeekToken(1).Kind is SyntaxKind.OperatorKeyword) 3831if (SyntaxFacts.IsAnyOverloadableOperator(this.CurrentToken.Kind)) 3840if (this.CurrentToken.Kind is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword) 3873var opKind = opToken.Kind; 3875if (opToken.Kind == SyntaxKind.GreaterThanToken && tk.Kind == SyntaxKind.GreaterThanToken && 3881if (tk.Kind == SyntaxKind.GreaterThanToken && 3968Debug.Assert(thisKeyword.Kind == SyntaxKind.ThisKeyword); 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 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 4217if (token.Kind is SyntaxKind.CloseBraceToken or SyntaxKind.EndOfFileToken) 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) 4736switch (token.Kind) 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) 4853else if (identifierOrThisOpt.Kind != SyntaxKind.IdentifierToken) 4855Debug.Assert(identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword); 4864Debug.Assert(identifier.Kind == SyntaxKind.IdentifierToken); 4880if (explicitInterfaceOpt != null && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4907if (this.CurrentToken.Kind == SyntaxKind.SemicolonToken) 4926if (modifiers is [.., SyntaxToken { Kind: SyntaxKind.ScopedKeyword } scopedKeyword]) 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) 5060if (flags.HasFlag(VariableFlags.ForStatement) && this.PeekToken(1).Kind != SyntaxKind.SemicolonToken) 5069if (this.PeekToken(2).Kind is not (SyntaxKind.SemicolonToken or SyntaxKind.EqualsToken or SyntaxKind.CloseParenToken)) 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 || 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); 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) 5699token.Kind == SyntaxKind.IdentifierToken && 5719var ctk = this.CurrentToken.Kind; 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) 5950Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 5952switch (this.CurrentToken.Kind) 5986case SyntaxKind.GreaterThanToken when ((options & NameOptions.AfterIs) != 0) && this.PeekToken(1).Kind != SyntaxKind.GreaterThanToken: 6007(options & NameOptions.AfterTupleComma) != 0 && this.PeekToken(1).Kind is SyntaxKind.CommaToken or SyntaxKind.CloseParenToken || 6008(options & NameOptions.FirstElementOfPossibleTupleLiteral) != 0 && this.PeekToken(1).Kind == SyntaxKind.CommaToken) 6034Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6044while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 6047Debug.Assert(start.Kind == SyntaxKind.LessThanToken); 6048Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 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) 6263if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken && tokenBreaksTypeArgumentList(this.PeekToken(1))) 6272if (this.CurrentToken.Kind is SyntaxKind.IdentifierToken 6273&& this.PeekToken(1).Kind is SyntaxKind.CloseBracketToken) 6278if (this.CurrentToken.Kind == SyntaxKind.CommaToken || this.IsPossibleType()) 6303switch (token.Kind) 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 && 6401this.PeekToken(1).Kind is SyntaxKind.CommaToken or SyntaxKind.GreaterThanToken) 6422=> this.CurrentToken.Kind == SyntaxKind.GreaterThanToken; 6426Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6428while (this.PeekToken(n).Kind == SyntaxKind.CommaToken) 6431return this.PeekToken(n).Kind == SyntaxKind.GreaterThanToken; 6464if (this.CurrentToken.Kind == SyntaxKind.ThisKeyword) 6490if (separator != null && separator.Kind == SyntaxKind.ColonColonToken) 6509if (separator.Kind != SyntaxKind.DotToken) 6511separator = WithAdditionalDiagnostics(separator, GetExpectedTokenError(SyntaxKind.DotToken, separator.Kind, separator.GetLeadingTriviaWidth(), separator.Width)); 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) 6664if (separator != null && separator.Kind == SyntaxKind.ColonColonToken) 6691if (separator.Kind != SyntaxKind.DotToken) 6693separator = WithAdditionalDiagnostics(separator, GetExpectedTokenError(SyntaxKind.DotToken, separator.Kind, separator.GetLeadingTriviaWidth(), separator.Width)); 6704return this.CurrentToken.Kind == SyntaxKind.ColonColonToken 6716if (this.PeekToken(1).Kind == SyntaxKind.ThisKeyword) 6733Debug.Assert(separator.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken); 6736switch (separator.Kind) 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); 6909isAlias = this.PeekToken(1).Kind == SyntaxKind.ColonColonToken; 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) 6980when lastTokenOfType.Kind is not SyntaxKind.QuestionToken // don't allow `Type??` 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) 7106case var _ when peek1.Kind == SyntaxKind.OpenBracketToken: 7116if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 7133Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7156var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 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) 7396switch (this.PeekToken(1).Kind) 7413return this.CurrentToken.Kind != SyntaxKind.ColonToken; 7458var nextTokenKind = nextToken.Kind; 7503if (this.CurrentToken.Kind is SyntaxKind.OpenBracketToken) 7512this.CurrentToken.Kind is SyntaxKind.OpenParenToken or // ctor parameters 7526switch (this.PeekToken(i).Kind) 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) 7737Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7748lessThanToken.IsMissing && CurrentToken.Kind == SyntaxKind.CloseParenToken 7771if (CurrentToken.Kind == SyntaxKind.IdentifierToken) 7787case var _ when peek1.Kind == SyntaxKind.OpenBracketToken: 7799if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 7817Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7833if (managedSpecifier.Kind == SyntaxKind.ManagedKeyword && unmanagedCallingConventions != null) 7847=> CurrentToken.Kind == SyntaxKind.DelegateKeyword && PeekToken(1).Kind == SyntaxKind.AsteriskToken; 7852=> token.Kind == SyntaxKind.LessThanToken || token.Kind == SyntaxKind.OpenParenToken; 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) 8113this.PeekToken(1).Kind == SyntaxKind.ForEachKeyword) 8119if (PeekToken(2).Kind == SyntaxKind.OpenParenToken) 8146=> PeekToken(1).Kind == SyntaxKind.OpenParenToken ? ParseUsingStatement(attributes) : ParseLocalDeclarationStatement(attributes); 8153=> CurrentToken.ContextualKind == SyntaxKind.AwaitKeyword && PeekToken(1).Kind == SyntaxKind.UsingKeyword; 8157return this.PeekToken(1).Kind == SyntaxKind.ColonToken && this.IsTrueIdentifier(); 8162return this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken; 8168this.PeekToken(1).Kind is SyntaxKind.ReturnKeyword or SyntaxKind.BreakKeyword; 8177var tk = this.CurrentToken.Kind; 8181this.PeekToken(1).Kind is not SyntaxKind.DotToken // e.g. `int.Parse()` is an expression 8190Debug.Assert(PeekToken(1).Kind != SyntaxKind.OpenParenToken); 8196Debug.Assert(PeekToken(2).Kind != SyntaxKind.OpenParenToken); 8252if (token1.Kind == SyntaxKind.DotToken && 8255if (PeekToken(2).Kind == SyntaxKind.IdentifierToken && 8256PeekToken(3).Kind == SyntaxKind.IdentifierToken) 8271var token4Kind = PeekToken(4).Kind; 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) 8324var tk = PeekToken(1).Kind; 8385if (this.CurrentToken.Kind is SyntaxKind.OpenBraceToken) 8391if (identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword) 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); 8538switch (nextToken.Kind) 8566if (SyntaxFacts.GetBaseTypeDeclarationKind(nextToken.Kind) != SyntaxKind.None) 8574if (SyntaxFacts.IsPredefinedType(PeekToken(2).Kind)) 8581if (IsTypeModifierOrTypeKeyword(PeekToken(2).Kind)) 8619switch (next.Kind) 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) 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); 9097if (this.PeekToken(1).Kind == SyntaxKind.OpenParenToken) 9104SyntaxFacts.GetCheckStatement(keyword.Kind), 9112Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DoKeyword); 9136return this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken; 9153Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9155if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9157this.EatToken().Kind == SyntaxKind.IdentifierToken && 9158this.EatToken().Kind == SyntaxKind.InKeyword) 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 9224if (this.PeekToken(1).Kind == SyntaxKind.RefKeyword) 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) 9434if (ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind == SyntaxKind.IdentifierToken) 9439if (this.PeekToken(1).Kind == SyntaxKind.CommaToken) 9447if (this.PeekToken(1).Kind is SyntaxKind.CommaToken or SyntaxKind.CloseParenToken) 9473if (!ScanDesignation(permitTupleDesignation && (typeIsVar || IsPredefinedType(lastTokenOfType.Kind)))) 9481return this.CurrentToken.Kind == SyntaxKind.CommaToken; 9483return this.CurrentToken.Kind is SyntaxKind.CommaToken or SyntaxKind.CloseParenToken; 9501switch (this.PeekToken(1).Kind) 9535Debug.Assert(this.CurrentToken.Kind == SyntaxKind.GotoKeyword); 9543if (this.CurrentToken.Kind is SyntaxKind.CaseKeyword or SyntaxKind.DefaultKeyword) 9546if (caseOrDefault.Kind == SyntaxKind.CaseKeyword) 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, 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) 9819if (node.Kind == SyntaxKind.DiscardPattern) 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) 9948switch (this.PeekToken(1).Kind) 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; 10002bool condition3 = st == ScanTypeFlags.NonGenericTypeOrExpression || this.PeekToken(1).Kind == SyntaxKind.EqualsToken; 10009Debug.Assert(this.CurrentToken.Kind == SyntaxKind.WhileKeyword); 10023Debug.Assert(this.IsTrueIdentifier() && this.PeekToken(1).Kind == SyntaxKind.ColonToken); 10044else if (this.CurrentToken.Kind == SyntaxKind.UsingKeyword) 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) 10314switch (this.CurrentToken.Kind) 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) 10572if (IsScript && this.CurrentToken.Kind == SyntaxKind.EndOfFileToken) 10616SyntaxKind tk = this.CurrentToken.Kind; 10915switch (next.Kind) 10981var tk = this.CurrentToken.Kind; 11077if (this.CurrentToken.Kind == SyntaxKind.QuestionToken && precedence <= Precedence.Conditional) 11152if (IsExpectedAssignmentOperator(operatorToken.Kind)) 11156if (operatorExpressionKind == SyntaxKind.SimpleAssignmentExpression && CurrentToken.Kind == SyntaxKind.RefKeyword && 11173if (IsExpectedBinaryOperator(operatorToken.Kind)) 11196&& this.PeekToken(1) is { Kind: SyntaxKind.GreaterThanToken or SyntaxKind.GreaterThanEqualsToken } token2 11199if (token2.Kind == SyntaxKind.GreaterThanToken) 11201if (this.PeekToken(2) is { Kind: SyntaxKind.GreaterThanToken or SyntaxKind.GreaterThanEqualsToken } token3 11205token1Kind = token3.Kind == SyntaxKind.GreaterThanToken 11228if (token1Kind == SyntaxKind.SwitchKeyword && this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken) 11231if (token1Kind == SyntaxKind.WithKeyword && this.PeekToken(1).Kind == SyntaxKind.OpenBraceToken) 11294if (this.CurrentToken.Kind != SyntaxKind.ColonToken && 11309if (this.CurrentToken.Kind == SyntaxKind.ColonToken) 11321if (this.CurrentToken.Kind == SyntaxKind.EndOfFileToken && this.lexer.InterpolationFollowedByColon) 11379=> token1.Kind == SyntaxKind.DotToken && 11380token2.Kind == SyntaxKind.DotToken && 11393if (this.CurrentToken is { Kind: SyntaxKind.DotToken } token3 && 11410if (this.PeekToken(1) is not { Kind: SyntaxKind.DotToken } token4 || 11463var tk = this.CurrentToken.Kind; 11517else if (IsCurrentTokenFieldInKeywordContext() && PeekToken(1).Kind != SyntaxKind.ColonColonToken) 11595if (this.CurrentToken.Kind != SyntaxKind.DotToken || tk == SyntaxKind.VoidKeyword) 11630switch (this.CurrentToken.Kind) 11642expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11646if (this.PeekToken(1).Kind == SyntaxKind.IdentifierToken) 11678this.PeekToken(1).Kind == SyntaxKind.IdentifierToken && 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) 11782while (this.PeekToken(tokenIndex).Kind == SyntaxKind.StaticKeyword || 11788return this.PeekToken(tokenIndex).Kind == SyntaxKind.DelegateKeyword && 11789this.PeekToken(tokenIndex + 1).Kind != SyntaxKind.AsteriskToken; 11794Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 11796var nextTokenKind = nextToken.Kind; 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) 11877while (this.PeekToken(index).Kind == SyntaxKind.ExclamationToken) 11880return this.PeekToken(index).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) 12061expression = refKindKeyword?.Kind == SyntaxKind.OutKeyword 12081if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 12125Debug.Assert(checkedOrUnchecked.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 12126var kind = checkedOrUnchecked.Kind == SyntaxKind.CheckedKeyword ? SyntaxKind.CheckedExpression : SyntaxKind.UncheckedExpression; 12154Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12170if (tk.Kind is not SyntaxKind.IdentifierToken and not SyntaxKind.CommaToken 12171&& !SyntaxFacts.IsPredefinedType(tk.Kind) 12179return this.PeekToken(curTk - 1).Kind == SyntaxKind.CloseParenToken && 12180this.PeekToken(curTk).Kind == SyntaxKind.EqualsGreaterThanToken; 12190if (this.PeekToken(skipIndex).Kind == SyntaxKind.CloseParenToken 12191&& this.PeekToken(skipIndex + 1).Kind == SyntaxKind.EqualsGreaterThanToken) 12198if (this.PeekToken(1).Kind == SyntaxKind.CloseParenToken 12199&& this.PeekToken(2).Kind == SyntaxKind.EqualsGreaterThanToken) 12207if (this.PeekToken(1).Kind == SyntaxKind.ParamsKeyword) 12219if (token1.Kind == SyntaxKind.IdentifierToken) 12226if (token2.Kind == SyntaxKind.CommaToken) 12239Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12295if (this.CurrentToken.Kind == SyntaxKind.OpenBracketToken) 12303switch (this.CurrentToken.Kind) 12309return this.PeekToken(1).Kind == SyntaxKind.EqualsGreaterThanToken; 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 && 12481this.PeekToken(1).Kind == SyntaxKind.CloseBracketToken) 12489return CanFollowCast(this.CurrentToken.Kind); 12541if (token1.Kind == SyntaxKind.EqualsGreaterThanToken) 12549if (CurrentToken.Kind == SyntaxKind.OpenBracketToken) 12565if (this.CurrentToken.Kind == SyntaxKind.StaticKeyword) 12571this.PeekToken(1).Kind == SyntaxKind.StaticKeyword) 12584if (this.CurrentToken.Kind == SyntaxKind.EqualsGreaterThanToken) 12594if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 12602if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && 12603this.PeekToken(1).Kind == SyntaxKind.EqualsGreaterThanToken) 12622if (st == ScanTypeFlags.NotType || this.CurrentToken.Kind != SyntaxKind.OpenParenToken) 12639if (this.CurrentToken.Kind == SyntaxKind.IdentifierToken && 12640this.PeekToken(1).Kind == SyntaxKind.EqualsGreaterThanToken) 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; 12829return IsTrueIdentifier() && this.PeekToken(1).Kind == SyntaxKind.EqualsToken; 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); 13068return this.PeekToken(1).Kind == SyntaxKind.OpenBracketToken; 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) 13278switch (this.PeekToken(1).Kind) 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); 13471if (IsPredefinedType(this.CurrentToken.Kind)) 13477if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) 13499if (peek1.Kind != SyntaxKind.CommaToken && 13500peek1.Kind != SyntaxKind.CloseParenToken && 13501peek1.Kind != SyntaxKind.EqualsGreaterThanToken && 13502peek1.Kind != SyntaxKind.OpenBraceToken && 13503peek1.Kind != SyntaxKind.EqualsToken) 13563var pk1 = this.PeekToken(1).Kind; 13571var pk2 = this.PeekToken(2).Kind; 13608return this.ScanType() != ScanTypeFlags.NotType && this.CurrentToken.Kind is SyntaxKind.IdentifierToken or SyntaxKind.InKeyword; 13679var type = this.PeekToken(1).Kind != SyntaxKind.InKeyword 13685(this.CurrentToken.Kind != SyntaxKind.IdentifierToken || SyntaxFacts.IsQueryContextualKeyword(this.CurrentToken.ContextualKind))) 13712type: this.PeekToken(1).Kind != SyntaxKind.InKeyword 13755while (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13757if (this.CurrentToken.Kind is SyntaxKind.CloseParenToken or SyntaxKind.SemicolonToken) 13761else if (this.CurrentToken.Kind == SyntaxKind.CommaToken) 13799if (direction.Kind == SyntaxKind.DescendingKeyword) 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) 468Debug.Assert(token.Kind == SyntaxKind.StringLiteralToken);
Parser\LanguageParser_Patterns.cs (24)
78var tk = CurrentToken.Kind; 85(this.CurrentToken.ContextualKind != SyntaxKind.NameOfKeyword || this.PeekToken(1).Kind != SyntaxKind.OpenParenToken)) 121switch (this.CurrentToken.Kind) 143switch (this.CurrentToken.Kind) 175var tk = this.CurrentToken.Kind; 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) 394var tk = PeekToken(1).Kind; 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\Lexer.cs (3)
2392if (directive.Kind == SyntaxKind.EndIfDirectiveTrivia || (branching != null && branching.BranchTaken)) 2396else if (directive.Kind == SyntaxKind.IfDirectiveTrivia) 2728else if (tr.Kind == SyntaxKind.EndOfLineTrivia)
Parser\SyntaxParser.cs (13)
151if (token.Kind == SyntaxKind.EndOfFileToken) 498=> this.CurrentToken.Kind == kind ? this.EatToken() : null; 526if (ct.Kind == kind) 533return CreateMissingToken(kind, this.CurrentToken.Kind, reportError: true); 542if (ct.Kind == expected) 548var replacement = CreateMissingToken(expected, this.CurrentToken.Kind, reportError: true); 584if (this.CurrentToken.Kind != kind) 598if (this.CurrentToken.Kind != kind) 612if (token.Kind != kind) 614token = WithAdditionalDiagnostics(token, this.GetExpectedTokenError(kind, token.Kind)); 796if (trivia.Kind == SyntaxKind.SkippedTokensTrivia) 1098if (token.Kind != token.ContextualKind) 1119var identifier = SyntaxToken.Identifier(token.Kind, token.LeadingTrivia.Node, token.Text, token.ValueText, token.TrailingTrivia.Node);
Syntax\InternalSyntax\CSharpSyntaxNode.cs (5)
66public override string KindText => this.Kind.ToString(); 76public override bool IsSkippedTokensTrivia => this.Kind == SyntaxKind.SkippedTokensTrivia; 77public override bool IsDocumentationCommentTrivia => SyntaxFacts.IsDocumentationCommentTrivia(this.Kind); 247return this.Kind == SyntaxKind.EndOfLineTrivia 248|| this.Kind == SyntaxKind.SingleLineCommentTrivia;
Syntax\InternalSyntax\CSharpSyntaxRewriter.cs (1)
57Debug.Assert(visited != null && visited.Kind != SyntaxKind.None, "Cannot remove node using Syntax.InternalSyntax.SyntaxRewriter.");
Syntax\InternalSyntax\StructuredTriviaSyntax.cs (1)
18if (this.Kind == SyntaxKind.SkippedTokensTrivia)
Syntax\InternalSyntax\SyntaxToken.cs (7)
255return this.Kind; 269get { return SyntaxFacts.GetText(this.Kind); } 286switch (this.Kind) 349return new SyntaxTokenWithTrivia(this.Kind, trivia, null, this.GetDiagnostics(), this.GetAnnotations()); 359return new SyntaxTokenWithTrivia(this.Kind, null, trivia, this.GetDiagnostics(), this.GetAnnotations()); 365return new SyntaxToken(this.Kind, this.FullWidth, diagnostics, this.GetAnnotations()); 371return new SyntaxToken(this.Kind, this.FullWidth, this.GetDiagnostics(), annotations);
Syntax\InternalSyntax\SyntaxToken.MissingTokenWithTrivia.cs (5)
37switch (this.Kind) 49return new MissingTokenWithTrivia(this.Kind, trivia, this.TrailingField, this.GetDiagnostics(), this.GetAnnotations()); 54return new MissingTokenWithTrivia(this.Kind, this.LeadingField, trivia, this.GetDiagnostics(), this.GetAnnotations()); 59return new MissingTokenWithTrivia(this.Kind, this.LeadingField, this.TrailingField, diagnostics, this.GetAnnotations()); 64return new MissingTokenWithTrivia(this.Kind, this.LeadingField, this.TrailingField, this.GetDiagnostics(), annotations);
Syntax\InternalSyntax\SyntaxToken.SyntaxIdentifier.cs (2)
46return new SyntaxIdentifierWithTrivia(this.Kind, this.TextField, this.TextField, trivia, null, this.GetDiagnostics(), this.GetAnnotations()); 51return new SyntaxIdentifierWithTrivia(this.Kind, this.TextField, this.TextField, null, trivia, this.GetDiagnostics(), this.GetAnnotations());
Syntax\InternalSyntax\SyntaxToken.SyntaxIdentifierWithTrailingTrivia.cs (1)
42return new SyntaxIdentifierWithTrivia(this.Kind, this.TextField, this.TextField, trivia, _trailing, this.GetDiagnostics(), this.GetAnnotations());
Syntax\InternalSyntax\SyntaxToken.SyntaxLiteral.cs (4)
59return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, trivia, null, this.GetDiagnostics(), this.GetAnnotations()); 64return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, null, trivia, this.GetDiagnostics(), this.GetAnnotations()); 69return new SyntaxTokenWithValue<T>(this.Kind, this.TextField, this.ValueField, diagnostics, this.GetAnnotations()); 74return new SyntaxTokenWithValue<T>(this.Kind, this.TextField, this.ValueField, this.GetDiagnostics(), annotations);
Syntax\InternalSyntax\SyntaxToken.SyntaxLiteralWithTrivia.cs (4)
65return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, trivia, _trailing, this.GetDiagnostics(), this.GetAnnotations()); 70return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, _leading, trivia, this.GetDiagnostics(), this.GetAnnotations()); 75return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, _leading, _trailing, diagnostics, this.GetAnnotations()); 80return new SyntaxTokenWithValueAndTrivia<T>(this.Kind, this.TextField, this.ValueField, _leading, _trailing, this.GetDiagnostics(), annotations);
Syntax\InternalSyntax\SyntaxToken.SyntaxTokenWithTrivia.cs (4)
58return new SyntaxTokenWithTrivia(this.Kind, trivia, this.TrailingField, this.GetDiagnostics(), this.GetAnnotations()); 63return new SyntaxTokenWithTrivia(this.Kind, this.LeadingField, trivia, this.GetDiagnostics(), this.GetAnnotations()); 68return new SyntaxTokenWithTrivia(this.Kind, this.LeadingField, this.TrailingField, diagnostics, this.GetAnnotations()); 73return new SyntaxTokenWithTrivia(this.Kind, this.LeadingField, this.TrailingField, this.GetDiagnostics(), annotations);
Syntax\InternalSyntax\SyntaxTrivia.cs (2)
67return new SyntaxTrivia(this.Kind, this.Text, diagnostics, GetAnnotations()); 72return new SyntaxTrivia(this.Kind, this.Text, GetDiagnostics(), annotations);
Syntax\SyntaxFactory.cs (1)
1668if (token.Kind == SyntaxKind.EndOfFileToken)
Syntax\SyntaxFacts.cs (1)
450return node.IsIdentifierVar() || IsPredefinedType(node.Kind);