270 references to EatToken
Microsoft.CodeAnalysis.CSharp (270)
Parser\DirectiveParser.cs (22)
381line = this.EatToken(); 401file = this.EatToken(); 548SyntaxKind.EnableKeyword => EatToken(), 549SyntaxKind.DisableKeyword => EatToken(), 550SyntaxKind.RestoreKeyword => EatToken(), 556SyntaxKind.WarningsKeyword => EatToken(), 557SyntaxKind.AnnotationsKeyword => EatToken(), 581style = this.EatToken(); 598id = this.EatToken(); 610id = this.EatToken(); 627ids.AddSeparator(this.EatToken()); 642var checksum = this.EatToken(); 746skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 752skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 758? this.EatToken() 780var op = this.EatToken(); 793var op = this.EatToken(); 806var op = this.EatToken(); 818var op = this.EatToken(); 831var open = this.EatToken(); 836var identifier = TruncateIdentifier(this.EatToken()); 840return SyntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(k), this.EatToken());
Parser\DocumentationCommentParser.cs (37)
110var token = this.EatToken(); 194textTokens.Add(this.EatToken()); 220var startTag = SyntaxFactory.XmlElementStartTag(lessThan, name, attrs, this.EatToken()); 399var token = this.EatToken(); 537EatToken(); 611var token = this.EatToken(); 666quote = AddTrailingSkippedSyntax(quote, EatToken()); 687var colon = this.EatToken(); 729var token = this.EatToken(); 755textTokens.Add(this.EatToken()); 777var textToken = this.EatToken(); 920badTokens.Add(this.EatToken()); 974SyntaxToken thisKeyword = EatToken(); 989SyntaxToken identifierToken = EatToken(); 1019SyntaxToken operatorKeyword = EatToken(); 1026operatorToken = EatToken(); 1037operatorToken = AddTrailingSkippedSyntax(operatorToken, EatToken()); 1052var operatorToken2 = this.EatToken(); 1057var operatorToken3 = this.EatToken(); 1093var operatorToken2 = this.EatToken(); 1103var operatorToken2 = this.EatToken(); 1162var operatorToken2 = this.EatToken(); 1193var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_MisplacedUnchecked); 1209SyntaxToken implicitOrExplicit = EatToken(); 1322refKindOpt = EatToken(); 1332var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_RefReadOnlyWrongOrdering); 1337readOnlyOpt = EatToken(); 1365var open = EatToken(); 1451return SyntaxFactory.PredefinedType(EatToken()); 1456SyntaxToken alias = EatToken(); 1464SyntaxToken colonColon = EatToken(); 1490SyntaxToken dot = EatToken(); 1518type = SyntaxFactory.NullableType(type, EatToken()); 1523type = SyntaxFactory.PointerType(type, EatToken()); 1534SyntaxToken open = EatToken(); 1544dimensionList.AddSeparator(this.EatToken()); 1642badTokens.Add(this.EatToken());
Parser\LanguageParser.cs (189)
615var token = this.EatToken(); 738var skippedToken = EatToken(); 965? ConvertToKeyword(this.EatToken()) 979unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1019type = AddTrailingSkippedSyntax(type, this.EatToken()); 1055EatToken(); 1134? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1393modTok = ConvertToKeyword(this.EatToken()); 1398modTok = ConvertToKeyword(this.EatToken()); 1405modTok = ConvertToKeyword(this.EatToken()); 1425modTok = this.EatToken(); 1430modTok = this.EatToken(); 1446modTok = ConvertToKeyword(EatToken()); 1455modTok = ConvertToKeyword(this.EatToken()); 1468modTok = ConvertToKeyword(this.EatToken()); 1473modTok = this.EatToken(); 1519this.EatToken(); //move past contextual token 1524this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1666this.EatToken(); // partial 1737keyword = ConvertToKeyword(this.EatToken()); 1753keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1872keyword = ConvertToKeyword(this.EatToken()); 1874? EatToken() 1885var misplacedToken = this.EatToken(); 1889this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2028var token = this.EatToken(); 2072tokens.Add(this.EatToken()); 2278newKeyword: this.EatToken(), 2285classOrStructKeyword: this.EatToken(), 2287? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2293classOrStructKeyword: this.EatToken(), 2297_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2302this.EatToken())), 2311this.EatToken())), 2624var identifier = this.EatToken(); 2938EatToken(); 3476? this.EatToken() 3726EatToken(); 3770? this.EatToken() 3783style = this.EatToken(); 3916var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3967opToken = this.EatToken(); 3978opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3999opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4015var opToken2 = this.EatToken(); 4021opToken2 = this.EatToken(); 4028opToken2 = this.EatToken(); 4042var opToken2 = this.EatToken(); 4355? this.EatToken() 4546var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4572var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4926this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4927this.EatToken())); 4974modifiers.Add(this.EatToken()); 5020modifiers.Add(this.EatToken()); 5038var eventToken = this.EatToken(); 5141var semi = this.EatToken(); 5496this.EatToken(); 5555var equals = this.EatToken(); 5559? this.EatToken() 6029SyntaxToken identifierToken = this.EatToken(); 6142this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6335var start = this.EatToken(); 6337this.EatToken(); 6338greaterThanToken = this.EatToken(); 6350this.EatToken(); 6361greaterThanToken = EatToken(); 6497greaterThanToken = this.EatToken(); 6666? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6696result = AddTrailingSkippedSyntax(result, this.EatToken()); 6760identifierOrThisOpt = this.EatToken(); 6879? this.EatToken() // fine after the first identifier 6893separator = this.EatToken(); 6997? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7013var separator = this.EatToken(); 7153lastTokenOfType = this.EatToken(); 7172this.EatToken(); 7176this.EatToken(); 7223this.EatToken(); 7241lastTokenOfType = this.EatToken(); 7246lastTokenOfType = this.EatToken(); 7274lastTokenOfType = this.EatToken(); 7295lastTokenOfType = this.EatToken(); 7309this.EatToken(); 7312this.EatToken(); 7321lastTokenOfType = this.EatToken(); 7345lastTokenOfType = this.EatToken(); 7352lastTokenOfType = this.EatToken(); 7357lastTokenOfType = this.EatToken(); 7363lastTokenOfType = this.EatToken(); 7370lastTokenOfType = this.EatToken(); 7399lastTokenOfType = EatToken(); 7426lastTokenOfType = EatToken(); 7448var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7516return _syntaxFactory.PredefinedType(this.EatToken()); 7541this.EatToken(), 7542this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7666var questionToken = this.EatToken(); 7846list.AddSeparator(this.EatToken()); 7944var token = this.EatToken(); 8148type = _syntaxFactory.PointerType(type, this.EatToken()); 8317return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8638EatToken(); 8648EatToken(); 8703this.EatToken(); 8709this.EatToken(); 8857this.EatToken(); 8861this.EatToken(); 8952EatToken(); 9341this.EatToken(), 9380var @catch = this.EatToken(); 9387var openParen = this.EatToken(); 9416whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9468var keyword = this.EatToken(); 9520this.EatToken(); 9521if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9523this.EatToken().Kind == SyntaxKind.IdentifierToken && 9524this.EatToken().Kind == SyntaxKind.InKeyword) 9596this.EatToken(); 9697var skippedForToken = this.EatToken(); 9799this.EatToken(); 9911caseOrDefault = this.EatToken(); 10079var yieldToken = ConvertToKeyword(this.EatToken()); 10087returnOrBreak = this.EatToken(); 10201var caseKeyword = this.EatToken(); 10441usingKeyword = EatToken(); 10446usingKeyword = EatToken(); 10770mod = this.EatToken(); 10796this.EatToken(); 11417this.EatToken(), 11451this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11591var questionToken = this.EatToken(); 11751var token1 = EatToken(); 11752var token2 = EatToken(); 11764var token1 = EatToken(); 11765_ = EatToken(); 11766var token3 = EatToken(); 11792this.EatToken(), 11825var token1 = this.EatToken(); 11826var token2 = this.EatToken(); 11849dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11972return _syntaxFactory.ThisExpression(this.EatToken()); 11984return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12019var refKeyword = this.EatToken(); 12030var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12094expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12104this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12116expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12134SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12138expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12151expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12164return _syntaxFactory.BaseExpression(this.EatToken()); 12184this.EatToken(); // `var` 12200this.EatToken(); // eat the identifier 12205this.EatToken(); // eat the open paren or comma 12216this.EatToken(); // eat the close paren 12294return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12297return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12319this.EatToken(); 12338expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12380=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12539refKindKeyword = this.EatToken(); 12571this.EatToken(), 12579var keyword = this.EatToken(); 12597this.EatToken(), 12606this.EatToken(), 12615this.EatToken(), 12623var checkedOrUnchecked = this.EatToken(); 12711this.EatToken(); 12729var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12806_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12830_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12860this.EatToken(); 12873this.EatToken(); 12964EatToken(); 12970EatToken(); 13027EatToken(); 13033EatToken(); 13034EatToken(); 13076EatToken(); 13359this.EatToken(); // open paren 13563commas.Add(this.EatToken()); 13630var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14054this.EatToken(); 14133name = this.EatToken(); 14166? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14244direction = ConvertToKeyword(this.EatToken()); 14573b.Add(this.EatToken());
Parser\LanguageParser_InterpolatedString.cs (2)
18var originalToken = this.EatToken(); 113var originalToken = this.EatToken();
Parser\LanguageParser_Patterns.cs (13)
66ConvertToKeyword(this.EatToken()), 112ConvertToKeyword(this.EatToken()), 127this.EatToken(); 138this.EatToken(); // consume the `(` or `,` 146this.EatToken(); 163ConvertToKeyword(this.EatToken()), 169skippedSyntax: AddError(this.EatToken(), ErrorCode.ERR_EqualityOperatorInPatternNotSupported), 178this.AddError(this.EatToken(), ErrorCode.ERR_InequalityOperatorInPatternNotSupported)), 226this.EatToken(), 380? AddError(this.EatToken(), ErrorCode.ERR_DesignatorBeforePropertyPattern) 446this.EatToken(); 536var colon = EatToken(); 616? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (7)
498=> this.CurrentToken.Kind == kind ? this.EatToken() : null; 549return AddTrailingSkippedSyntax(replacement, this.EatToken()); 585return this.EatToken(); 598return this.EatToken(); 640var token = this.EatToken(); 655return ConvertToKeyword(this.EatToken()); 670return ConvertToKeyword(this.EatToken());