267 references to EatToken
Microsoft.CodeAnalysis.CSharp (267)
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 (190)
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())), 2634var identifier = this.EatToken(); 2952EatToken(); 3411? this.EatToken() 3664EatToken(); 3708? this.EatToken() 3721style = this.EatToken(); 3854var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3905opToken = this.EatToken(); 3916opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3937opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3953var opToken2 = this.EatToken(); 3959opToken2 = this.EatToken(); 3966opToken2 = this.EatToken(); 3980var opToken2 = this.EatToken(); 4282? this.EatToken() 4473var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4499var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4851this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4852this.EatToken())); 4900modifiers.Add(this.EatToken()); 4914modifiers.Add(this.EatToken()); 4927modifiers.Add(this.EatToken()); 4945var eventToken = this.EatToken(); 5048var semi = this.EatToken(); 5403this.EatToken(); 5462var equals = this.EatToken(); 5466? this.EatToken() 5875SyntaxToken identifierToken = this.EatToken(); 5990this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6183var start = this.EatToken(); 6185this.EatToken(); 6186greaterThanToken = this.EatToken(); 6198this.EatToken(); 6209greaterThanToken = EatToken(); 6345greaterThanToken = this.EatToken(); 6514? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6544result = AddTrailingSkippedSyntax(result, this.EatToken()); 6608identifierOrThisOpt = this.EatToken(); 6727? this.EatToken() // fine after the first identifier 6741separator = this.EatToken(); 6845? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6861var separator = this.EatToken(); 7001lastTokenOfType = this.EatToken(); 7020this.EatToken(); 7024this.EatToken(); 7071this.EatToken(); 7089lastTokenOfType = this.EatToken(); 7094lastTokenOfType = this.EatToken(); 7122lastTokenOfType = this.EatToken(); 7143lastTokenOfType = this.EatToken(); 7157this.EatToken(); 7160this.EatToken(); 7169lastTokenOfType = this.EatToken(); 7193lastTokenOfType = this.EatToken(); 7200lastTokenOfType = this.EatToken(); 7205lastTokenOfType = this.EatToken(); 7211lastTokenOfType = this.EatToken(); 7218lastTokenOfType = this.EatToken(); 7247lastTokenOfType = EatToken(); 7274lastTokenOfType = EatToken(); 7296var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7364return _syntaxFactory.PredefinedType(this.EatToken()); 7389this.EatToken(), 7390this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7514var questionToken = this.EatToken(); 7694list.AddSeparator(this.EatToken()); 7792var token = this.EatToken(); 7996type = _syntaxFactory.PointerType(type, this.EatToken()); 8165return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8493EatToken(); 8503EatToken(); 8558this.EatToken(); 8564this.EatToken(); 8712this.EatToken(); 8716this.EatToken(); 8807EatToken(); 9196this.EatToken(), 9235var @catch = this.EatToken(); 9242var openParen = this.EatToken(); 9271whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9323var keyword = this.EatToken(); 9375this.EatToken(); 9376if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9378this.EatToken().Kind == SyntaxKind.IdentifierToken && 9379this.EatToken().Kind == SyntaxKind.InKeyword) 9451this.EatToken(); 9552var skippedForToken = this.EatToken(); 9654this.EatToken(); 9766caseOrDefault = this.EatToken(); 9901var yieldToken = ConvertToKeyword(this.EatToken()); 9909returnOrBreak = this.EatToken(); 10023var caseKeyword = this.EatToken(); 10263usingKeyword = EatToken(); 10268usingKeyword = EatToken(); 10590mod = this.EatToken(); 10616this.EatToken(); 11242this.EatToken(), 11276this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11416var questionToken = this.EatToken(); 11573var token1 = EatToken(); 11574var token2 = EatToken(); 11586var token1 = EatToken(); 11587_ = EatToken(); 11588var token3 = EatToken(); 11614this.EatToken(), 11647var token1 = this.EatToken(); 11648var token2 = this.EatToken(); 11671dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11794return _syntaxFactory.ThisExpression(this.EatToken()); 11810return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11840var refKeyword = this.EatToken(); 11851var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11900expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11910this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11922expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11940SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11944expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11957expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11970return _syntaxFactory.BaseExpression(this.EatToken()); 11990this.EatToken(); // `var` 12006this.EatToken(); // eat the identifier 12011this.EatToken(); // eat the open paren or comma 12022this.EatToken(); // eat the close paren 12100return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12103return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12125this.EatToken(); 12144expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12186=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12345refKindKeyword = this.EatToken(); 12377this.EatToken(), 12385var keyword = this.EatToken(); 12403this.EatToken(), 12412this.EatToken(), 12421this.EatToken(), 12429var checkedOrUnchecked = this.EatToken(); 12517this.EatToken(); 12535var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12612_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12636_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12664this.EatToken(); 12677this.EatToken(); 12756EatToken(); 12762EatToken(); 12819EatToken(); 12825EatToken(); 12826EatToken(); 12868EatToken(); 13151this.EatToken(); // open paren 13355commas.Add(this.EatToken()); 13422var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13866this.EatToken(); 13949name = this.EatToken(); 13982? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14060direction = ConvertToKeyword(this.EatToken()); 14389b.Add(this.EatToken());
Parser\LanguageParser_InterpolatedString.cs (1)
41var originalToken = this.EatToken();
Parser\LanguageParser_Patterns.cs (10)
66ConvertToKeyword(this.EatToken()), 112ConvertToKeyword(this.EatToken()), 127this.EatToken(); 138this.EatToken(); // consume the `(` or `,` 146this.EatToken(); 163ConvertToKeyword(this.EatToken()), 211this.EatToken(), 421this.EatToken(); 511var colon = EatToken(); 591? 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());