260 references to EatToken
Microsoft.CodeAnalysis.CSharp (260)
Parser\DirectiveParser.cs (22)
370line = this.EatToken(); 390file = this.EatToken(); 537SyntaxKind.EnableKeyword => EatToken(), 538SyntaxKind.DisableKeyword => EatToken(), 539SyntaxKind.RestoreKeyword => EatToken(), 545SyntaxKind.WarningsKeyword => EatToken(), 546SyntaxKind.AnnotationsKeyword => EatToken(), 570style = this.EatToken(); 587id = this.EatToken(); 599id = this.EatToken(); 616ids.AddSeparator(this.EatToken()); 631var checksum = this.EatToken(); 709skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 715skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 721? this.EatToken() 743var op = this.EatToken(); 756var op = this.EatToken(); 769var op = this.EatToken(); 781var op = this.EatToken(); 794var open = this.EatToken(); 799var identifier = TruncateIdentifier(this.EatToken()); 803return SyntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(k), this.EatToken());
Parser\DocumentationCommentParser.cs (35)
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()); 972SyntaxToken thisKeyword = EatToken(); 984SyntaxToken operatorKeyword = EatToken(); 991operatorToken = EatToken(); 1004operatorToken = AddTrailingSkippedSyntax(operatorToken, EatToken()); 1019var operatorToken2 = this.EatToken(); 1024var operatorToken3 = this.EatToken(); 1071var operatorToken2 = this.EatToken(); 1081var operatorToken2 = this.EatToken(); 1127var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_MisplacedUnchecked); 1143SyntaxToken implicitOrExplicit = EatToken(); 1256refKindOpt = EatToken(); 1266var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_RefReadOnlyWrongOrdering); 1271readOnlyOpt = EatToken(); 1293var open = EatToken(); 1379return SyntaxFactory.PredefinedType(EatToken()); 1384SyntaxToken alias = EatToken(); 1392SyntaxToken colonColon = EatToken(); 1418SyntaxToken dot = EatToken(); 1446type = SyntaxFactory.NullableType(type, EatToken()); 1451type = SyntaxFactory.PointerType(type, EatToken()); 1462SyntaxToken open = EatToken(); 1472dimensionList.AddSeparator(this.EatToken()); 1570badTokens.Add(this.EatToken());
Parser\LanguageParser.cs (185)
615var token = this.EatToken(); 730var skippedToken = EatToken(); 957? ConvertToKeyword(this.EatToken()) 971unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1011type = AddTrailingSkippedSyntax(type, this.EatToken()); 1047EatToken(); 1126? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1385modTok = ConvertToKeyword(this.EatToken()); 1390modTok = ConvertToKeyword(this.EatToken()); 1397modTok = ConvertToKeyword(this.EatToken()); 1417modTok = this.EatToken(); 1422modTok = this.EatToken(); 1438modTok = ConvertToKeyword(EatToken()); 1447modTok = ConvertToKeyword(this.EatToken()); 1460modTok = ConvertToKeyword(this.EatToken()); 1465modTok = this.EatToken(); 1511this.EatToken(); //move past contextual token 1516this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1658this.EatToken(); // partial 1729keyword = ConvertToKeyword(this.EatToken()); 1855keyword = ConvertToKeyword(this.EatToken()); 1857? EatToken() 1868var misplacedToken = this.EatToken(); 1872this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 1992var token = this.EatToken(); 2036tokens.Add(this.EatToken()); 2242newKeyword: this.EatToken(), 2249classOrStructKeyword: this.EatToken(), 2251? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2257classOrStructKeyword: this.EatToken(), 2261_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2266this.EatToken())), 2275this.EatToken())), 2591var identifier = this.EatToken(); 2909EatToken(); 3338token = this.EatToken(); 3592EatToken(); 3636? this.EatToken() 3649style = this.EatToken(); 3782var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3833opToken = this.EatToken(); 3844opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3865opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3878var opToken2 = this.EatToken(); 3884opToken2 = this.EatToken(); 4162? this.EatToken() 4353var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 4379var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4715this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4716this.EatToken())); 4764modifiers.Add(this.EatToken()); 4778modifiers.Add(this.EatToken()); 4791modifiers.Add(this.EatToken()); 4809var eventToken = this.EatToken(); 4912var semi = this.EatToken(); 5266this.EatToken(); 5326var equals = this.EatToken(); 5330? this.EatToken() 5739SyntaxToken identifierToken = this.EatToken(); 5854this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6047var start = this.EatToken(); 6049this.EatToken(); 6050greaterThanToken = this.EatToken(); 6062this.EatToken(); 6073greaterThanToken = EatToken(); 6209greaterThanToken = this.EatToken(); 6378? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6408result = AddTrailingSkippedSyntax(result, this.EatToken()); 6472identifierOrThisOpt = this.EatToken(); 6591? this.EatToken() // fine after the first identifier 6605separator = this.EatToken(); 6709? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6725var separator = this.EatToken(); 6865lastTokenOfType = this.EatToken(); 6884this.EatToken(); 6888this.EatToken(); 6935this.EatToken(); 6953lastTokenOfType = this.EatToken(); 6958lastTokenOfType = this.EatToken(); 6986lastTokenOfType = this.EatToken(); 7007lastTokenOfType = this.EatToken(); 7021this.EatToken(); 7024this.EatToken(); 7033lastTokenOfType = this.EatToken(); 7057lastTokenOfType = this.EatToken(); 7064lastTokenOfType = this.EatToken(); 7069lastTokenOfType = this.EatToken(); 7075lastTokenOfType = this.EatToken(); 7082lastTokenOfType = this.EatToken(); 7111lastTokenOfType = EatToken(); 7138lastTokenOfType = EatToken(); 7160var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7228return _syntaxFactory.PredefinedType(this.EatToken()); 7253this.EatToken(), 7254this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7378var questionToken = this.EatToken(); 7558list.AddSeparator(this.EatToken()); 7660var token = this.EatToken(); 7864type = _syntaxFactory.PointerType(type, this.EatToken()); 8033return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8350EatToken(); 8360EatToken(); 8415this.EatToken(); 8421this.EatToken(); 8608EatToken(); 8979this.EatToken(), 9018var @catch = this.EatToken(); 9025var openParen = this.EatToken(); 9054whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9106var keyword = this.EatToken(); 9158this.EatToken(); 9159if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9161this.EatToken().Kind == SyntaxKind.IdentifierToken && 9162this.EatToken().Kind == SyntaxKind.InKeyword) 9234this.EatToken(); 9335var skippedForToken = this.EatToken(); 9437this.EatToken(); 9549caseOrDefault = this.EatToken(); 9684var yieldToken = ConvertToKeyword(this.EatToken()); 9692returnOrBreak = this.EatToken(); 9806var caseKeyword = this.EatToken(); 10046usingKeyword = EatToken(); 10051usingKeyword = EatToken(); 10373mod = this.EatToken(); 10401this.EatToken(); 11027this.EatToken(), 11061this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11192this.EatToken(), 11282var token1 = EatToken(); 11283var token2 = EatToken(); 11295var token1 = EatToken(); 11296_ = EatToken(); 11297var token3 = EatToken(); 11320var questionToken = this.EatToken(); 11420var token1 = this.EatToken(); 11421var token2 = this.EatToken(); 11444dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11567return _syntaxFactory.ThisExpression(this.EatToken()); 11583return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11613var refKeyword = this.EatToken(); 11624var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11673expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11683this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11695expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11713SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11717expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11725this.EatToken(), 11733expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11746return _syntaxFactory.BaseExpression(this.EatToken()); 11766this.EatToken(); // `var` 11782this.EatToken(); // eat the identifier 11787this.EatToken(); // eat the open paren or comma 11798this.EatToken(); // eat the close paren 11846this.EatToken(); 11863SyntaxKind.DotToken => _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 11875expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 11889expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11897operatorToken: this.EatToken(), 12071refKindKeyword = this.EatToken(); 12103this.EatToken(), 12111var keyword = this.EatToken(); 12129this.EatToken(), 12138this.EatToken(), 12147this.EatToken(), 12155var checkedOrUnchecked = this.EatToken(); 12243this.EatToken(); 12261var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12338_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12362_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12390this.EatToken(); 12403this.EatToken(); 12482EatToken(); 12488EatToken(); 12545EatToken(); 12551EatToken(); 12552EatToken(); 12594EatToken(); 12872this.EatToken(); // open paren 13074commas.Add(this.EatToken()); 13141var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13585this.EatToken(); 13668name = this.EatToken(); 13701? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13776direction = ConvertToKeyword(this.EatToken()); 14100b.Add(this.EatToken());
Parser\LanguageParser_InterpolatedString.cs (1)
41var 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()); 591return this.EatToken(); 604return this.EatToken(); 623var token = this.EatToken(); 638return ConvertToKeyword(this.EatToken()); 653return ConvertToKeyword(this.EatToken());