259 references to EatToken
Microsoft.CodeAnalysis.CSharp (259)
Parser\DirectiveParser.cs (22)
375line = this.EatToken(); 395file = this.EatToken(); 542SyntaxKind.EnableKeyword => EatToken(), 543SyntaxKind.DisableKeyword => EatToken(), 544SyntaxKind.RestoreKeyword => EatToken(), 550SyntaxKind.WarningsKeyword => EatToken(), 551SyntaxKind.AnnotationsKeyword => EatToken(), 575style = this.EatToken(); 592id = this.EatToken(); 604id = this.EatToken(); 621ids.AddSeparator(this.EatToken()); 636var checksum = this.EatToken(); 714skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 720skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 726? this.EatToken() 748var op = this.EatToken(); 761var op = this.EatToken(); 774var op = this.EatToken(); 786var op = this.EatToken(); 799var open = this.EatToken(); 804var identifier = TruncateIdentifier(this.EatToken()); 808return SyntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(k), this.EatToken());
Parser\DocumentationCommentParser.cs (33)
111var token = this.EatToken(); 195textTokens.Add(this.EatToken()); 221var startTag = SyntaxFactory.XmlElementStartTag(lessThan, name, attrs, this.EatToken()); 404var token = this.EatToken(); 542EatToken(); 616var token = this.EatToken(); 671quote = AddTrailingSkippedSyntax(quote, EatToken()); 692var colon = this.EatToken(); 734var token = this.EatToken(); 760textTokens.Add(this.EatToken()); 782var textToken = this.EatToken(); 925badTokens.Add(this.EatToken()); 977SyntaxToken thisKeyword = EatToken(); 989SyntaxToken operatorKeyword = EatToken(); 996operatorToken = EatToken(); 1009operatorToken = AddTrailingSkippedSyntax(operatorToken, EatToken()); 1024var operatorToken2 = this.EatToken(); 1029var operatorToken3 = this.EatToken(); 1076var operatorToken2 = this.EatToken(); 1086var operatorToken2 = this.EatToken(); 1132var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 1148SyntaxToken implicitOrExplicit = EatToken(); 1261refKindOpt = EatToken(); 1283var open = EatToken(); 1369return SyntaxFactory.PredefinedType(EatToken()); 1374SyntaxToken alias = EatToken(); 1382SyntaxToken colonColon = EatToken(); 1408SyntaxToken dot = EatToken(); 1436type = SyntaxFactory.NullableType(type, EatToken()); 1441type = SyntaxFactory.PointerType(type, EatToken()); 1452SyntaxToken open = EatToken(); 1462dimensionList.AddSeparator(this.EatToken()); 1560badTokens.Add(this.EatToken());
Parser\LanguageParser.cs (185)
458var token = this.EatToken(); 563var skippedToken = EatToken(); 790? ConvertToKeyword(this.EatToken()) 836type = AddTrailingSkippedSyntax(type, this.EatToken()); 899? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1112modTok = ConvertToKeyword(this.EatToken()); 1117modTok = ConvertToKeyword(this.EatToken()); 1124modTok = ConvertToKeyword(this.EatToken()); 1144modTok = this.EatToken(); 1149modTok = this.EatToken(); 1165modTok = ConvertToKeyword(EatToken()); 1174modTok = ConvertToKeyword(this.EatToken()); 1187modTok = ConvertToKeyword(this.EatToken()); 1192modTok = this.EatToken(); 1238this.EatToken(); //move past contextual token 1243this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1384this.EatToken(); // partial 1457keyword = ConvertToKeyword(this.EatToken()); 1583keyword = ConvertToKeyword(this.EatToken()); 1585? EatToken() 1596var misplacedToken = this.EatToken(); 1600this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 1720var token = this.EatToken(); 1764tokens.Add(this.EatToken()); 1939newKeyword: this.EatToken(), 1946classOrStructKeyword: this.EatToken(), 1948? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 1954classOrStructKeyword: this.EatToken(), 1958_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 1963this.EatToken())), 1972this.EatToken())), 2257var identifier = this.EatToken(); 2575EatToken(); 3005token = this.EatToken(); 3259EatToken(); 3303? this.EatToken() 3316style = this.EatToken(); 3449var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3471opToken = this.EatToken(); 3482opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3502opToken = EatToken(); 3515var opToken2 = this.EatToken(); 3521opToken2 = this.EatToken(); 3771? this.EatToken() 3962var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.EatToken(); 3988var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4322this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4323this.EatToken())); 4353var exclamationEquals = this.EatToken(); 4367identifier = AddTrailingSkippedSyntax(identifier, this.AddError(this.EatToken(), ErrorCode.ERR_ParameterNullCheckingNotSupported)); 4370identifier = AddTrailingSkippedSyntax(identifier, this.EatToken()); 4375var exclamationEquals = this.EatToken(); 4446modifiers.Add(this.EatToken()); 4460modifiers.Add(this.EatToken()); 4473modifiers.Add(this.EatToken()); 4502var eventToken = this.EatToken(); 4605var semi = this.EatToken(); 4941this.EatToken(); 5001var equals = this.EatToken(); 5005? this.EatToken() 5415SyntaxToken identifierToken = this.EatToken(); 5523this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 5716var start = this.EatToken(); 5718this.EatToken(); 5719greaterThanToken = this.EatToken(); 5730this.EatToken(); 5741greaterThanToken = EatToken(); 5840greaterThanToken = this.EatToken(); 5933? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 5963result = AddTrailingSkippedSyntax(result, this.EatToken()); 6027identifierOrThisOpt = this.EatToken(); 6148separator = this.EatToken(); 6154? this.EatToken() // fine after the first identifier 6169separator = this.EatToken(); 6176separator = this.EatToken(); 6279? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6295var separator = this.EatToken(); 6453lastTokenOfType = this.EatToken(); 6472this.EatToken(); 6476this.EatToken(); 6523this.EatToken(); 6541lastTokenOfType = this.EatToken(); 6546lastTokenOfType = this.EatToken(); 6574lastTokenOfType = this.EatToken(); 6596lastTokenOfType = this.EatToken(); 6610this.EatToken(); 6613this.EatToken(); 6622lastTokenOfType = this.EatToken(); 6646lastTokenOfType = this.EatToken(); 6653lastTokenOfType = this.EatToken(); 6658lastTokenOfType = this.EatToken(); 6664lastTokenOfType = this.EatToken(); 6671lastTokenOfType = this.EatToken(); 6700lastTokenOfType = EatToken(); 6727lastTokenOfType = EatToken(); 6749var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 6817return _syntaxFactory.PredefinedType(this.EatToken()); 6842this.EatToken(), 6843this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 6969var questionToken = this.EatToken(); 7039list.AddSeparator(this.EatToken()); 7141var token = this.EatToken(); 7345type = _syntaxFactory.PointerType(type, this.EatToken()); 7429return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 7740EatToken(); 7750EatToken(); 7805this.EatToken(); 7811this.EatToken(); 7998EatToken(); 8377this.EatToken(), 8416var @catch = this.EatToken(); 8423var openParen = this.EatToken(); 8452whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 8504var keyword = this.EatToken(); 8556this.EatToken(); 8557if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 8559this.EatToken().Kind == SyntaxKind.IdentifierToken && 8560this.EatToken().Kind == SyntaxKind.InKeyword) 8603this.EatToken(); 8733var skippedForToken = this.EatToken(); 8835this.EatToken(); 8947caseOrDefault = this.EatToken(); 9031var yieldToken = ConvertToKeyword(this.EatToken()); 9039returnOrBreak = this.EatToken(); 9153var caseKeyword = this.EatToken(); 9394usingKeyword = EatToken(); 9399usingKeyword = EatToken(); 9665mod = this.EatToken(); 9689this.EatToken(); 10312var opToken = this.EatToken(); 10319var opToken = this.EatToken(); 10350SyntaxToken skipped = this.EatToken(); // consume but skip "from" 10486var opToken2 = this.EatToken(); 10492var opToken2 = this.EatToken(); 10494opToken2 = this.EatToken(); 10521this.EatToken(), 10573var questionToken = this.EatToken(); 10703return _syntaxFactory.ThisExpression(this.EatToken()); 10719return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 10749var refKeyword = this.EatToken(); 10760var expr = _syntaxFactory.PredefinedType(this.EatToken()); 10790return _syntaxFactory.BaseExpression(this.EatToken()); 10810this.EatToken(); // `var` 10826this.EatToken(); // eat the identifier 10831this.EatToken(); // eat the open paren or comma 10842this.EatToken(); // eat the close paren 10885expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 10895this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 10907expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 10925SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 10929expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 10937this.EatToken(), 10945expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 10964SyntaxKind.DotToken => _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 10976expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 10990expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 10998operatorToken: this.EatToken(), 11172refKindKeyword = this.EatToken(); 11204this.EatToken(), 11212var keyword = this.EatToken(); 11230this.EatToken(), 11239this.EatToken(), 11248this.EatToken(), 11256var checkedOrUnchecked = this.EatToken(); 11407this.EatToken(); 11429var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 11497_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 11521_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 11549this.EatToken(); 11562this.EatToken(); 11618EatToken(); 11624EatToken(); 11689EatToken(); 11695EatToken(); 11696EatToken(); 11738EatToken(); 11976this.EatToken(); // open paren 12178commas.Add(this.EatToken()); 12245var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 12439var greaterThan = this.EatToken(); 12696this.EatToken(); 12778name = this.EatToken(); 12811? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 12886direction = ConvertToKeyword(this.EatToken()); 13178b.Add(this.EatToken());
Parser\LanguageParser_InterpolatedString.cs (1)
41var originalToken = this.EatToken();
Parser\LanguageParser_Patterns.cs (11)
66ConvertToKeyword(this.EatToken()), 112ConvertToKeyword(this.EatToken()), 127this.EatToken(); 138this.EatToken(); // consume the `(` or `,` 146this.EatToken(); 163ConvertToKeyword(this.EatToken()), 197return _syntaxFactory.SlicePattern(EatToken(), 208this.EatToken(), 417this.EatToken(); 504var colon = EatToken(); 569? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (7)
462=> this.CurrentToken.Kind == kind ? this.EatToken() : null; 513return AddTrailingSkippedSyntax(replacement, this.EatToken()); 555return this.EatToken(); 568return this.EatToken(); 587var token = this.EatToken(); 602return ConvertToKeyword(this.EatToken()); 617return ConvertToKeyword(this.EatToken());