268 references to EatToken
Microsoft.CodeAnalysis.CSharp (268)
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())), 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(); 4924this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4925this.EatToken())); 4973modifiers.Add(this.EatToken()); 4987modifiers.Add(this.EatToken()); 5000modifiers.Add(this.EatToken()); 5018var eventToken = this.EatToken(); 5121var semi = this.EatToken(); 5476this.EatToken(); 5535var equals = this.EatToken(); 5539? this.EatToken() 5948SyntaxToken identifierToken = this.EatToken(); 6063this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6256var start = this.EatToken(); 6258this.EatToken(); 6259greaterThanToken = this.EatToken(); 6271this.EatToken(); 6282greaterThanToken = EatToken(); 6418greaterThanToken = this.EatToken(); 6587? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6617result = AddTrailingSkippedSyntax(result, this.EatToken()); 6681identifierOrThisOpt = this.EatToken(); 6800? this.EatToken() // fine after the first identifier 6814separator = this.EatToken(); 6918? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6934var separator = this.EatToken(); 7074lastTokenOfType = this.EatToken(); 7093this.EatToken(); 7097this.EatToken(); 7144this.EatToken(); 7162lastTokenOfType = this.EatToken(); 7167lastTokenOfType = this.EatToken(); 7195lastTokenOfType = this.EatToken(); 7216lastTokenOfType = this.EatToken(); 7230this.EatToken(); 7233this.EatToken(); 7242lastTokenOfType = this.EatToken(); 7266lastTokenOfType = this.EatToken(); 7273lastTokenOfType = this.EatToken(); 7278lastTokenOfType = this.EatToken(); 7284lastTokenOfType = this.EatToken(); 7291lastTokenOfType = this.EatToken(); 7320lastTokenOfType = EatToken(); 7347lastTokenOfType = EatToken(); 7369var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7437return _syntaxFactory.PredefinedType(this.EatToken()); 7462this.EatToken(), 7463this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7587var questionToken = this.EatToken(); 7767list.AddSeparator(this.EatToken()); 7865var token = this.EatToken(); 8069type = _syntaxFactory.PointerType(type, this.EatToken()); 8238return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8565EatToken(); 8575EatToken(); 8630this.EatToken(); 8636this.EatToken(); 8784this.EatToken(); 8788this.EatToken(); 8879EatToken(); 9268this.EatToken(), 9307var @catch = this.EatToken(); 9314var openParen = this.EatToken(); 9343whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9395var keyword = this.EatToken(); 9447this.EatToken(); 9448if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9450this.EatToken().Kind == SyntaxKind.IdentifierToken && 9451this.EatToken().Kind == SyntaxKind.InKeyword) 9523this.EatToken(); 9624var skippedForToken = this.EatToken(); 9726this.EatToken(); 9838caseOrDefault = this.EatToken(); 9973var yieldToken = ConvertToKeyword(this.EatToken()); 9981returnOrBreak = this.EatToken(); 10095var caseKeyword = this.EatToken(); 10335usingKeyword = EatToken(); 10340usingKeyword = EatToken(); 10662mod = this.EatToken(); 10688this.EatToken(); 11309this.EatToken(), 11343this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11483var questionToken = this.EatToken(); 11643var token1 = EatToken(); 11644var token2 = EatToken(); 11656var token1 = EatToken(); 11657_ = EatToken(); 11658var token3 = EatToken(); 11684this.EatToken(), 11717var token1 = this.EatToken(); 11718var token2 = this.EatToken(); 11741dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11864return _syntaxFactory.ThisExpression(this.EatToken()); 11876return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11911var refKeyword = this.EatToken(); 11922var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11971expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11981this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11993expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12011SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12015expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12028expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12041return _syntaxFactory.BaseExpression(this.EatToken()); 12061this.EatToken(); // `var` 12077this.EatToken(); // eat the identifier 12082this.EatToken(); // eat the open paren or comma 12093this.EatToken(); // eat the close paren 12171return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12174return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12196this.EatToken(); 12215expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12257=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12416refKindKeyword = this.EatToken(); 12448this.EatToken(), 12456var keyword = this.EatToken(); 12474this.EatToken(), 12483this.EatToken(), 12492this.EatToken(), 12500var checkedOrUnchecked = this.EatToken(); 12588this.EatToken(); 12606var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12683_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12707_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12735this.EatToken(); 12748this.EatToken(); 12827EatToken(); 12833EatToken(); 12890EatToken(); 12896EatToken(); 12897EatToken(); 12939EatToken(); 13222this.EatToken(); // open paren 13426commas.Add(this.EatToken()); 13493var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13917this.EatToken(); 13996name = this.EatToken(); 14029? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14107direction = ConvertToKeyword(this.EatToken()); 14436b.Add(this.EatToken());
Parser\LanguageParser_InterpolatedString.cs (2)
18var originalToken = this.EatToken(); 113var 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());