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_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\LanguageParser.cs (189)
615var token = this.EatToken(); 738var skippedToken = EatToken(); 966? ConvertToKeyword(this.EatToken()) 980unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1020type = AddTrailingSkippedSyntax(type, this.EatToken()); 1056EatToken(); 1135? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1398modTok = ConvertToKeyword(this.EatToken()); 1403modTok = ConvertToKeyword(this.EatToken()); 1410modTok = ConvertToKeyword(this.EatToken()); 1430modTok = this.EatToken(); 1435modTok = this.EatToken(); 1462modTok = ConvertToKeyword(this.EatToken()); 1479modTok = ConvertToKeyword(this.EatToken()); 1489modTok = this.EatToken(); 1510modTok = ConvertToKeyword(EatToken()); 1538this.EatToken(); //move past contextual token 1543this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1697this.EatToken(); // partial 1768keyword = ConvertToKeyword(this.EatToken()); 1785keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1904keyword = ConvertToKeyword(this.EatToken()); 1906? EatToken() 1917var misplacedToken = this.EatToken(); 1921this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2076var token = this.EatToken(); 2120tokens.Add(this.EatToken()); 2321newKeyword: this.EatToken(), 2328classOrStructKeyword: this.EatToken(), 2330? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2336classOrStructKeyword: this.EatToken(), 2340_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2345this.EatToken())), 2354this.EatToken())), 2670var identifier = this.EatToken(); 2984EatToken(); 3522? this.EatToken() 3765EatToken(); 3807? this.EatToken() 3820style = this.EatToken(); 3953var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4004opToken = this.EatToken(); 4015opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 4036opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4052var opToken2 = this.EatToken(); 4058opToken2 = this.EatToken(); 4065opToken2 = this.EatToken(); 4079var opToken2 = this.EatToken(); 4388? this.EatToken() 4579var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4605var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4959this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4960this.EatToken())); 5007modifiers.Add(this.EatToken()); 5053modifiers.Add(this.EatToken()); 5071var eventToken = this.EatToken(); 5174var semi = this.EatToken(); 5526this.EatToken(); 5585var equals = this.EatToken(); 5589? this.EatToken() 6059SyntaxToken identifierToken = this.EatToken(); 6172this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6365var start = this.EatToken(); 6367this.EatToken(); 6368greaterThanToken = this.EatToken(); 6380this.EatToken(); 6391greaterThanToken = EatToken(); 6527greaterThanToken = this.EatToken(); 6691? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6721result = AddTrailingSkippedSyntax(result, this.EatToken()); 6785identifierOrThisOpt = this.EatToken(); 6904? this.EatToken() // fine after the first identifier 6918separator = this.EatToken(); 7022? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7038var separator = this.EatToken(); 7178lastTokenOfType = this.EatToken(); 7197this.EatToken(); 7201this.EatToken(); 7248this.EatToken(); 7266lastTokenOfType = this.EatToken(); 7271lastTokenOfType = this.EatToken(); 7299lastTokenOfType = this.EatToken(); 7320lastTokenOfType = this.EatToken(); 7334this.EatToken(); 7337this.EatToken(); 7346lastTokenOfType = this.EatToken(); 7370lastTokenOfType = this.EatToken(); 7377lastTokenOfType = this.EatToken(); 7382lastTokenOfType = this.EatToken(); 7388lastTokenOfType = this.EatToken(); 7395lastTokenOfType = this.EatToken(); 7424lastTokenOfType = EatToken(); 7451lastTokenOfType = EatToken(); 7473var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7541return _syntaxFactory.PredefinedType(this.EatToken()); 7566this.EatToken(), 7567this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7691var questionToken = this.EatToken(); 7871list.AddSeparator(this.EatToken()); 7969var token = this.EatToken(); 8173type = _syntaxFactory.PointerType(type, this.EatToken()); 8342return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8679EatToken(); 8689EatToken(); 8744this.EatToken(); 8750this.EatToken(); 8898this.EatToken(); 8902this.EatToken(); 8993EatToken(); 9384this.EatToken(), 9423var @catch = this.EatToken(); 9430var openParen = this.EatToken(); 9459whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9511var keyword = this.EatToken(); 9563this.EatToken(); 9564if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9566this.EatToken().Kind == SyntaxKind.IdentifierToken && 9567this.EatToken().Kind == SyntaxKind.InKeyword) 9639this.EatToken(); 9740var skippedForToken = this.EatToken(); 9842this.EatToken(); 9954caseOrDefault = this.EatToken(); 10122var yieldToken = ConvertToKeyword(this.EatToken()); 10130returnOrBreak = this.EatToken(); 10244var caseKeyword = this.EatToken(); 10484usingKeyword = EatToken(); 10489usingKeyword = EatToken(); 10813mod = this.EatToken(); 10839this.EatToken(); 11466this.EatToken(), 11500this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11640var questionToken = this.EatToken(); 11800var token1 = EatToken(); 11801var token2 = EatToken(); 11813var token1 = EatToken(); 11814_ = EatToken(); 11815var token3 = EatToken(); 11841this.EatToken(), 11874var token1 = this.EatToken(); 11875var token2 = this.EatToken(); 11898dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 12023return _syntaxFactory.ThisExpression(this.EatToken()); 12035return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12070var refKeyword = this.EatToken(); 12081var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12145expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12155this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12167expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12185SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12189expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12202expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12215return _syntaxFactory.BaseExpression(this.EatToken()); 12235this.EatToken(); // `var` 12251this.EatToken(); // eat the identifier 12256this.EatToken(); // eat the open paren or comma 12267this.EatToken(); // eat the close paren 12345return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12348return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12370this.EatToken(); 12389expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12431=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12590refKindKeyword = this.EatToken(); 12622this.EatToken(), 12630var keyword = this.EatToken(); 12648this.EatToken(), 12657this.EatToken(), 12666this.EatToken(), 12674var checkedOrUnchecked = this.EatToken(); 12771this.EatToken(); 12789var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12866_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12890_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12920this.EatToken(); 12933this.EatToken(); 13024EatToken(); 13030EatToken(); 13087EatToken(); 13093EatToken(); 13094EatToken(); 13136EatToken(); 13432this.EatToken(); // open paren 13636commas.Add(this.EatToken()); 13703var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14127this.EatToken(); 14206name = this.EatToken(); 14239? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14317direction = ConvertToKeyword(this.EatToken()); 14646b.Add(this.EatToken());
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());