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())), 2717var identifier = this.EatToken(); 3031EatToken(); 3569? this.EatToken() 3819EatToken(); 3863? this.EatToken() 3876style = this.EatToken(); 4009var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4060opToken = this.EatToken(); 4071opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 4092opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4108var opToken2 = this.EatToken(); 4114opToken2 = this.EatToken(); 4121opToken2 = this.EatToken(); 4135var opToken2 = this.EatToken(); 4448? this.EatToken() 4639var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4665var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 5019this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 5020this.EatToken())); 5067modifiers.Add(this.EatToken()); 5113modifiers.Add(this.EatToken()); 5131var eventToken = this.EatToken(); 5234var semi = this.EatToken(); 5590this.EatToken(); 5649var equals = this.EatToken(); 5653? this.EatToken() 6123SyntaxToken identifierToken = this.EatToken(); 6236this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6429var start = this.EatToken(); 6431this.EatToken(); 6432greaterThanToken = this.EatToken(); 6444this.EatToken(); 6455greaterThanToken = EatToken(); 6591greaterThanToken = this.EatToken(); 6760? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6790result = AddTrailingSkippedSyntax(result, this.EatToken()); 6854identifierOrThisOpt = this.EatToken(); 6973? this.EatToken() // fine after the first identifier 6987separator = this.EatToken(); 7091? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7107var separator = this.EatToken(); 7247lastTokenOfType = this.EatToken(); 7266this.EatToken(); 7270this.EatToken(); 7317this.EatToken(); 7335lastTokenOfType = this.EatToken(); 7340lastTokenOfType = this.EatToken(); 7368lastTokenOfType = this.EatToken(); 7389lastTokenOfType = this.EatToken(); 7403this.EatToken(); 7406this.EatToken(); 7415lastTokenOfType = this.EatToken(); 7439lastTokenOfType = this.EatToken(); 7446lastTokenOfType = this.EatToken(); 7451lastTokenOfType = this.EatToken(); 7457lastTokenOfType = this.EatToken(); 7464lastTokenOfType = this.EatToken(); 7493lastTokenOfType = EatToken(); 7520lastTokenOfType = EatToken(); 7542var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7610return _syntaxFactory.PredefinedType(this.EatToken()); 7635this.EatToken(), 7636this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7760var questionToken = this.EatToken(); 7940list.AddSeparator(this.EatToken()); 8038var token = this.EatToken(); 8242type = _syntaxFactory.PointerType(type, this.EatToken()); 8411return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8748EatToken(); 8758EatToken(); 8813this.EatToken(); 8819this.EatToken(); 8967this.EatToken(); 8971this.EatToken(); 9062EatToken(); 9451this.EatToken(), 9490var @catch = this.EatToken(); 9497var openParen = this.EatToken(); 9526whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9578var keyword = this.EatToken(); 9630this.EatToken(); 9631if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9633this.EatToken().Kind == SyntaxKind.IdentifierToken && 9634this.EatToken().Kind == SyntaxKind.InKeyword) 9706this.EatToken(); 9807var skippedForToken = this.EatToken(); 9909this.EatToken(); 10021caseOrDefault = this.EatToken(); 10189var yieldToken = ConvertToKeyword(this.EatToken()); 10197returnOrBreak = this.EatToken(); 10311var caseKeyword = this.EatToken(); 10551usingKeyword = EatToken(); 10556usingKeyword = EatToken(); 10880mod = this.EatToken(); 10906this.EatToken(); 11533this.EatToken(), 11567this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11707var questionToken = this.EatToken(); 11867var token1 = EatToken(); 11868var token2 = EatToken(); 11880var token1 = EatToken(); 11881_ = EatToken(); 11882var token3 = EatToken(); 11908this.EatToken(), 11941var token1 = this.EatToken(); 11942var token2 = this.EatToken(); 11965dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 12090return _syntaxFactory.ThisExpression(this.EatToken()); 12102return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12137var refKeyword = this.EatToken(); 12148var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12212expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12222this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12234expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12252SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12256expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12269expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12282return _syntaxFactory.BaseExpression(this.EatToken()); 12302this.EatToken(); // `var` 12318this.EatToken(); // eat the identifier 12323this.EatToken(); // eat the open paren or comma 12334this.EatToken(); // eat the close paren 12412return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12415return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12437this.EatToken(); 12456expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12498=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12657refKindKeyword = this.EatToken(); 12689this.EatToken(), 12697var keyword = this.EatToken(); 12715this.EatToken(), 12724this.EatToken(), 12733this.EatToken(), 12741var checkedOrUnchecked = this.EatToken(); 12838this.EatToken(); 12856var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12933_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12957_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12987this.EatToken(); 13000this.EatToken(); 13091EatToken(); 13097EatToken(); 13154EatToken(); 13160EatToken(); 13161EatToken(); 13203EatToken(); 13499this.EatToken(); // open paren 13703commas.Add(this.EatToken()); 13770var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14194this.EatToken(); 14273name = this.EatToken(); 14306? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14384direction = ConvertToKeyword(this.EatToken()); 14713b.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());