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.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)) 1394modTok = ConvertToKeyword(this.EatToken()); 1399modTok = ConvertToKeyword(this.EatToken()); 1406modTok = ConvertToKeyword(this.EatToken()); 1426modTok = this.EatToken(); 1431modTok = this.EatToken(); 1447modTok = ConvertToKeyword(EatToken()); 1456modTok = ConvertToKeyword(this.EatToken()); 1469modTok = ConvertToKeyword(this.EatToken()); 1474modTok = this.EatToken(); 1532this.EatToken(); //move past contextual token 1537this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1691this.EatToken(); // partial 1762keyword = ConvertToKeyword(this.EatToken()); 1779keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1898keyword = ConvertToKeyword(this.EatToken()); 1900? EatToken() 1911var misplacedToken = this.EatToken(); 1915this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2056var token = this.EatToken(); 2100tokens.Add(this.EatToken()); 2306newKeyword: this.EatToken(), 2313classOrStructKeyword: this.EatToken(), 2315? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2321classOrStructKeyword: this.EatToken(), 2325_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2330this.EatToken())), 2339this.EatToken())), 2666var identifier = this.EatToken(); 2980EatToken(); 3518? this.EatToken() 3768EatToken(); 3812? this.EatToken() 3825style = this.EatToken(); 3958var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4009opToken = this.EatToken(); 4020opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 4041opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4057var opToken2 = this.EatToken(); 4063opToken2 = this.EatToken(); 4070opToken2 = this.EatToken(); 4084var opToken2 = this.EatToken(); 4397? this.EatToken() 4588var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4614var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4968this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4969this.EatToken())); 5016modifiers.Add(this.EatToken()); 5062modifiers.Add(this.EatToken()); 5080var eventToken = this.EatToken(); 5183var semi = this.EatToken(); 5539this.EatToken(); 5598var equals = this.EatToken(); 5602? this.EatToken() 6072SyntaxToken identifierToken = this.EatToken(); 6185this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6378var start = this.EatToken(); 6380this.EatToken(); 6381greaterThanToken = this.EatToken(); 6393this.EatToken(); 6404greaterThanToken = EatToken(); 6540greaterThanToken = this.EatToken(); 6709? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6739result = AddTrailingSkippedSyntax(result, this.EatToken()); 6803identifierOrThisOpt = this.EatToken(); 6922? this.EatToken() // fine after the first identifier 6936separator = this.EatToken(); 7040? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7056var separator = this.EatToken(); 7196lastTokenOfType = this.EatToken(); 7215this.EatToken(); 7219this.EatToken(); 7266this.EatToken(); 7284lastTokenOfType = this.EatToken(); 7289lastTokenOfType = this.EatToken(); 7317lastTokenOfType = this.EatToken(); 7338lastTokenOfType = this.EatToken(); 7352this.EatToken(); 7355this.EatToken(); 7364lastTokenOfType = this.EatToken(); 7388lastTokenOfType = this.EatToken(); 7395lastTokenOfType = this.EatToken(); 7400lastTokenOfType = this.EatToken(); 7406lastTokenOfType = this.EatToken(); 7413lastTokenOfType = this.EatToken(); 7442lastTokenOfType = EatToken(); 7469lastTokenOfType = EatToken(); 7491var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7559return _syntaxFactory.PredefinedType(this.EatToken()); 7584this.EatToken(), 7585this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7709var questionToken = this.EatToken(); 7889list.AddSeparator(this.EatToken()); 7987var token = this.EatToken(); 8191type = _syntaxFactory.PointerType(type, this.EatToken()); 8360return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8681EatToken(); 8691EatToken(); 8746this.EatToken(); 8752this.EatToken(); 8900this.EatToken(); 8904this.EatToken(); 8995EatToken(); 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(); 11460this.EatToken(), 11494this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11634var questionToken = this.EatToken(); 11794var token1 = EatToken(); 11795var token2 = EatToken(); 11807var token1 = EatToken(); 11808_ = EatToken(); 11809var token3 = EatToken(); 11835this.EatToken(), 11868var token1 = this.EatToken(); 11869var token2 = this.EatToken(); 11892dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 12015return _syntaxFactory.ThisExpression(this.EatToken()); 12027return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12062var refKeyword = this.EatToken(); 12073var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12137expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12147this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12159expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12177SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12181expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12194expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12207return _syntaxFactory.BaseExpression(this.EatToken()); 12227this.EatToken(); // `var` 12243this.EatToken(); // eat the identifier 12248this.EatToken(); // eat the open paren or comma 12259this.EatToken(); // eat the close paren 12337return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12340return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12362this.EatToken(); 12381expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12423=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12582refKindKeyword = this.EatToken(); 12614this.EatToken(), 12622var keyword = this.EatToken(); 12640this.EatToken(), 12649this.EatToken(), 12658this.EatToken(), 12666var checkedOrUnchecked = this.EatToken(); 12754this.EatToken(); 12772var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12849_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12873_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12903this.EatToken(); 12916this.EatToken(); 13007EatToken(); 13013EatToken(); 13070EatToken(); 13076EatToken(); 13077EatToken(); 13119EatToken(); 13415this.EatToken(); // open paren 13619commas.Add(this.EatToken()); 13686var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14110this.EatToken(); 14189name = this.EatToken(); 14222? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14300direction = ConvertToKeyword(this.EatToken()); 14629b.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\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());