260 references to EatToken
Microsoft.CodeAnalysis.CSharp (260)
Parser\DirectiveParser.cs (22)
370
line = this.
EatToken
();
390
file = this.
EatToken
();
537
SyntaxKind.EnableKeyword =>
EatToken
(),
538
SyntaxKind.DisableKeyword =>
EatToken
(),
539
SyntaxKind.RestoreKeyword =>
EatToken
(),
545
SyntaxKind.WarningsKeyword =>
EatToken
(),
546
SyntaxKind.AnnotationsKeyword =>
EatToken
(),
570
style = this.
EatToken
();
587
id = this.
EatToken
();
599
id = this.
EatToken
();
616
ids.AddSeparator(this.
EatToken
());
631
var checksum = this.
EatToken
();
709
skippedTokens.Add(this.AddError(this.
EatToken
().WithoutDiagnosticsGreen(), errorCode));
715
skippedTokens.Add(this.
EatToken
().WithoutDiagnosticsGreen());
721
? this.
EatToken
()
743
var op = this.
EatToken
();
756
var op = this.
EatToken
();
769
var op = this.
EatToken
();
781
var op = this.
EatToken
();
794
var open = this.
EatToken
();
799
var identifier = TruncateIdentifier(this.
EatToken
());
803
return SyntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(k), this.
EatToken
());
Parser\DocumentationCommentParser.cs (35)
110
var token = this.
EatToken
();
194
textTokens.Add(this.
EatToken
());
220
var startTag = SyntaxFactory.XmlElementStartTag(lessThan, name, attrs, this.
EatToken
());
399
var token = this.
EatToken
();
537
EatToken
();
611
var token = this.
EatToken
();
666
quote = AddTrailingSkippedSyntax(quote,
EatToken
());
687
var colon = this.
EatToken
();
729
var token = this.
EatToken
();
755
textTokens.Add(this.
EatToken
());
777
var textToken = this.
EatToken
();
920
badTokens.Add(this.
EatToken
());
972
SyntaxToken thisKeyword =
EatToken
();
984
SyntaxToken operatorKeyword =
EatToken
();
991
operatorToken =
EatToken
();
1004
operatorToken = AddTrailingSkippedSyntax(operatorToken,
EatToken
());
1019
var operatorToken2 = this.
EatToken
();
1024
var operatorToken3 = this.
EatToken
();
1071
var operatorToken2 = this.
EatToken
();
1081
var operatorToken2 = this.
EatToken
();
1127
var misplacedToken = AddErrorAsWarning(
EatToken
(), ErrorCode.ERR_MisplacedUnchecked);
1143
SyntaxToken implicitOrExplicit =
EatToken
();
1256
refKindOpt =
EatToken
();
1266
var misplacedToken = AddErrorAsWarning(
EatToken
(), ErrorCode.ERR_RefReadOnlyWrongOrdering);
1271
readOnlyOpt =
EatToken
();
1293
var open =
EatToken
();
1379
return SyntaxFactory.PredefinedType(
EatToken
());
1384
SyntaxToken alias =
EatToken
();
1392
SyntaxToken colonColon =
EatToken
();
1418
SyntaxToken dot =
EatToken
();
1446
type = SyntaxFactory.NullableType(type,
EatToken
());
1451
type = SyntaxFactory.PointerType(type,
EatToken
());
1462
SyntaxToken open =
EatToken
();
1472
dimensionList.AddSeparator(this.
EatToken
());
1570
badTokens.Add(this.
EatToken
());
Parser\LanguageParser.cs (185)
616
var token = this.
EatToken
();
731
var skippedToken =
EatToken
();
958
? ConvertToKeyword(this.
EatToken
())
972
unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.
EatToken
(), ErrorCode.ERR_BadStaticAfterUnsafe));
1012
type = AddTrailingSkippedSyntax(type, this.
EatToken
());
1048
EatToken
();
1127
? _syntaxFactory.AttributeTargetSpecifier(ConvertToKeyword(this.
EatToken
()), this.EatToken(SyntaxKind.ColonToken))
1386
modTok = ConvertToKeyword(this.
EatToken
());
1391
modTok = ConvertToKeyword(this.
EatToken
());
1398
modTok = ConvertToKeyword(this.
EatToken
());
1418
modTok = this.
EatToken
();
1423
modTok = this.
EatToken
();
1439
modTok = ConvertToKeyword(
EatToken
());
1448
modTok = ConvertToKeyword(this.
EatToken
());
1461
modTok = ConvertToKeyword(this.
EatToken
());
1466
modTok = this.
EatToken
();
1512
this.
EatToken
(); //move past contextual token
1517
this.
EatToken
(); // "partial" doesn't affect our decision, so look past it.
1658
this.
EatToken
(); // partial
1729
keyword = ConvertToKeyword(this.
EatToken
());
1855
keyword = ConvertToKeyword(this.
EatToken
());
1857
?
EatToken
()
1868
var misplacedToken = this.
EatToken
();
1872
this.AddError(ConvertToKeyword(this.
EatToken
()), ErrorCode.ERR_MisplacedRecord),
1992
var token = this.
EatToken
();
2036
tokens.Add(this.
EatToken
());
2242
newKeyword: this.
EatToken
(),
2249
classOrStructKeyword: this.
EatToken
(),
2251
? this.AddError(this.
EatToken
(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken))
2257
classOrStructKeyword: this.
EatToken
(),
2261
_syntaxFactory.DefaultConstraint(defaultKeyword: this.
EatToken
()),
2266
this.
EatToken
())),
2275
this.
EatToken
())),
2591
var identifier = this.
EatToken
();
2909
EatToken
();
3338
token = this.
EatToken
();
3592
EatToken
();
3636
? this.
EatToken
()
3649
style = this.
EatToken
();
3782
var misplacedToken = this.AddError(this.
EatToken
(), ErrorCode.ERR_MisplacedUnchecked);
3833
opToken = this.
EatToken
();
3844
opToken = this.ConvertToMissingWithTrailingTrivia(this.
EatToken
(), SyntaxKind.PlusToken);
3865
opToken = IsAtDotDotToken() ? EatDotDotToken() :
EatToken
();
3878
var opToken2 = this.
EatToken
();
3884
opToken2 = this.
EatToken
();
4162
? this.
EatToken
()
4353
var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(expected) : this.
EatToken
();
4379
var token = (first && !this.CurrentToken.ContainsDiagnostics) ? this.EatTokenWithPrejudice(errorCode) : this.
EatToken
();
4715
this.AddError(this.
EatToken
(), ErrorCode.ERR_BadArraySyntax),
4716
this.
EatToken
()));
4761
modifiers.Add(this.
EatToken
());
4775
modifiers.Add(this.
EatToken
());
4788
modifiers.Add(this.
EatToken
());
4806
var eventToken = this.
EatToken
();
4909
var semi = this.
EatToken
();
5262
this.
EatToken
();
5322
var equals = this.
EatToken
();
5326
? this.
EatToken
()
5735
SyntaxToken identifierToken = this.
EatToken
();
5850
this.CurrentToken.Kind is SyntaxKind.InKeyword or SyntaxKind.OutKeyword ?
EatToken
() : null,
6043
var start = this.
EatToken
();
6045
this.
EatToken
();
6046
greaterThanToken = this.
EatToken
();
6058
this.
EatToken
();
6069
greaterThanToken =
EatToken
();
6205
greaterThanToken = this.
EatToken
();
6374
? this.AddError(this.
EatToken
(), ErrorCode.ERR_IllegalVarianceSyntax)
6404
result = AddTrailingSkippedSyntax(result, this.
EatToken
());
6468
identifierOrThisOpt = this.
EatToken
();
6587
? this.
EatToken
() // fine after the first identifier
6601
separator = this.
EatToken
();
6705
? ParseQualifiedNameRight(allowedParts, name, this.
EatToken
())
6721
var separator = this.
EatToken
();
6861
lastTokenOfType = this.
EatToken
();
6880
this.
EatToken
();
6884
this.
EatToken
();
6931
this.
EatToken
();
6949
lastTokenOfType = this.
EatToken
();
6954
lastTokenOfType = this.
EatToken
();
6982
lastTokenOfType = this.
EatToken
();
7003
lastTokenOfType = this.
EatToken
();
7017
this.
EatToken
();
7020
this.
EatToken
();
7029
lastTokenOfType = this.
EatToken
();
7053
lastTokenOfType = this.
EatToken
();
7060
lastTokenOfType = this.
EatToken
();
7065
lastTokenOfType = this.
EatToken
();
7071
lastTokenOfType = this.
EatToken
();
7078
lastTokenOfType = this.
EatToken
();
7107
lastTokenOfType =
EatToken
();
7134
lastTokenOfType =
EatToken
();
7156
var validStartingToken =
EatToken
().Kind == SyntaxKind.LessThanToken;
7224
return _syntaxFactory.PredefinedType(this.
EatToken
());
7249
this.
EatToken
(),
7250
this.CurrentToken.Kind == SyntaxKind.ReadOnlyKeyword ? this.
EatToken
() : null,
7374
var questionToken = this.
EatToken
();
7554
list.AddSeparator(this.
EatToken
());
7656
var token = this.
EatToken
();
7860
type = _syntaxFactory.PointerType(type, this.
EatToken
());
8029
return _syntaxFactory.EmptyStatement(attributes, this.
EatToken
());
8346
EatToken
();
8356
EatToken
();
8411
this.
EatToken
();
8417
this.
EatToken
();
8604
EatToken
();
8975
this.
EatToken
(),
9014
var @catch = this.
EatToken
();
9021
var openParen = this.
EatToken
();
9050
whenKeyword = AddTrailingSkippedSyntax(whenKeyword,
EatToken
());
9102
var keyword = this.
EatToken
();
9154
this.
EatToken
();
9155
if (this.
EatToken
().Kind == SyntaxKind.OpenParenToken &&
9157
this.
EatToken
().Kind == SyntaxKind.IdentifierToken &&
9158
this.
EatToken
().Kind == SyntaxKind.InKeyword)
9230
this.
EatToken
();
9331
var skippedForToken = this.
EatToken
();
9433
this.
EatToken
();
9545
caseOrDefault = this.
EatToken
();
9680
var yieldToken = ConvertToKeyword(this.
EatToken
());
9688
returnOrBreak = this.
EatToken
();
9802
var caseKeyword = this.
EatToken
();
10042
usingKeyword =
EatToken
();
10047
usingKeyword =
EatToken
();
10342
mod = this.
EatToken
();
10370
this.
EatToken
();
10996
this.
EatToken
(),
11030
this.AddError(this.
EatToken
(), ErrorCode.ERR_InvalidExprTerm, this.CurrentToken.Text));
11161
this.
EatToken
(),
11251
var token1 =
EatToken
();
11252
var token2 =
EatToken
();
11264
var token1 =
EatToken
();
11265
_ =
EatToken
();
11266
var token3 =
EatToken
();
11289
var questionToken = this.
EatToken
();
11389
var token1 = this.
EatToken
();
11390
var token2 = this.
EatToken
();
11413
dotDotToken = AddSkippedSyntax(dotDotToken, this.
EatToken
(), trailing: true);
11536
return _syntaxFactory.ThisExpression(this.
EatToken
());
11552
return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.
EatToken
());
11582
var refKeyword = this.
EatToken
();
11593
var expr = _syntaxFactory.PredefinedType(this.
EatToken
());
11642
expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.
EatToken
());
11652
this.ConvertToMissingWithTrailingTrivia(this.AddError(this.
EatToken
(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken),
11664
expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.PointerMemberAccessExpression, expr, this.
EatToken
(), this.ParseSimpleName(NameOptions.InExpression));
11682
SyntaxKind.SimpleMemberAccessExpression, expr, this.
EatToken
(),
11686
expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.
EatToken
(), this.ParseSimpleName(NameOptions.InExpression));
11694
this.
EatToken
(),
11702
expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr, this.
EatToken
());
11715
return _syntaxFactory.BaseExpression(this.
EatToken
());
11735
this.
EatToken
(); // `var`
11751
this.
EatToken
(); // eat the identifier
11756
this.
EatToken
(); // eat the open paren or comma
11767
this.
EatToken
(); // eat the close paren
11815
this.
EatToken
();
11832
SyntaxKind.DotToken => _syntaxFactory.MemberBindingExpression(this.
EatToken
(), this.ParseSimpleName(NameOptions.InExpression)),
11844
expr = _syntaxFactory.PostfixUnaryExpression(SyntaxKind.SuppressNullableWarningExpression, expr,
EatToken
());
11858
expr = _syntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expr, this.
EatToken
(), this.ParseSimpleName(NameOptions.InExpression));
11866
operatorToken: this.
EatToken
(),
12040
refKindKeyword = this.
EatToken
();
12072
this.
EatToken
(),
12080
var keyword = this.
EatToken
();
12098
this.
EatToken
(),
12107
this.
EatToken
(),
12116
this.
EatToken
(),
12124
var checkedOrUnchecked = this.
EatToken
();
12261
this.
EatToken
();
12283
var identifier = this.IsTrueIdentifier() ? this.
EatToken
() : CreateMissingIdentifierToken();
12360
_syntaxFactory.NameColon((IdentifierNameSyntax)expression,
EatToken
()),
12384
_syntaxFactory.NameColon((IdentifierNameSyntax)expression,
EatToken
()),
12412
this.
EatToken
();
12425
this.
EatToken
();
12504
EatToken
();
12510
EatToken
();
12567
EatToken
();
12573
EatToken
();
12574
EatToken
();
12616
EatToken
();
12894
this.
EatToken
(); // open paren
13096
commas.Add(this.
EatToken
());
13163
var comma = this.AddError(this.
EatToken
(), ErrorCode.ERR_InvalidStackAllocArray);
13607
this.
EatToken
();
13690
name = this.
EatToken
();
13723
? _syntaxFactory.JoinIntoClause(ConvertToKeyword(this.
EatToken
()), this.ParseIdentifierToken())
13798
direction = ConvertToKeyword(this.
EatToken
());
14122
b.Add(this.
EatToken
());
Parser\LanguageParser_InterpolatedString.cs (1)
41
var originalToken = this.
EatToken
();
Parser\LanguageParser_Patterns.cs (10)
66
ConvertToKeyword(this.
EatToken
()),
112
ConvertToKeyword(this.
EatToken
()),
127
this.
EatToken
();
138
this.
EatToken
(); // consume the `(` or `,`
146
this.
EatToken
();
163
ConvertToKeyword(this.
EatToken
()),
211
this.
EatToken
(),
421
this.
EatToken
();
511
var colon =
EatToken
();
591
? AddError(this.
EatToken
(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (7)
498
=> this.CurrentToken.Kind == kind ? this.
EatToken
() : null;
549
return AddTrailingSkippedSyntax(replacement, this.
EatToken
());
591
return this.
EatToken
();
604
return this.
EatToken
();
623
var token = this.
EatToken
();
638
return ConvertToKeyword(this.
EatToken
());
653
return ConvertToKeyword(this.
EatToken
());