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(); 6061this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6254var start = this.EatToken(); 6256this.EatToken(); 6257greaterThanToken = this.EatToken(); 6269this.EatToken(); 6280greaterThanToken = EatToken(); 6416greaterThanToken = this.EatToken(); 6585? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6615result = AddTrailingSkippedSyntax(result, this.EatToken()); 6679identifierOrThisOpt = this.EatToken(); 6798? this.EatToken() // fine after the first identifier 6812separator = this.EatToken(); 6916? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6932var separator = this.EatToken(); 7072lastTokenOfType = this.EatToken(); 7091this.EatToken(); 7095this.EatToken(); 7142this.EatToken(); 7160lastTokenOfType = this.EatToken(); 7165lastTokenOfType = this.EatToken(); 7193lastTokenOfType = this.EatToken(); 7214lastTokenOfType = this.EatToken(); 7228this.EatToken(); 7231this.EatToken(); 7240lastTokenOfType = this.EatToken(); 7264lastTokenOfType = this.EatToken(); 7271lastTokenOfType = this.EatToken(); 7276lastTokenOfType = this.EatToken(); 7282lastTokenOfType = this.EatToken(); 7289lastTokenOfType = this.EatToken(); 7318lastTokenOfType = EatToken(); 7345lastTokenOfType = EatToken(); 7367var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7435return _syntaxFactory.PredefinedType(this.EatToken()); 7460this.EatToken(), 7461this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7585var questionToken = this.EatToken(); 7765list.AddSeparator(this.EatToken()); 7863var token = this.EatToken(); 8067type = _syntaxFactory.PointerType(type, this.EatToken()); 8236return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8563EatToken(); 8573EatToken(); 8628this.EatToken(); 8634this.EatToken(); 8782this.EatToken(); 8786this.EatToken(); 8877EatToken(); 9266this.EatToken(), 9305var @catch = this.EatToken(); 9312var openParen = this.EatToken(); 9341whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9393var keyword = this.EatToken(); 9445this.EatToken(); 9446if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9448this.EatToken().Kind == SyntaxKind.IdentifierToken && 9449this.EatToken().Kind == SyntaxKind.InKeyword) 9521this.EatToken(); 9622var skippedForToken = this.EatToken(); 9724this.EatToken(); 9836caseOrDefault = this.EatToken(); 9971var yieldToken = ConvertToKeyword(this.EatToken()); 9979returnOrBreak = this.EatToken(); 10093var caseKeyword = this.EatToken(); 10333usingKeyword = EatToken(); 10338usingKeyword = EatToken(); 10660mod = this.EatToken(); 10686this.EatToken(); 11307this.EatToken(), 11341this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11481var questionToken = this.EatToken(); 11641var token1 = EatToken(); 11642var token2 = EatToken(); 11654var token1 = EatToken(); 11655_ = EatToken(); 11656var token3 = EatToken(); 11682this.EatToken(), 11715var token1 = this.EatToken(); 11716var token2 = this.EatToken(); 11739dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11862return _syntaxFactory.ThisExpression(this.EatToken()); 11874return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11909var refKeyword = this.EatToken(); 11920var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11969expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11979this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11991expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12009SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12013expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12026expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12039return _syntaxFactory.BaseExpression(this.EatToken()); 12059this.EatToken(); // `var` 12075this.EatToken(); // eat the identifier 12080this.EatToken(); // eat the open paren or comma 12091this.EatToken(); // eat the close paren 12169return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12172return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12194this.EatToken(); 12213expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12255=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12414refKindKeyword = this.EatToken(); 12446this.EatToken(), 12454var keyword = this.EatToken(); 12472this.EatToken(), 12481this.EatToken(), 12490this.EatToken(), 12498var checkedOrUnchecked = this.EatToken(); 12586this.EatToken(); 12604var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12681_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12705_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12733this.EatToken(); 12746this.EatToken(); 12825EatToken(); 12831EatToken(); 12888EatToken(); 12894EatToken(); 12895EatToken(); 12937EatToken(); 13220this.EatToken(); // open paren 13424commas.Add(this.EatToken()); 13491var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13915this.EatToken(); 13994name = this.EatToken(); 14027? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14105direction = ConvertToKeyword(this.EatToken()); 14434b.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());