265 references to EatToken
Microsoft.CodeAnalysis.CSharp (265)
Parser\DirectiveParser.cs (22)
380line = this.EatToken(); 400file = this.EatToken(); 547SyntaxKind.EnableKeyword => EatToken(), 548SyntaxKind.DisableKeyword => EatToken(), 549SyntaxKind.RestoreKeyword => EatToken(), 555SyntaxKind.WarningsKeyword => EatToken(), 556SyntaxKind.AnnotationsKeyword => EatToken(), 580style = this.EatToken(); 597id = this.EatToken(); 609id = this.EatToken(); 626ids.AddSeparator(this.EatToken()); 641var checksum = this.EatToken(); 745skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 751skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 757? this.EatToken() 779var op = this.EatToken(); 792var op = this.EatToken(); 805var op = this.EatToken(); 817var op = this.EatToken(); 830var open = this.EatToken(); 835var identifier = TruncateIdentifier(this.EatToken()); 839return 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(); 1039operatorToken = AddTrailingSkippedSyntax(operatorToken, EatToken()); 1054var operatorToken2 = this.EatToken(); 1059var operatorToken3 = this.EatToken(); 1095var operatorToken2 = this.EatToken(); 1105var operatorToken2 = this.EatToken(); 1164var operatorToken2 = this.EatToken(); 1195var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_MisplacedUnchecked); 1211SyntaxToken implicitOrExplicit = EatToken(); 1324refKindOpt = EatToken(); 1334var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_RefReadOnlyWrongOrdering); 1339readOnlyOpt = EatToken(); 1367var open = EatToken(); 1453return SyntaxFactory.PredefinedType(EatToken()); 1458SyntaxToken alias = EatToken(); 1466SyntaxToken colonColon = EatToken(); 1492SyntaxToken dot = EatToken(); 1520type = SyntaxFactory.NullableType(type, EatToken()); 1525type = SyntaxFactory.PointerType(type, EatToken()); 1536SyntaxToken open = EatToken(); 1546dimensionList.AddSeparator(this.EatToken()); 1644badTokens.Add(this.EatToken());
Parser\LanguageParser.cs (188)
615var token = this.EatToken(); 730var skippedToken = EatToken(); 957? ConvertToKeyword(this.EatToken()) 971unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1011type = AddTrailingSkippedSyntax(type, this.EatToken()); 1047EatToken(); 1126? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1385modTok = ConvertToKeyword(this.EatToken()); 1390modTok = ConvertToKeyword(this.EatToken()); 1397modTok = ConvertToKeyword(this.EatToken()); 1417modTok = this.EatToken(); 1422modTok = this.EatToken(); 1438modTok = ConvertToKeyword(EatToken()); 1447modTok = ConvertToKeyword(this.EatToken()); 1460modTok = ConvertToKeyword(this.EatToken()); 1465modTok = this.EatToken(); 1511this.EatToken(); //move past contextual token 1516this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1658this.EatToken(); // partial 1729keyword = ConvertToKeyword(this.EatToken()); 1745keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1870keyword = ConvertToKeyword(this.EatToken()); 1872? EatToken() 1883var misplacedToken = this.EatToken(); 1887this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2026var token = this.EatToken(); 2070tokens.Add(this.EatToken()); 2276newKeyword: this.EatToken(), 2283classOrStructKeyword: this.EatToken(), 2285? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2291classOrStructKeyword: this.EatToken(), 2295_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2300this.EatToken())), 2309this.EatToken())), 2631var identifier = this.EatToken(); 2949EatToken(); 3390token = this.EatToken(); 3644EatToken(); 3688? this.EatToken() 3701style = this.EatToken(); 3834var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3885opToken = this.EatToken(); 3896opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3917opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3933var opToken2 = this.EatToken(); 3939opToken2 = this.EatToken(); 3946opToken2 = this.EatToken(); 3960var opToken2 = this.EatToken(); 4244? this.EatToken() 4435var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 4461var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4814this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4815this.EatToken())); 4863modifiers.Add(this.EatToken()); 4877modifiers.Add(this.EatToken()); 4890modifiers.Add(this.EatToken()); 4908var eventToken = this.EatToken(); 5011var semi = this.EatToken(); 5365this.EatToken(); 5425var equals = this.EatToken(); 5429? this.EatToken() 5838SyntaxToken identifierToken = this.EatToken(); 5953this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6146var start = this.EatToken(); 6148this.EatToken(); 6149greaterThanToken = this.EatToken(); 6161this.EatToken(); 6172greaterThanToken = EatToken(); 6308greaterThanToken = this.EatToken(); 6477? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6507result = AddTrailingSkippedSyntax(result, this.EatToken()); 6571identifierOrThisOpt = this.EatToken(); 6690? this.EatToken() // fine after the first identifier 6704separator = this.EatToken(); 6808? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6824var separator = this.EatToken(); 6964lastTokenOfType = this.EatToken(); 6983this.EatToken(); 6987this.EatToken(); 7034this.EatToken(); 7052lastTokenOfType = this.EatToken(); 7057lastTokenOfType = this.EatToken(); 7085lastTokenOfType = this.EatToken(); 7106lastTokenOfType = this.EatToken(); 7120this.EatToken(); 7123this.EatToken(); 7132lastTokenOfType = this.EatToken(); 7156lastTokenOfType = this.EatToken(); 7163lastTokenOfType = this.EatToken(); 7168lastTokenOfType = this.EatToken(); 7174lastTokenOfType = this.EatToken(); 7181lastTokenOfType = this.EatToken(); 7210lastTokenOfType = EatToken(); 7237lastTokenOfType = EatToken(); 7259var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7327return _syntaxFactory.PredefinedType(this.EatToken()); 7352this.EatToken(), 7353this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7477var questionToken = this.EatToken(); 7657list.AddSeparator(this.EatToken()); 7759var token = this.EatToken(); 7963type = _syntaxFactory.PointerType(type, this.EatToken()); 8132return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8460EatToken(); 8470EatToken(); 8525this.EatToken(); 8531this.EatToken(); 8718EatToken(); 9107this.EatToken(), 9146var @catch = this.EatToken(); 9153var openParen = this.EatToken(); 9182whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9234var keyword = this.EatToken(); 9286this.EatToken(); 9287if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9289this.EatToken().Kind == SyntaxKind.IdentifierToken && 9290this.EatToken().Kind == SyntaxKind.InKeyword) 9362this.EatToken(); 9463var skippedForToken = this.EatToken(); 9565this.EatToken(); 9677caseOrDefault = this.EatToken(); 9812var yieldToken = ConvertToKeyword(this.EatToken()); 9820returnOrBreak = this.EatToken(); 9934var caseKeyword = this.EatToken(); 10174usingKeyword = EatToken(); 10179usingKeyword = EatToken(); 10501mod = this.EatToken(); 10529this.EatToken(); 11155this.EatToken(), 11189this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11329var questionToken = this.EatToken(); 11486var token1 = EatToken(); 11487var token2 = EatToken(); 11499var token1 = EatToken(); 11500_ = EatToken(); 11501var token3 = EatToken(); 11527this.EatToken(), 11560var token1 = this.EatToken(); 11561var token2 = this.EatToken(); 11584dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11707return _syntaxFactory.ThisExpression(this.EatToken()); 11723return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11753var refKeyword = this.EatToken(); 11764var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11813expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11823this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11835expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11853SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11857expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11870expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11883return _syntaxFactory.BaseExpression(this.EatToken()); 11903this.EatToken(); // `var` 11919this.EatToken(); // eat the identifier 11924this.EatToken(); // eat the open paren or comma 11935this.EatToken(); // eat the close paren 12013return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12016return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12038this.EatToken(); 12057expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12099=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12258refKindKeyword = this.EatToken(); 12290this.EatToken(), 12298var keyword = this.EatToken(); 12316this.EatToken(), 12325this.EatToken(), 12334this.EatToken(), 12342var checkedOrUnchecked = this.EatToken(); 12430this.EatToken(); 12448var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12525_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12549_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12577this.EatToken(); 12590this.EatToken(); 12669EatToken(); 12675EatToken(); 12732EatToken(); 12738EatToken(); 12739EatToken(); 12781EatToken(); 13059this.EatToken(); // open paren 13261commas.Add(this.EatToken()); 13328var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13772this.EatToken(); 13855name = this.EatToken(); 13888? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13963direction = ConvertToKeyword(this.EatToken()); 14287b.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()); 591return this.EatToken(); 604return this.EatToken(); 623var token = this.EatToken(); 638return ConvertToKeyword(this.EatToken()); 653return ConvertToKeyword(this.EatToken());