265 references to EatToken
Microsoft.CodeAnalysis.CSharp (265)
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(); 745skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode)); 751skippedTokens.Add(this.EatToken().WithoutDiagnosticsGreen()); 757? this.EatToken() 779var op = this.EatToken(); 792var op = this.EatToken(); 805var op = this.EatToken(); 817var op = this.EatToken(); 830var open = this.EatToken(); 835var identifier = TruncateIdentifier(this.EatToken()); 839return 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(); 965? ConvertToKeyword(this.EatToken()) 979unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1019type = AddTrailingSkippedSyntax(type, this.EatToken()); 1055EatToken(); 1134? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.EatToken()), this.EatToken(SyntaxKind.ColonToken)) 1393modTok = ConvertToKeyword(this.EatToken()); 1398modTok = ConvertToKeyword(this.EatToken()); 1405modTok = ConvertToKeyword(this.EatToken()); 1425modTok = this.EatToken(); 1430modTok = this.EatToken(); 1446modTok = ConvertToKeyword(EatToken()); 1455modTok = ConvertToKeyword(this.EatToken()); 1468modTok = ConvertToKeyword(this.EatToken()); 1473modTok = this.EatToken(); 1519this.EatToken(); //move past contextual token 1524this.EatToken(); // "partial" doesn't affect our decision, so look past it. 1666this.EatToken(); // partial 1737keyword = ConvertToKeyword(this.EatToken()); 1753keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1872keyword = ConvertToKeyword(this.EatToken()); 1874? EatToken() 1885var misplacedToken = this.EatToken(); 1889this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2028var token = this.EatToken(); 2072tokens.Add(this.EatToken()); 2278newKeyword: this.EatToken(), 2285classOrStructKeyword: this.EatToken(), 2287? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken)) 2293classOrStructKeyword: this.EatToken(), 2297_syntaxFactory.DefaultConstraint(defaultKeyword: this.EatToken()), 2302this.EatToken())), 2311this.EatToken())), 2633var identifier = this.EatToken(); 2951EatToken(); 3399token = this.EatToken(); 3653EatToken(); 3697? this.EatToken() 3710style = this.EatToken(); 3843var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 3894opToken = this.EatToken(); 3905opToken = this.ConvertToMissingWithTrailingTrivia(this.EatToken(), SyntaxKind.PlusToken); 3926opToken = IsAtDotDotToken() ? EatDotDotToken() : EatToken(); 3942var opToken2 = this.EatToken(); 3948opToken2 = this.EatToken(); 3955opToken2 = this.EatToken(); 3969var opToken2 = this.EatToken(); 4253? this.EatToken() 4444var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenEvenWithIncorrectKind(expected) : this.EatToken(); 4470var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.EatToken(); 4823this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 4824this.EatToken())); 4872modifiers.Add(this.EatToken()); 4886modifiers.Add(this.EatToken()); 4899modifiers.Add(this.EatToken()); 4917var eventToken = this.EatToken(); 5020var semi = this.EatToken(); 5375this.EatToken(); 5434var equals = this.EatToken(); 5438? this.EatToken() 5847SyntaxToken identifierToken = this.EatToken(); 5962this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ? EatToken() : null, 6155var start = this.EatToken(); 6157this.EatToken(); 6158greaterThanToken = this.EatToken(); 6170this.EatToken(); 6181greaterThanToken = EatToken(); 6317greaterThanToken = this.EatToken(); 6486? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6516result = AddTrailingSkippedSyntax(result, this.EatToken()); 6580identifierOrThisOpt = this.EatToken(); 6699? this.EatToken() // fine after the first identifier 6713separator = this.EatToken(); 6817? ParseQualifiedNameRight(allowedParts, name, this.EatToken()) 6833var separator = this.EatToken(); 6973lastTokenOfType = this.EatToken(); 6992this.EatToken(); 6996this.EatToken(); 7043this.EatToken(); 7061lastTokenOfType = this.EatToken(); 7066lastTokenOfType = this.EatToken(); 7094lastTokenOfType = this.EatToken(); 7115lastTokenOfType = this.EatToken(); 7129this.EatToken(); 7132this.EatToken(); 7141lastTokenOfType = this.EatToken(); 7165lastTokenOfType = this.EatToken(); 7172lastTokenOfType = this.EatToken(); 7177lastTokenOfType = this.EatToken(); 7183lastTokenOfType = this.EatToken(); 7190lastTokenOfType = this.EatToken(); 7219lastTokenOfType = EatToken(); 7246lastTokenOfType = EatToken(); 7268var validStartingToken = EatToken().Kind == SyntaxKind.LessThanToken; 7336return _syntaxFactory.PredefinedType(this.EatToken()); 7361this.EatToken(), 7362this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.EatToken() : null, 7486var questionToken = this.EatToken(); 7666list.AddSeparator(this.EatToken()); 7764var token = this.EatToken(); 7968type = _syntaxFactory.PointerType(type, this.EatToken()); 8137return _syntaxFactory.EmptyStatement(attributes, this.EatToken()); 8465EatToken(); 8475EatToken(); 8530this.EatToken(); 8536this.EatToken(); 8723EatToken(); 9112this.EatToken(), 9151var @catch = this.EatToken(); 9158var openParen = this.EatToken(); 9187whenKeyword = AddTrailingSkippedSyntax(whenKeyword, EatToken()); 9239var keyword = this.EatToken(); 9291this.EatToken(); 9292if (this.EatToken().Kind == SyntaxKind.OpenParenToken && 9294this.EatToken().Kind == SyntaxKind.IdentifierToken && 9295this.EatToken().Kind == SyntaxKind.InKeyword) 9367this.EatToken(); 9468var skippedForToken = this.EatToken(); 9570this.EatToken(); 9682caseOrDefault = this.EatToken(); 9817var yieldToken = ConvertToKeyword(this.EatToken()); 9825returnOrBreak = this.EatToken(); 9939var caseKeyword = this.EatToken(); 10179usingKeyword = EatToken(); 10184usingKeyword = EatToken(); 10506mod = this.EatToken(); 10534this.EatToken(); 11160this.EatToken(), 11194this.AddError(this.EatToken(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text)); 11334var questionToken = this.EatToken(); 11491var token1 = EatToken(); 11492var token2 = EatToken(); 11504var token1 = EatToken(); 11505_ = EatToken(); 11506var token3 = EatToken(); 11532this.EatToken(), 11565var token1 = this.EatToken(); 11566var token2 = this.EatToken(); 11589dotDotToken = AddSkippedSyntax(dotDotToken, this.EatToken(), trailing: true); 11712return _syntaxFactory.ThisExpression(this.EatToken()); 11728return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken()); 11758var refKeyword = this.EatToken(); 11769var expr = _syntaxFactory.PredefinedType(this.EatToken()); 11818expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken()); 11828this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 11840expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11858SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), 11862expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)); 11875expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.EatToken()); 11888return _syntaxFactory.BaseExpression(this.EatToken()); 11908this.EatToken(); // `var` 11924this.EatToken(); // eat the identifier 11929this.EatToken(); // eat the open paren or comma 11940this.EatToken(); // eat the close paren 12018return (questionToken: EatToken(), _syntaxFactory.MemberBindingExpression(this.EatToken(), this.ParseSimpleName(NameOptions.InExpression))); 12021return (questionToken: EatToken(), _syntaxFactory.ElementBindingExpression(this.ParseBracketedArgumentList())); 12043this.EatToken(); 12062expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, EatToken()); 12104=> _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.EatToken(), this.ParseSimpleName(NameOptions.InExpression)), 12263refKindKeyword = this.EatToken(); 12295this.EatToken(), 12303var keyword = this.EatToken(); 12321this.EatToken(), 12330this.EatToken(), 12339this.EatToken(), 12347var checkedOrUnchecked = this.EatToken(); 12435this.EatToken(); 12453var identifier = this.IsTrueIdentifier() ? this.EatToken() : CreateMissingIdentifierToken(); 12530_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12554_syntaxFactory.NameColon((IdentifierNameSyntax)expression, EatToken()), 12582this.EatToken(); 12595this.EatToken(); 12674EatToken(); 12680EatToken(); 12737EatToken(); 12743EatToken(); 12744EatToken(); 12786EatToken(); 13069this.EatToken(); // open paren 13273commas.Add(this.EatToken()); 13340var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray); 13784this.EatToken(); 13867name = this.EatToken(); 13900? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.EatToken()), this.ParseIdentifierToken()) 13975direction = ConvertToKeyword(this.EatToken()); 14304b.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()); 585return this.EatToken(); 598return this.EatToken(); 640var token = this.EatToken(); 655return ConvertToKeyword(this.EatToken()); 670return ConvertToKeyword(this.EatToken());