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)) 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()); 1564this.EatToken(); //move past contextual token 1569this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1723this.EatToken(); // partial 1794keyword = ConvertToKeyword(this.EatToken()); 1811keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1930keyword = ConvertToKeyword(this.EatToken()); 1932? EatToken() 1943var misplacedToken = this.EatToken(); 1947this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2102var token = this.EatToken(); 2146tokens.Add(this.EatToken()); 2352newKeyword: this.EatToken(), 2359classOrStructKeyword: this.EatToken(), 2361? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2367classOrStructKeyword: this.EatToken(), 2371_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2376this.EatToken())), 2385this.EatToken())), 2712var identifier = this.EatToken(); 3026EatToken(); 3564? this.EatToken() 3814EatToken(); 3858? this.EatToken() 3871style = this.EatToken(); 4004var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4055opToken = this.EatToken(); 4066opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 4087opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4103var opToken2 = this.EatToken(); 4109opToken2 = this.EatToken(); 4116opToken2 = this.EatToken(); 4130var opToken2 = this.EatToken(); 4443? this.EatToken() 4634var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4660var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 5014this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 5015this.EatToken())); 5062modifiers.Add(this.EatToken()); 5108modifiers.Add(this.EatToken()); 5126var eventToken = this.EatToken(); 5229var semi = this.EatToken(); 5585this.EatToken(); 5644var equals = this.EatToken(); 5648? this.EatToken() 6118SyntaxToken identifierToken = this.EatToken(); 6231this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6424var start = this.EatToken(); 6426this.EatToken(); 6427greaterThanToken = this.EatToken(); 6439this.EatToken(); 6450greaterThanToken = EatToken(); 6586greaterThanToken = this.EatToken(); 6755? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6785result = AddTrailingSkippedSyntax(result, this.EatToken()); 6849identifierOrThisOpt = this.EatToken(); 6968? this.EatToken() // fine after the first identifier 6982separator = this.EatToken(); 7086? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7102var separator = this.EatToken(); 7242lastTokenOfType = this.EatToken(); 7261this.EatToken(); 7265this.EatToken(); 7312this.EatToken(); 7330lastTokenOfType = this.EatToken(); 7335lastTokenOfType = this.EatToken(); 7363lastTokenOfType = this.EatToken(); 7384lastTokenOfType = this.EatToken(); 7398this.EatToken(); 7401this.EatToken(); 7410lastTokenOfType = this.EatToken(); 7434lastTokenOfType = this.EatToken(); 7441lastTokenOfType = this.EatToken(); 7446lastTokenOfType = this.EatToken(); 7452lastTokenOfType = this.EatToken(); 7459lastTokenOfType = this.EatToken(); 7488lastTokenOfType = EatToken(); 7515lastTokenOfType = EatToken(); 7537var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7605return _syntaxFactory.PredefinedType(this.EatToken()); 7630this.EatToken(), 7631this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7755var questionToken = this.EatToken(); 7935list.AddSeparator(this.EatToken()); 8033var token = this.EatToken(); 8237type = _syntaxFactory.PointerType(type, this.EatToken()); 8406return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8727EatToken(); 8737EatToken(); 8792this.EatToken(); 8798this.EatToken(); 8946this.EatToken(); 8950this.EatToken(); 9041EatToken(); 9430this.EatToken(), 9469var @catch = this.EatToken(); 9476var openParen = this.EatToken(); 9505whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9557var keyword = this.EatToken(); 9609this.EatToken(); 9610if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9612this.EatToken().Kind == SyntaxKind.IdentifierToken && 9613this.EatToken().Kind == SyntaxKind.InKeyword) 9685this.EatToken(); 9786var skippedForToken = this.EatToken(); 9888this.EatToken(); 10000caseOrDefault = this.EatToken(); 10168var yieldToken = ConvertToKeyword(this.EatToken()); 10176returnOrBreak = this.EatToken(); 10290var caseKeyword = this.EatToken(); 10530usingKeyword = EatToken(); 10535usingKeyword = EatToken(); 10859mod = this.EatToken(); 10885this.EatToken(); 11510this.EatToken(), 11544this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11684var questionToken = this.EatToken(); 11844var token1 = EatToken(); 11845var token2 = EatToken(); 11857var token1 = EatToken(); 11858_ = EatToken(); 11859var token3 = EatToken(); 11885this.EatToken(), 11918var token1 = this.EatToken(); 11919var token2 = this.EatToken(); 11942dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 12065return _syntaxFactory.ThisExpression(this.EatToken()); 12077return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12112var refKeyword = this.EatToken(); 12123var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12187expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12197this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12209expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12227SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12231expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12244expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12257return _syntaxFactory.BaseExpression(this.EatToken()); 12277this.EatToken(); // `var` 12293this.EatToken(); // eat the identifier 12298this.EatToken(); // eat the open paren or comma 12309this.EatToken(); // eat the close paren 12387return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12390return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12412this.EatToken(); 12431expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12473=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12632refKindKeyword = this.EatToken(); 12664this.EatToken(), 12672var keyword = this.EatToken(); 12690this.EatToken(), 12699this.EatToken(), 12708this.EatToken(), 12716var checkedOrUnchecked = this.EatToken(); 12804this.EatToken(); 12822var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12899_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12923_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12953this.EatToken(); 12966this.EatToken(); 13057EatToken(); 13063EatToken(); 13120EatToken(); 13126EatToken(); 13127EatToken(); 13169EatToken(); 13465this.EatToken(); // open paren 13669commas.Add(this.EatToken()); 13736var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14160this.EatToken(); 14239name = this.EatToken(); 14272? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14350direction = ConvertToKeyword(this.EatToken()); 14679b.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());