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)
616var token = this.EatToken(); 731var skippedToken = EatToken(); 958? ConvertToKeyword(this.EatToken()) 972unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1012type = AddTrailingSkippedSyntax(type, this.EatToken()); 1048EatToken(); 1127? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1386modTok = ConvertToKeyword(this.EatToken()); 1391modTok = ConvertToKeyword(this.EatToken()); 1398modTok = ConvertToKeyword(this.EatToken()); 1418modTok = this.EatToken(); 1423modTok = this.EatToken(); 1439modTok = ConvertToKeyword(EatToken()); 1448modTok = ConvertToKeyword(this.EatToken()); 1461modTok = ConvertToKeyword(this.EatToken()); 1466modTok = this.EatToken(); 1512this.EatToken(); //move past contextual token 1517this.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())); 4761modifiers.Add(this.EatToken()); 4775modifiers.Add(this.EatToken()); 4788modifiers.Add(this.EatToken()); 4806var eventToken = this.EatToken(); 4909var semi = this.EatToken(); 5262this.EatToken(); 5322var equals = this.EatToken(); 5326? this.EatToken() 5735SyntaxToken identifierToken = this.EatToken(); 5850this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6043var start = this.EatToken(); 6045this.EatToken(); 6046greaterThanToken = this.EatToken(); 6058this.EatToken(); 6069greaterThanToken = EatToken(); 6205greaterThanToken = this.EatToken(); 6374? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6404result = AddTrailingSkippedSyntax(result, this.EatToken()); 6468identifierOrThisOpt = this.EatToken(); 6587? this.EatToken() // fine after the first identifier 6601separator = this.EatToken(); 6705? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6721var separator = this.EatToken(); 6861lastTokenOfType = this.EatToken(); 6880this.EatToken(); 6884this.EatToken(); 6931this.EatToken(); 6949lastTokenOfType = this.EatToken(); 6954lastTokenOfType = this.EatToken(); 6982lastTokenOfType = this.EatToken(); 7003lastTokenOfType = this.EatToken(); 7017this.EatToken(); 7020this.EatToken(); 7029lastTokenOfType = this.EatToken(); 7053lastTokenOfType = this.EatToken(); 7060lastTokenOfType = this.EatToken(); 7065lastTokenOfType = this.EatToken(); 7071lastTokenOfType = this.EatToken(); 7078lastTokenOfType = this.EatToken(); 7107lastTokenOfType = EatToken(); 7134lastTokenOfType = EatToken(); 7156var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7224return _syntaxFactory.PredefinedType(this.EatToken()); 7249this.EatToken(), 7250this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7374var questionToken = this.EatToken(); 7554list.AddSeparator(this.EatToken()); 7656var token = this.EatToken(); 7860type = _syntaxFactory.PointerType(type, this.EatToken()); 8029return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8346EatToken(); 8356EatToken(); 8411this.EatToken(); 8417this.EatToken(); 8604EatToken(); 8975this.EatToken(), 9014var @catch = this.EatToken(); 9021var openParen = this.EatToken(); 9050whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9102var keyword = this.EatToken(); 9154this.EatToken(); 9155if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9157this.EatToken().Kind == SyntaxKind.IdentifierToken && 9158this.EatToken().Kind == SyntaxKind.InKeyword) 9230this.EatToken(); 9331var skippedForToken = this.EatToken(); 9433this.EatToken(); 9545caseOrDefault = this.EatToken(); 9680var yieldToken = ConvertToKeyword(this.EatToken()); 9688returnOrBreak = this.EatToken(); 9802var caseKeyword = this.EatToken(); 10042usingKeyword = EatToken(); 10047usingKeyword = EatToken(); 10342mod = this.EatToken(); 10370this.EatToken(); 10996this.EatToken(), 11030this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11161this.EatToken(), 11251var token1 = EatToken(); 11252var token2 = EatToken(); 11264var token1 = EatToken(); 11265_ = EatToken(); 11266var token3 = EatToken(); 11289var questionToken = this.EatToken(); 11389var token1 = this.EatToken(); 11390var token2 = this.EatToken(); 11413dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11536return _syntaxFactory.ThisExpression(this.EatToken()); 11552return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11582var refKeyword = this.EatToken(); 11593var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11642expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11652this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11664expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11682SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11686expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11694this.EatToken(), 11702expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11715return _syntaxFactory.BaseExpression(this.EatToken()); 11735this.EatToken(); // `var` 11751this.EatToken(); // eat the identifier 11756this.EatToken(); // eat the open paren or comma 11767this.EatToken(); // eat the close paren 11815this.EatToken(); 11832SyntaxKind.DotToken => _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 11844expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 11858expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11866operatorToken: this.EatToken(), 12040refKindKeyword = this.EatToken(); 12072this.EatToken(), 12080var keyword = this.EatToken(); 12098this.EatToken(), 12107this.EatToken(), 12116this.EatToken(), 12124var checkedOrUnchecked = this.EatToken(); 12261this.EatToken(); 12283var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12360_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12384_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12412this.EatToken(); 12425this.EatToken(); 12504EatToken(); 12510EatToken(); 12567EatToken(); 12573EatToken(); 12574EatToken(); 12616EatToken(); 12894this.EatToken(); // open paren 13096commas.Add(this.EatToken()); 13163var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13607this.EatToken(); 13690name = this.EatToken(); 13723? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13798direction = ConvertToKeyword(this.EatToken()); 14122b.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());