269 references to EatToken
Microsoft.CodeAnalysis.CSharp (269)
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 (188)
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)) 1396modTok = ConvertToKeyword(this.EatToken()); 1401modTok = ConvertToKeyword(this.EatToken()); 1408modTok = ConvertToKeyword(this.EatToken()); 1428modTok = this.EatToken(); 1433modTok = this.EatToken(); 1460modTok = ConvertToKeyword(this.EatToken()); 1470modTok = this.EatToken(); 1491modTok = ConvertToKeyword(EatToken()); 1545this.EatToken(); //move past contextual token 1550this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1704this.EatToken(); // partial 1775keyword = ConvertToKeyword(this.EatToken()); 1792keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1911keyword = ConvertToKeyword(this.EatToken()); 1913? EatToken() 1924var misplacedToken = this.EatToken(); 1928this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2069var token = this.EatToken(); 2113tokens.Add(this.EatToken()); 2319newKeyword: this.EatToken(), 2326classOrStructKeyword: this.EatToken(), 2328? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2334classOrStructKeyword: this.EatToken(), 2338_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2343this.EatToken())), 2352this.EatToken())), 2679var identifier = this.EatToken(); 2993EatToken(); 3531? this.EatToken() 3781EatToken(); 3825? this.EatToken() 3838style = this.EatToken(); 3971var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4022opToken = this.EatToken(); 4033opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 4054opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 4070var opToken2 = this.EatToken(); 4076opToken2 = this.EatToken(); 4083opToken2 = this.EatToken(); 4097var opToken2 = this.EatToken(); 4410? this.EatToken() 4601var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4627var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4981this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4982this.EatToken())); 5029modifiers.Add(this.EatToken()); 5075modifiers.Add(this.EatToken()); 5093var eventToken = this.EatToken(); 5196var semi = this.EatToken(); 5552this.EatToken(); 5611var equals = this.EatToken(); 5615? this.EatToken() 6085SyntaxToken identifierToken = this.EatToken(); 6198this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6391var start = this.EatToken(); 6393this.EatToken(); 6394greaterThanToken = this.EatToken(); 6406this.EatToken(); 6417greaterThanToken = EatToken(); 6553greaterThanToken = this.EatToken(); 6722? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6752result = AddTrailingSkippedSyntax(result, this.EatToken()); 6816identifierOrThisOpt = this.EatToken(); 6935? this.EatToken() // fine after the first identifier 6949separator = this.EatToken(); 7053? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 7069var separator = this.EatToken(); 7209lastTokenOfType = this.EatToken(); 7228this.EatToken(); 7232this.EatToken(); 7279this.EatToken(); 7297lastTokenOfType = this.EatToken(); 7302lastTokenOfType = this.EatToken(); 7330lastTokenOfType = this.EatToken(); 7351lastTokenOfType = this.EatToken(); 7365this.EatToken(); 7368this.EatToken(); 7377lastTokenOfType = this.EatToken(); 7401lastTokenOfType = this.EatToken(); 7408lastTokenOfType = this.EatToken(); 7413lastTokenOfType = this.EatToken(); 7419lastTokenOfType = this.EatToken(); 7426lastTokenOfType = this.EatToken(); 7455lastTokenOfType = EatToken(); 7482lastTokenOfType = EatToken(); 7504var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7572return _syntaxFactory.PredefinedType(this.EatToken()); 7597this.EatToken(), 7598this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7722var questionToken = this.EatToken(); 7902list.AddSeparator(this.EatToken()); 8000var token = this.EatToken(); 8204type = _syntaxFactory.PointerType(type, this.EatToken()); 8373return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8694EatToken(); 8704EatToken(); 8759this.EatToken(); 8765this.EatToken(); 8913this.EatToken(); 8917this.EatToken(); 9008EatToken(); 9397this.EatToken(), 9436var @catch = this.EatToken(); 9443var openParen = this.EatToken(); 9472whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9524var keyword = this.EatToken(); 9576this.EatToken(); 9577if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9579this.EatToken().Kind == SyntaxKind.IdentifierToken && 9580this.EatToken().Kind == SyntaxKind.InKeyword) 9652this.EatToken(); 9753var skippedForToken = this.EatToken(); 9855this.EatToken(); 9967caseOrDefault = this.EatToken(); 10135var yieldToken = ConvertToKeyword(this.EatToken()); 10143returnOrBreak = this.EatToken(); 10257var caseKeyword = this.EatToken(); 10497usingKeyword = EatToken(); 10502usingKeyword = EatToken(); 10826mod = this.EatToken(); 10852this.EatToken(); 11473this.EatToken(), 11507this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11647var questionToken = this.EatToken(); 11807var token1 = EatToken(); 11808var token2 = EatToken(); 11820var token1 = EatToken(); 11821_ = EatToken(); 11822var token3 = EatToken(); 11848this.EatToken(), 11881var token1 = this.EatToken(); 11882var token2 = this.EatToken(); 11905dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 12028return _syntaxFactory.ThisExpression(this.EatToken()); 12040return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 12075var refKeyword = this.EatToken(); 12086var expr = _syntaxFactory.PredefinedType(this.EatToken()); 12150expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 12160this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 12172expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12190SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 12194expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 12207expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 12220return _syntaxFactory.BaseExpression(this.EatToken()); 12240this.EatToken(); // `var` 12256this.EatToken(); // eat the identifier 12261this.EatToken(); // eat the open paren or comma 12272this.EatToken(); // eat the close paren 12350return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12353return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12375this.EatToken(); 12394expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12436=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12595refKindKeyword = this.EatToken(); 12627this.EatToken(), 12635var keyword = this.EatToken(); 12653this.EatToken(), 12662this.EatToken(), 12671this.EatToken(), 12679var checkedOrUnchecked = this.EatToken(); 12767this.EatToken(); 12785var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12862_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12886_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12916this.EatToken(); 12929this.EatToken(); 13020EatToken(); 13026EatToken(); 13083EatToken(); 13089EatToken(); 13090EatToken(); 13132EatToken(); 13428this.EatToken(); // open paren 13632commas.Add(this.EatToken()); 13699var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 14123this.EatToken(); 14202name = this.EatToken(); 14235? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 14313direction = ConvertToKeyword(this.EatToken()); 14642b.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());