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. 1657this.EatToken(); // partial 1728keyword = ConvertToKeyword(this.EatToken()); 1854keyword = ConvertToKeyword(this.EatToken()); 1856? EatToken() 1867var misplacedToken = this.EatToken(); 1871this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 1991var token = this.EatToken(); 2035tokens.Add(this.EatToken()); 2241newKeyword: this.EatToken(), 2248classOrStructKeyword: this.EatToken(), 2250? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2256classOrStructKeyword: this.EatToken(), 2260_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2265this.EatToken())), 2274this.EatToken())), 2590var identifier = this.EatToken(); 2908EatToken(); 3337token = this.EatToken(); 3591EatToken(); 3635? this.EatToken() 3648style = this.EatToken(); 3781var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3832opToken = this.EatToken(); 3843opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3864opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3877var opToken2 = this.EatToken(); 3883opToken2 = this.EatToken(); 4161? this.EatToken() 4352var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 4378var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4714this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4715this.EatToken())); 4763modifiers.Add(this.EatToken()); 4777modifiers.Add(this.EatToken()); 4790modifiers.Add(this.EatToken()); 4808var eventToken = this.EatToken(); 4911var semi = this.EatToken(); 5264this.EatToken(); 5324var equals = this.EatToken(); 5328? this.EatToken() 5737SyntaxToken identifierToken = this.EatToken(); 5852this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6045var start = this.EatToken(); 6047this.EatToken(); 6048greaterThanToken = this.EatToken(); 6060this.EatToken(); 6071greaterThanToken = EatToken(); 6207greaterThanToken = this.EatToken(); 6376? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6406result = AddTrailingSkippedSyntax(result, this.EatToken()); 6470identifierOrThisOpt = this.EatToken(); 6589? this.EatToken() // fine after the first identifier 6603separator = this.EatToken(); 6707? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6723var separator = this.EatToken(); 6863lastTokenOfType = this.EatToken(); 6882this.EatToken(); 6886this.EatToken(); 6933this.EatToken(); 6951lastTokenOfType = this.EatToken(); 6956lastTokenOfType = this.EatToken(); 6984lastTokenOfType = this.EatToken(); 7005lastTokenOfType = this.EatToken(); 7019this.EatToken(); 7022this.EatToken(); 7031lastTokenOfType = this.EatToken(); 7055lastTokenOfType = this.EatToken(); 7062lastTokenOfType = this.EatToken(); 7067lastTokenOfType = this.EatToken(); 7073lastTokenOfType = this.EatToken(); 7080lastTokenOfType = this.EatToken(); 7109lastTokenOfType = EatToken(); 7136lastTokenOfType = EatToken(); 7158var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7226return _syntaxFactory.PredefinedType(this.EatToken()); 7251this.EatToken(), 7252this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7376var questionToken = this.EatToken(); 7556list.AddSeparator(this.EatToken()); 7658var token = this.EatToken(); 7862type = _syntaxFactory.PointerType(type, this.EatToken()); 8031return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8348EatToken(); 8358EatToken(); 8413this.EatToken(); 8419this.EatToken(); 8606EatToken(); 8977this.EatToken(), 9016var @catch = this.EatToken(); 9023var openParen = this.EatToken(); 9052whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9104var keyword = this.EatToken(); 9156this.EatToken(); 9157if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9159this.EatToken().Kind == SyntaxKind.IdentifierToken && 9160this.EatToken().Kind == SyntaxKind.InKeyword) 9232this.EatToken(); 9333var skippedForToken = this.EatToken(); 9435this.EatToken(); 9547caseOrDefault = this.EatToken(); 9682var yieldToken = ConvertToKeyword(this.EatToken()); 9690returnOrBreak = this.EatToken(); 9804var caseKeyword = this.EatToken(); 10044usingKeyword = EatToken(); 10049usingKeyword = EatToken(); 10371mod = this.EatToken(); 10399this.EatToken(); 11025this.EatToken(), 11059this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11190this.EatToken(), 11280var token1 = EatToken(); 11281var token2 = EatToken(); 11293var token1 = EatToken(); 11294_ = EatToken(); 11295var token3 = EatToken(); 11318var questionToken = this.EatToken(); 11418var token1 = this.EatToken(); 11419var token2 = this.EatToken(); 11442dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11565return _syntaxFactory.ThisExpression(this.EatToken()); 11581return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11611var refKeyword = this.EatToken(); 11622var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11671expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11681this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11693expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11711SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11715expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11723this.EatToken(), 11731expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11744return _syntaxFactory.BaseExpression(this.EatToken()); 11764this.EatToken(); // `var` 11780this.EatToken(); // eat the identifier 11785this.EatToken(); // eat the open paren or comma 11796this.EatToken(); // eat the close paren 11844this.EatToken(); 11861SyntaxKind.DotToken => _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 11873expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 11887expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11895operatorToken: this.EatToken(), 12069refKindKeyword = this.EatToken(); 12101this.EatToken(), 12109var keyword = this.EatToken(); 12127this.EatToken(), 12136this.EatToken(), 12145this.EatToken(), 12153var checkedOrUnchecked = this.EatToken(); 12241this.EatToken(); 12259var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12336_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12360_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12388this.EatToken(); 12401this.EatToken(); 12480EatToken(); 12486EatToken(); 12543EatToken(); 12549EatToken(); 12550EatToken(); 12592EatToken(); 12870this.EatToken(); // open paren 13072commas.Add(this.EatToken()); 13139var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13583this.EatToken(); 13666name = this.EatToken(); 13699? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13774direction = ConvertToKeyword(this.EatToken()); 14098b.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());