264 references to EatToken
Microsoft.CodeAnalysis.CSharp (264)
Parser\DirectiveParser.cs (22)
380line = this.EatToken(); 400file = this.EatToken(); 547SyntaxKind.EnableKeyword => EatToken(), 548SyntaxKind.DisableKeyword => EatToken(), 549SyntaxKind.RestoreKeyword => EatToken(), 555SyntaxKind.WarningsKeyword => EatToken(), 556SyntaxKind.AnnotationsKeyword => EatToken(), 580style = this.EatToken(); 597id = this.EatToken(); 609id = this.EatToken(); 626ids.AddSeparator(this.EatToken()); 641var checksum = this.EatToken(); 742skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 748skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 754? this.EatToken() 776var op = this.EatToken(); 789var op = this.EatToken(); 802var op = this.EatToken(); 814var op = this.EatToken(); 827var open = this.EatToken(); 832var identifier = TruncateIdentifier(this.EatToken()); 836return SyntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(k), this.EatToken());
Parser\DocumentationCommentParser.cs (36)
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(); 1060var operatorToken2 = this.EatToken(); 1070var operatorToken2 = this.EatToken(); 1129var operatorToken2 = this.EatToken(); 1160var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_MisplacedUnchecked); 1176SyntaxToken implicitOrExplicit = EatToken(); 1289refKindOpt = EatToken(); 1299var misplacedToken = AddErrorAsWarning(EatToken(), ErrorCode.ERR_RefReadOnlyWrongOrdering); 1304readOnlyOpt = EatToken(); 1326var open = EatToken(); 1412return SyntaxFactory.PredefinedType(EatToken()); 1417SyntaxToken alias = EatToken(); 1425SyntaxToken colonColon = EatToken(); 1451SyntaxToken dot = EatToken(); 1479type = SyntaxFactory.NullableType(type, EatToken()); 1484type = SyntaxFactory.PointerType(type, EatToken()); 1495SyntaxToken open = EatToken(); 1505dimensionList.AddSeparator(this.EatToken()); 1603badTokens.Add(this.EatToken());
Parser\LanguageParser.cs (188)
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()); 1745keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1870keyword = ConvertToKeyword(this.EatToken()); 1872? EatToken() 1883var misplacedToken = this.EatToken(); 1887this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2026var token = this.EatToken(); 2070tokens.Add(this.EatToken()); 2276newKeyword: this.EatToken(), 2283classOrStructKeyword: this.EatToken(), 2285? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2291classOrStructKeyword: this.EatToken(), 2295_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2300this.EatToken())), 2309this.EatToken())), 2631var identifier = this.EatToken(); 2949EatToken(); 3388token = this.EatToken(); 3642EatToken(); 3686? this.EatToken() 3699style = this.EatToken(); 3832var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3883opToken = this.EatToken(); 3894opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3915opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3931var opToken2 = this.EatToken(); 3937opToken2 = this.EatToken(); 3944opToken2 = this.EatToken(); 3958var opToken2 = this.EatToken(); 4242? this.EatToken() 4433var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 4459var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4812this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4813this.EatToken())); 4861modifiers.Add(this.EatToken()); 4875modifiers.Add(this.EatToken()); 4888modifiers.Add(this.EatToken()); 4906var eventToken = this.EatToken(); 5009var semi = this.EatToken(); 5363this.EatToken(); 5423var equals = this.EatToken(); 5427? this.EatToken() 5836SyntaxToken identifierToken = this.EatToken(); 5951this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6144var start = this.EatToken(); 6146this.EatToken(); 6147greaterThanToken = this.EatToken(); 6159this.EatToken(); 6170greaterThanToken = EatToken(); 6306greaterThanToken = this.EatToken(); 6475? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6505result = AddTrailingSkippedSyntax(result, this.EatToken()); 6569identifierOrThisOpt = this.EatToken(); 6688? this.EatToken() // fine after the first identifier 6702separator = this.EatToken(); 6806? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6822var separator = this.EatToken(); 6962lastTokenOfType = this.EatToken(); 6981this.EatToken(); 6985this.EatToken(); 7032this.EatToken(); 7050lastTokenOfType = this.EatToken(); 7055lastTokenOfType = this.EatToken(); 7083lastTokenOfType = this.EatToken(); 7104lastTokenOfType = this.EatToken(); 7118this.EatToken(); 7121this.EatToken(); 7130lastTokenOfType = this.EatToken(); 7154lastTokenOfType = this.EatToken(); 7161lastTokenOfType = this.EatToken(); 7166lastTokenOfType = this.EatToken(); 7172lastTokenOfType = this.EatToken(); 7179lastTokenOfType = this.EatToken(); 7208lastTokenOfType = EatToken(); 7235lastTokenOfType = EatToken(); 7257var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7325return _syntaxFactory.PredefinedType(this.EatToken()); 7350this.EatToken(), 7351this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7475var questionToken = this.EatToken(); 7655list.AddSeparator(this.EatToken()); 7757var token = this.EatToken(); 7961type = _syntaxFactory.PointerType(type, this.EatToken()); 8130return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8447EatToken(); 8457EatToken(); 8512this.EatToken(); 8518this.EatToken(); 8705EatToken(); 9076this.EatToken(), 9115var @catch = this.EatToken(); 9122var openParen = this.EatToken(); 9151whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9203var keyword = this.EatToken(); 9255this.EatToken(); 9256if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9258this.EatToken().Kind == SyntaxKind.IdentifierToken && 9259this.EatToken().Kind == SyntaxKind.InKeyword) 9331this.EatToken(); 9432var skippedForToken = this.EatToken(); 9534this.EatToken(); 9646caseOrDefault = this.EatToken(); 9781var yieldToken = ConvertToKeyword(this.EatToken()); 9789returnOrBreak = this.EatToken(); 9903var caseKeyword = this.EatToken(); 10143usingKeyword = EatToken(); 10148usingKeyword = EatToken(); 10470mod = this.EatToken(); 10498this.EatToken(); 11124this.EatToken(), 11158this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11298var questionToken = this.EatToken(); 11455var token1 = EatToken(); 11456var token2 = EatToken(); 11468var token1 = EatToken(); 11469_ = EatToken(); 11470var token3 = EatToken(); 11496this.EatToken(), 11529var token1 = this.EatToken(); 11530var token2 = this.EatToken(); 11553dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11676return _syntaxFactory.ThisExpression(this.EatToken()); 11692return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11722var refKeyword = this.EatToken(); 11733var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11782expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11792this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11804expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11822SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11826expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11839expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11852return _syntaxFactory.BaseExpression(this.EatToken()); 11872this.EatToken(); // `var` 11888this.EatToken(); // eat the identifier 11893this.EatToken(); // eat the open paren or comma 11904this.EatToken(); // eat the close paren 11982return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 11985return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12007this.EatToken(); 12026expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12068=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12227refKindKeyword = this.EatToken(); 12259this.EatToken(), 12267var keyword = this.EatToken(); 12285this.EatToken(), 12294this.EatToken(), 12303this.EatToken(), 12311var checkedOrUnchecked = this.EatToken(); 12399this.EatToken(); 12417var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12494_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12518_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12546this.EatToken(); 12559this.EatToken(); 12638EatToken(); 12644EatToken(); 12701EatToken(); 12707EatToken(); 12708EatToken(); 12750EatToken(); 13028this.EatToken(); // open paren 13230commas.Add(this.EatToken()); 13297var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13741this.EatToken(); 13824name = this.EatToken(); 13857? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13932direction = ConvertToKeyword(this.EatToken()); 14256b.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());