957 references to SyntaxKind
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (957)
CSharpFormatter.TypeNames.cs (2)
19
return SyntaxFacts.GetKeywordKind(identifier) !=
SyntaxKind
.None || SyntaxFacts.GetContextualKeywordKind(identifier) !=
SyntaxKind
.None;
Placeholders.cs (1)
14
/// Required by <see cref="
SyntaxKind
"/>.
SyntaxKindFacts.cs (954)
11
public static bool IsKeywordKind(
SyntaxKind
kind)
16
public static IEnumerable<
SyntaxKind
> GetReservedKeywordKinds()
18
for (int i = (int)
SyntaxKind
.BoolKeyword; i <= (int)
SyntaxKind
.ImplicitKeyword; i++)
20
yield return (
SyntaxKind
)i;
24
public static IEnumerable<
SyntaxKind
> GetKeywordKinds()
26
foreach (
var
reserved in GetReservedKeywordKinds())
31
foreach (
var
contextual in GetContextualKeywordKinds())
37
public static bool IsReservedKeyword(
SyntaxKind
kind)
39
return kind >=
SyntaxKind
.BoolKeyword && kind <=
SyntaxKind
.ImplicitKeyword;
42
public static bool IsAttributeTargetSpecifier(
SyntaxKind
kind)
46
case
SyntaxKind
.AssemblyKeyword:
47
case
SyntaxKind
.ModuleKeyword:
54
public static bool IsAccessibilityModifier(
SyntaxKind
kind)
58
case
SyntaxKind
.PrivateKeyword:
59
case
SyntaxKind
.ProtectedKeyword:
60
case
SyntaxKind
.InternalKeyword:
61
case
SyntaxKind
.PublicKeyword:
68
public static bool IsPreprocessorKeyword(
SyntaxKind
kind)
72
case
SyntaxKind
.TrueKeyword:
73
case
SyntaxKind
.FalseKeyword:
74
case
SyntaxKind
.DefaultKeyword:
75
case
SyntaxKind
.IfKeyword:
76
case
SyntaxKind
.ElseKeyword:
77
case
SyntaxKind
.ElifKeyword:
78
case
SyntaxKind
.EndIfKeyword:
79
case
SyntaxKind
.RegionKeyword:
80
case
SyntaxKind
.EndRegionKeyword:
81
case
SyntaxKind
.DefineKeyword:
82
case
SyntaxKind
.UndefKeyword:
83
case
SyntaxKind
.WarningKeyword:
84
case
SyntaxKind
.ErrorKeyword:
85
case
SyntaxKind
.LineKeyword:
86
case
SyntaxKind
.PragmaKeyword:
87
case
SyntaxKind
.HiddenKeyword:
88
case
SyntaxKind
.ChecksumKeyword:
89
case
SyntaxKind
.DisableKeyword:
90
case
SyntaxKind
.RestoreKeyword:
91
case
SyntaxKind
.ReferenceKeyword:
92
case
SyntaxKind
.LoadKeyword:
93
case
SyntaxKind
.NullableKeyword:
94
case
SyntaxKind
.EnableKeyword:
95
case
SyntaxKind
.WarningsKeyword:
96
case
SyntaxKind
.AnnotationsKeyword:
112
internal static bool IsPreprocessorContextualKeyword(
SyntaxKind
kind)
116
case
SyntaxKind
.TrueKeyword:
117
case
SyntaxKind
.FalseKeyword:
118
case
SyntaxKind
.DefaultKeyword:
119
case
SyntaxKind
.HiddenKeyword:
120
case
SyntaxKind
.ChecksumKeyword:
121
case
SyntaxKind
.DisableKeyword:
122
case
SyntaxKind
.RestoreKeyword:
123
case
SyntaxKind
.EnableKeyword:
124
case
SyntaxKind
.WarningsKeyword:
125
case
SyntaxKind
.AnnotationsKeyword:
132
public static IEnumerable<
SyntaxKind
> GetPreprocessorKeywordKinds()
134
yield return
SyntaxKind
.TrueKeyword;
135
yield return
SyntaxKind
.FalseKeyword;
136
yield return
SyntaxKind
.DefaultKeyword;
137
yield return
SyntaxKind
.HiddenKeyword;
138
for (int i = (int)
SyntaxKind
.ElifKeyword; i <= (int)
SyntaxKind
.RestoreKeyword; i++)
140
yield return (
SyntaxKind
)i;
144
public static bool IsPunctuation(
SyntaxKind
kind)
146
return kind >=
SyntaxKind
.TildeToken && kind <=
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken;
149
public static bool IsLanguagePunctuation(
SyntaxKind
kind)
154
public static bool IsPreprocessorPunctuation(
SyntaxKind
kind)
156
return kind ==
SyntaxKind
.HashToken;
159
private static bool IsDebuggerSpecialPunctuation(
SyntaxKind
kind)
162
return kind ==
SyntaxKind
.DollarToken;
165
public static IEnumerable<
SyntaxKind
> GetPunctuationKinds()
167
for (int i = (int)
SyntaxKind
.TildeToken; i <= (int)
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken; i++)
169
yield return (
SyntaxKind
)i;
173
public static bool IsPunctuationOrKeyword(
SyntaxKind
kind)
175
return kind >=
SyntaxKind
.TildeToken && kind <=
SyntaxKind
.EndOfFileToken;
178
internal static bool IsLiteral(
SyntaxKind
kind)
182
case
SyntaxKind
.IdentifierToken:
183
case
SyntaxKind
.StringLiteralToken:
184
case
SyntaxKind
.Utf8StringLiteralToken:
185
case
SyntaxKind
.SingleLineRawStringLiteralToken:
186
case
SyntaxKind
.Utf8SingleLineRawStringLiteralToken:
187
case
SyntaxKind
.MultiLineRawStringLiteralToken:
188
case
SyntaxKind
.Utf8MultiLineRawStringLiteralToken:
189
case
SyntaxKind
.CharacterLiteralToken:
190
case
SyntaxKind
.NumericLiteralToken:
191
case
SyntaxKind
.XmlTextLiteralToken:
192
case
SyntaxKind
.XmlTextLiteralNewLineToken:
193
case
SyntaxKind
.XmlEntityLiteralToken:
200
public static bool IsAnyToken(
SyntaxKind
kind)
202
if (kind >=
SyntaxKind
.TildeToken && kind <
SyntaxKind
.EndOfLineTrivia) return true;
205
case
SyntaxKind
.InterpolatedStringToken:
206
case
SyntaxKind
.InterpolatedStringStartToken:
207
case
SyntaxKind
.InterpolatedVerbatimStringStartToken:
208
case
SyntaxKind
.InterpolatedMultiLineRawStringStartToken:
209
case
SyntaxKind
.InterpolatedSingleLineRawStringStartToken:
210
case
SyntaxKind
.InterpolatedStringTextToken:
211
case
SyntaxKind
.InterpolatedStringEndToken:
212
case
SyntaxKind
.InterpolatedRawStringEndToken:
213
case
SyntaxKind
.LoadKeyword:
214
case
SyntaxKind
.NullableKeyword:
215
case
SyntaxKind
.EnableKeyword:
216
case
SyntaxKind
.UnderscoreToken:
217
case
SyntaxKind
.MultiLineRawStringLiteralToken:
218
case
SyntaxKind
.SingleLineRawStringLiteralToken:
225
public static bool IsTrivia(
SyntaxKind
kind)
229
case
SyntaxKind
.EndOfLineTrivia:
230
case
SyntaxKind
.WhitespaceTrivia:
231
case
SyntaxKind
.SingleLineCommentTrivia:
232
case
SyntaxKind
.MultiLineCommentTrivia:
233
case
SyntaxKind
.SingleLineDocumentationCommentTrivia:
234
case
SyntaxKind
.MultiLineDocumentationCommentTrivia:
235
case
SyntaxKind
.DisabledTextTrivia:
236
case
SyntaxKind
.DocumentationCommentExteriorTrivia:
237
case
SyntaxKind
.ConflictMarkerTrivia:
244
public static bool IsPreprocessorDirective(
SyntaxKind
kind)
248
case
SyntaxKind
.IfDirectiveTrivia:
249
case
SyntaxKind
.ElifDirectiveTrivia:
250
case
SyntaxKind
.ElseDirectiveTrivia:
251
case
SyntaxKind
.EndIfDirectiveTrivia:
252
case
SyntaxKind
.RegionDirectiveTrivia:
253
case
SyntaxKind
.EndRegionDirectiveTrivia:
254
case
SyntaxKind
.DefineDirectiveTrivia:
255
case
SyntaxKind
.UndefDirectiveTrivia:
256
case
SyntaxKind
.ErrorDirectiveTrivia:
257
case
SyntaxKind
.WarningDirectiveTrivia:
258
case
SyntaxKind
.LineDirectiveTrivia:
259
case
SyntaxKind
.LineSpanDirectiveTrivia:
260
case
SyntaxKind
.PragmaWarningDirectiveTrivia:
261
case
SyntaxKind
.PragmaChecksumDirectiveTrivia:
262
case
SyntaxKind
.ReferenceDirectiveTrivia:
263
case
SyntaxKind
.LoadDirectiveTrivia:
264
case
SyntaxKind
.BadDirectiveTrivia:
265
case
SyntaxKind
.ShebangDirectiveTrivia:
266
case
SyntaxKind
.NullableDirectiveTrivia:
273
public static bool IsName(
SyntaxKind
kind)
277
case
SyntaxKind
.IdentifierName:
278
case
SyntaxKind
.GenericName:
279
case
SyntaxKind
.QualifiedName:
280
case
SyntaxKind
.AliasQualifiedName:
287
public static bool IsPredefinedType(
SyntaxKind
kind)
291
case
SyntaxKind
.BoolKeyword:
292
case
SyntaxKind
.ByteKeyword:
293
case
SyntaxKind
.SByteKeyword:
294
case
SyntaxKind
.IntKeyword:
295
case
SyntaxKind
.UIntKeyword:
296
case
SyntaxKind
.ShortKeyword:
297
case
SyntaxKind
.UShortKeyword:
298
case
SyntaxKind
.LongKeyword:
299
case
SyntaxKind
.ULongKeyword:
300
case
SyntaxKind
.FloatKeyword:
301
case
SyntaxKind
.DoubleKeyword:
302
case
SyntaxKind
.DecimalKeyword:
303
case
SyntaxKind
.StringKeyword:
304
case
SyntaxKind
.CharKeyword:
305
case
SyntaxKind
.ObjectKeyword:
306
case
SyntaxKind
.VoidKeyword:
313
public static bool IsTypeSyntax(
SyntaxKind
kind)
317
case
SyntaxKind
.ArrayType:
318
case
SyntaxKind
.PointerType:
319
case
SyntaxKind
.NullableType:
320
case
SyntaxKind
.PredefinedType:
321
case
SyntaxKind
.TupleType:
322
case
SyntaxKind
.FunctionPointerType:
332
public static bool IsGlobalMemberDeclaration(
SyntaxKind
kind)
336
case
SyntaxKind
.GlobalStatement:
337
case
SyntaxKind
.FieldDeclaration:
338
case
SyntaxKind
.MethodDeclaration:
339
case
SyntaxKind
.PropertyDeclaration:
340
case
SyntaxKind
.EventDeclaration:
341
case
SyntaxKind
.EventFieldDeclaration:
347
public static bool IsTypeDeclaration(
SyntaxKind
kind)
351
case
SyntaxKind
.ClassDeclaration:
352
case
SyntaxKind
.StructDeclaration:
353
case
SyntaxKind
.InterfaceDeclaration:
354
case
SyntaxKind
.DelegateDeclaration:
355
case
SyntaxKind
.EnumDeclaration:
356
case
SyntaxKind
.RecordDeclaration:
357
case
SyntaxKind
.RecordStructDeclaration:
365
public static bool IsNamespaceMemberDeclaration(
SyntaxKind
kind)
367
kind ==
SyntaxKind
.NamespaceDeclaration ||
368
kind ==
SyntaxKind
.FileScopedNamespaceDeclaration;
370
public static bool IsAnyUnaryExpression(
SyntaxKind
token)
375
public static bool IsPrefixUnaryExpression(
SyntaxKind
token)
377
return GetPrefixUnaryExpression(token) !=
SyntaxKind
.None;
380
public static bool IsPrefixUnaryExpressionOperatorToken(
SyntaxKind
token)
382
return GetPrefixUnaryExpression(token) !=
SyntaxKind
.None;
385
public static
SyntaxKind
GetPrefixUnaryExpression(
SyntaxKind
token)
389
case
SyntaxKind
.PlusToken:
390
return
SyntaxKind
.UnaryPlusExpression;
391
case
SyntaxKind
.MinusToken:
392
return
SyntaxKind
.UnaryMinusExpression;
393
case
SyntaxKind
.TildeToken:
394
return
SyntaxKind
.BitwiseNotExpression;
395
case
SyntaxKind
.ExclamationToken:
396
return
SyntaxKind
.LogicalNotExpression;
397
case
SyntaxKind
.PlusPlusToken:
398
return
SyntaxKind
.PreIncrementExpression;
399
case
SyntaxKind
.MinusMinusToken:
400
return
SyntaxKind
.PreDecrementExpression;
401
case
SyntaxKind
.AmpersandToken:
402
return
SyntaxKind
.AddressOfExpression;
403
case
SyntaxKind
.AsteriskToken:
404
return
SyntaxKind
.PointerIndirectionExpression;
405
case
SyntaxKind
.CaretToken:
406
return
SyntaxKind
.IndexExpression;
408
return
SyntaxKind
.None;
412
public static bool IsPostfixUnaryExpression(
SyntaxKind
token)
414
return GetPostfixUnaryExpression(token) !=
SyntaxKind
.None;
417
public static bool IsPostfixUnaryExpressionToken(
SyntaxKind
token)
419
return GetPostfixUnaryExpression(token) !=
SyntaxKind
.None;
422
public static
SyntaxKind
GetPostfixUnaryExpression(
SyntaxKind
token)
426
case
SyntaxKind
.PlusPlusToken:
427
return
SyntaxKind
.PostIncrementExpression;
428
case
SyntaxKind
.MinusMinusToken:
429
return
SyntaxKind
.PostDecrementExpression;
430
case
SyntaxKind
.ExclamationToken:
431
return
SyntaxKind
.SuppressNullableWarningExpression;
433
return
SyntaxKind
.None;
437
internal static bool IsIncrementOrDecrementOperator(
SyntaxKind
token)
441
case
SyntaxKind
.PlusPlusToken:
442
case
SyntaxKind
.MinusMinusToken:
449
public static bool IsUnaryOperatorDeclarationToken(
SyntaxKind
token)
452
token ==
SyntaxKind
.TrueKeyword ||
453
token ==
SyntaxKind
.FalseKeyword;
456
public static bool IsAnyOverloadableOperator(
SyntaxKind
kind)
461
public static bool IsOverloadableBinaryOperator(
SyntaxKind
kind)
465
case
SyntaxKind
.PlusToken:
466
case
SyntaxKind
.MinusToken:
467
case
SyntaxKind
.AsteriskToken:
468
case
SyntaxKind
.SlashToken:
469
case
SyntaxKind
.PercentToken:
470
case
SyntaxKind
.CaretToken:
471
case
SyntaxKind
.AmpersandToken:
472
case
SyntaxKind
.BarToken:
473
case
SyntaxKind
.EqualsEqualsToken:
474
case
SyntaxKind
.LessThanToken:
475
case
SyntaxKind
.LessThanEqualsToken:
476
case
SyntaxKind
.LessThanLessThanToken:
477
case
SyntaxKind
.GreaterThanToken:
478
case
SyntaxKind
.GreaterThanEqualsToken:
479
case
SyntaxKind
.GreaterThanGreaterThanToken:
480
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
481
case
SyntaxKind
.ExclamationEqualsToken:
488
public static bool IsOverloadableUnaryOperator(
SyntaxKind
kind)
492
case
SyntaxKind
.PlusToken:
493
case
SyntaxKind
.MinusToken:
494
case
SyntaxKind
.TildeToken:
495
case
SyntaxKind
.ExclamationToken:
496
case
SyntaxKind
.PlusPlusToken:
497
case
SyntaxKind
.MinusMinusToken:
498
case
SyntaxKind
.TrueKeyword:
499
case
SyntaxKind
.FalseKeyword:
506
public static bool IsPrimaryFunction(
SyntaxKind
keyword)
508
return GetPrimaryFunction(keyword) !=
SyntaxKind
.None;
511
public static
SyntaxKind
GetPrimaryFunction(
SyntaxKind
keyword)
515
case
SyntaxKind
.MakeRefKeyword:
516
return
SyntaxKind
.MakeRefExpression;
517
case
SyntaxKind
.RefTypeKeyword:
518
return
SyntaxKind
.RefTypeExpression;
519
case
SyntaxKind
.RefValueKeyword:
520
return
SyntaxKind
.RefValueExpression;
521
case
SyntaxKind
.CheckedKeyword:
522
return
SyntaxKind
.CheckedExpression;
523
case
SyntaxKind
.UncheckedKeyword:
524
return
SyntaxKind
.UncheckedExpression;
525
case
SyntaxKind
.DefaultKeyword:
526
return
SyntaxKind
.DefaultExpression;
527
case
SyntaxKind
.TypeOfKeyword:
528
return
SyntaxKind
.TypeOfExpression;
529
case
SyntaxKind
.SizeOfKeyword:
530
return
SyntaxKind
.SizeOfExpression;
532
return
SyntaxKind
.None;
536
public static bool IsLiteralExpression(
SyntaxKind
token)
538
return GetLiteralExpression(token) !=
SyntaxKind
.None;
541
public static
SyntaxKind
GetLiteralExpression(
SyntaxKind
token)
545
SyntaxKind
.StringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
546
SyntaxKind
.Utf8StringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
547
SyntaxKind
.SingleLineRawStringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
548
SyntaxKind
.Utf8SingleLineRawStringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
549
SyntaxKind
.MultiLineRawStringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
550
SyntaxKind
.Utf8MultiLineRawStringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
551
SyntaxKind
.CharacterLiteralToken =>
SyntaxKind
.CharacterLiteralExpression,
552
SyntaxKind
.NumericLiteralToken =>
SyntaxKind
.NumericLiteralExpression,
553
SyntaxKind
.NullKeyword =>
SyntaxKind
.NullLiteralExpression,
554
SyntaxKind
.TrueKeyword =>
SyntaxKind
.TrueLiteralExpression,
555
SyntaxKind
.FalseKeyword =>
SyntaxKind
.FalseLiteralExpression,
556
SyntaxKind
.ArgListKeyword =>
SyntaxKind
.ArgListExpression,
557
_ =>
SyntaxKind
.None,
561
public static bool IsInstanceExpression(
SyntaxKind
token)
563
return GetInstanceExpression(token) !=
SyntaxKind
.None;
566
public static
SyntaxKind
GetInstanceExpression(
SyntaxKind
token)
570
case
SyntaxKind
.ThisKeyword:
571
return
SyntaxKind
.ThisExpression;
572
case
SyntaxKind
.BaseKeyword:
573
return
SyntaxKind
.BaseExpression;
575
return
SyntaxKind
.None;
579
public static bool IsBinaryExpression(
SyntaxKind
token)
581
return GetBinaryExpression(token) !=
SyntaxKind
.None;
584
public static bool IsBinaryExpressionOperatorToken(
SyntaxKind
token)
586
return GetBinaryExpression(token) !=
SyntaxKind
.None;
589
public static
SyntaxKind
GetBinaryExpression(
SyntaxKind
token)
593
case
SyntaxKind
.QuestionQuestionToken:
594
return
SyntaxKind
.CoalesceExpression;
595
case
SyntaxKind
.IsKeyword:
596
return
SyntaxKind
.IsExpression;
597
case
SyntaxKind
.AsKeyword:
598
return
SyntaxKind
.AsExpression;
599
case
SyntaxKind
.BarToken:
600
return
SyntaxKind
.BitwiseOrExpression;
601
case
SyntaxKind
.CaretToken:
602
return
SyntaxKind
.ExclusiveOrExpression;
603
case
SyntaxKind
.AmpersandToken:
604
return
SyntaxKind
.BitwiseAndExpression;
605
case
SyntaxKind
.EqualsEqualsToken:
606
return
SyntaxKind
.EqualsExpression;
607
case
SyntaxKind
.ExclamationEqualsToken:
608
return
SyntaxKind
.NotEqualsExpression;
609
case
SyntaxKind
.LessThanToken:
610
return
SyntaxKind
.LessThanExpression;
611
case
SyntaxKind
.LessThanEqualsToken:
612
return
SyntaxKind
.LessThanOrEqualExpression;
613
case
SyntaxKind
.GreaterThanToken:
614
return
SyntaxKind
.GreaterThanExpression;
615
case
SyntaxKind
.GreaterThanEqualsToken:
616
return
SyntaxKind
.GreaterThanOrEqualExpression;
617
case
SyntaxKind
.LessThanLessThanToken:
618
return
SyntaxKind
.LeftShiftExpression;
619
case
SyntaxKind
.GreaterThanGreaterThanToken:
620
return
SyntaxKind
.RightShiftExpression;
621
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
622
return
SyntaxKind
.UnsignedRightShiftExpression;
623
case
SyntaxKind
.PlusToken:
624
return
SyntaxKind
.AddExpression;
625
case
SyntaxKind
.MinusToken:
626
return
SyntaxKind
.SubtractExpression;
627
case
SyntaxKind
.AsteriskToken:
628
return
SyntaxKind
.MultiplyExpression;
629
case
SyntaxKind
.SlashToken:
630
return
SyntaxKind
.DivideExpression;
631
case
SyntaxKind
.PercentToken:
632
return
SyntaxKind
.ModuloExpression;
633
case
SyntaxKind
.AmpersandAmpersandToken:
634
return
SyntaxKind
.LogicalAndExpression;
635
case
SyntaxKind
.BarBarToken:
636
return
SyntaxKind
.LogicalOrExpression;
638
return
SyntaxKind
.None;
642
public static bool IsAssignmentExpression(
SyntaxKind
kind)
646
case
SyntaxKind
.CoalesceAssignmentExpression:
647
case
SyntaxKind
.OrAssignmentExpression:
648
case
SyntaxKind
.AndAssignmentExpression:
649
case
SyntaxKind
.ExclusiveOrAssignmentExpression:
650
case
SyntaxKind
.LeftShiftAssignmentExpression:
651
case
SyntaxKind
.RightShiftAssignmentExpression:
652
case
SyntaxKind
.UnsignedRightShiftAssignmentExpression:
653
case
SyntaxKind
.AddAssignmentExpression:
654
case
SyntaxKind
.SubtractAssignmentExpression:
655
case
SyntaxKind
.MultiplyAssignmentExpression:
656
case
SyntaxKind
.DivideAssignmentExpression:
657
case
SyntaxKind
.ModuloAssignmentExpression:
658
case
SyntaxKind
.SimpleAssignmentExpression:
665
public static bool IsAssignmentExpressionOperatorToken(
SyntaxKind
token)
669
case
SyntaxKind
.QuestionQuestionEqualsToken:
670
case
SyntaxKind
.BarEqualsToken:
671
case
SyntaxKind
.AmpersandEqualsToken:
672
case
SyntaxKind
.CaretEqualsToken:
673
case
SyntaxKind
.LessThanLessThanEqualsToken:
674
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
675
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
676
case
SyntaxKind
.PlusEqualsToken:
677
case
SyntaxKind
.MinusEqualsToken:
678
case
SyntaxKind
.AsteriskEqualsToken:
679
case
SyntaxKind
.SlashEqualsToken:
680
case
SyntaxKind
.PercentEqualsToken:
681
case
SyntaxKind
.EqualsToken:
688
public static
SyntaxKind
GetAssignmentExpression(
SyntaxKind
token)
692
case
SyntaxKind
.BarEqualsToken:
693
return
SyntaxKind
.OrAssignmentExpression;
694
case
SyntaxKind
.AmpersandEqualsToken:
695
return
SyntaxKind
.AndAssignmentExpression;
696
case
SyntaxKind
.CaretEqualsToken:
697
return
SyntaxKind
.ExclusiveOrAssignmentExpression;
698
case
SyntaxKind
.LessThanLessThanEqualsToken:
699
return
SyntaxKind
.LeftShiftAssignmentExpression;
700
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
701
return
SyntaxKind
.RightShiftAssignmentExpression;
702
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
703
return
SyntaxKind
.UnsignedRightShiftAssignmentExpression;
704
case
SyntaxKind
.PlusEqualsToken:
705
return
SyntaxKind
.AddAssignmentExpression;
706
case
SyntaxKind
.MinusEqualsToken:
707
return
SyntaxKind
.SubtractAssignmentExpression;
708
case
SyntaxKind
.AsteriskEqualsToken:
709
return
SyntaxKind
.MultiplyAssignmentExpression;
710
case
SyntaxKind
.SlashEqualsToken:
711
return
SyntaxKind
.DivideAssignmentExpression;
712
case
SyntaxKind
.PercentEqualsToken:
713
return
SyntaxKind
.ModuloAssignmentExpression;
714
case
SyntaxKind
.EqualsToken:
715
return
SyntaxKind
.SimpleAssignmentExpression;
716
case
SyntaxKind
.QuestionQuestionEqualsToken:
717
return
SyntaxKind
.CoalesceAssignmentExpression;
719
return
SyntaxKind
.None;
723
public static
SyntaxKind
GetCheckStatement(
SyntaxKind
keyword)
727
case
SyntaxKind
.CheckedKeyword:
728
return
SyntaxKind
.CheckedStatement;
729
case
SyntaxKind
.UncheckedKeyword:
730
return
SyntaxKind
.UncheckedStatement;
732
return
SyntaxKind
.None;
736
public static
SyntaxKind
GetAccessorDeclarationKind(
SyntaxKind
keyword)
740
case
SyntaxKind
.GetKeyword:
741
return
SyntaxKind
.GetAccessorDeclaration;
742
case
SyntaxKind
.SetKeyword:
743
return
SyntaxKind
.SetAccessorDeclaration;
744
case
SyntaxKind
.InitKeyword:
745
return
SyntaxKind
.InitAccessorDeclaration;
746
case
SyntaxKind
.AddKeyword:
747
return
SyntaxKind
.AddAccessorDeclaration;
748
case
SyntaxKind
.RemoveKeyword:
749
return
SyntaxKind
.RemoveAccessorDeclaration;
751
return
SyntaxKind
.None;
755
public static bool IsAccessorDeclaration(
SyntaxKind
kind)
759
case
SyntaxKind
.GetAccessorDeclaration:
760
case
SyntaxKind
.SetAccessorDeclaration:
761
case
SyntaxKind
.InitAccessorDeclaration:
762
case
SyntaxKind
.AddAccessorDeclaration:
763
case
SyntaxKind
.RemoveAccessorDeclaration:
770
public static bool IsAccessorDeclarationKeyword(
SyntaxKind
keyword)
774
case
SyntaxKind
.GetKeyword:
775
case
SyntaxKind
.SetKeyword:
776
case
SyntaxKind
.InitKeyword:
777
case
SyntaxKind
.AddKeyword:
778
case
SyntaxKind
.RemoveKeyword:
785
public static
SyntaxKind
GetSwitchLabelKind(
SyntaxKind
keyword)
789
case
SyntaxKind
.CaseKeyword:
790
return
SyntaxKind
.CaseSwitchLabel;
791
case
SyntaxKind
.DefaultKeyword:
792
return
SyntaxKind
.DefaultSwitchLabel;
794
return
SyntaxKind
.None;
798
public static
SyntaxKind
GetBaseTypeDeclarationKind(
SyntaxKind
kind)
800
return kind ==
SyntaxKind
.EnumKeyword ?
SyntaxKind
.EnumDeclaration : GetTypeDeclarationKind(kind);
803
public static
SyntaxKind
GetTypeDeclarationKind(
SyntaxKind
kind)
807
case
SyntaxKind
.ClassKeyword:
808
return
SyntaxKind
.ClassDeclaration;
809
case
SyntaxKind
.StructKeyword:
810
return
SyntaxKind
.StructDeclaration;
811
case
SyntaxKind
.InterfaceKeyword:
812
return
SyntaxKind
.InterfaceDeclaration;
813
case
SyntaxKind
.RecordKeyword:
814
return
SyntaxKind
.RecordDeclaration;
816
return
SyntaxKind
.None;
820
public static
SyntaxKind
GetKeywordKind(string text)
825
return
SyntaxKind
.BoolKeyword;
827
return
SyntaxKind
.ByteKeyword;
829
return
SyntaxKind
.SByteKeyword;
831
return
SyntaxKind
.ShortKeyword;
833
return
SyntaxKind
.UShortKeyword;
835
return
SyntaxKind
.IntKeyword;
837
return
SyntaxKind
.UIntKeyword;
839
return
SyntaxKind
.LongKeyword;
841
return
SyntaxKind
.ULongKeyword;
843
return
SyntaxKind
.DoubleKeyword;
845
return
SyntaxKind
.FloatKeyword;
847
return
SyntaxKind
.DecimalKeyword;
849
return
SyntaxKind
.StringKeyword;
851
return
SyntaxKind
.CharKeyword;
853
return
SyntaxKind
.VoidKeyword;
855
return
SyntaxKind
.ObjectKeyword;
857
return
SyntaxKind
.TypeOfKeyword;
859
return
SyntaxKind
.SizeOfKeyword;
861
return
SyntaxKind
.NullKeyword;
863
return
SyntaxKind
.TrueKeyword;
865
return
SyntaxKind
.FalseKeyword;
867
return
SyntaxKind
.IfKeyword;
869
return
SyntaxKind
.ElseKeyword;
871
return
SyntaxKind
.WhileKeyword;
873
return
SyntaxKind
.ForKeyword;
875
return
SyntaxKind
.ForEachKeyword;
877
return
SyntaxKind
.DoKeyword;
879
return
SyntaxKind
.SwitchKeyword;
881
return
SyntaxKind
.CaseKeyword;
883
return
SyntaxKind
.DefaultKeyword;
885
return
SyntaxKind
.LockKeyword;
887
return
SyntaxKind
.TryKeyword;
889
return
SyntaxKind
.ThrowKeyword;
891
return
SyntaxKind
.CatchKeyword;
893
return
SyntaxKind
.FinallyKeyword;
895
return
SyntaxKind
.GotoKeyword;
897
return
SyntaxKind
.BreakKeyword;
899
return
SyntaxKind
.ContinueKeyword;
901
return
SyntaxKind
.ReturnKeyword;
903
return
SyntaxKind
.PublicKeyword;
905
return
SyntaxKind
.PrivateKeyword;
907
return
SyntaxKind
.InternalKeyword;
909
return
SyntaxKind
.ProtectedKeyword;
911
return
SyntaxKind
.StaticKeyword;
913
return
SyntaxKind
.ReadOnlyKeyword;
915
return
SyntaxKind
.SealedKeyword;
917
return
SyntaxKind
.ConstKeyword;
919
return
SyntaxKind
.FixedKeyword;
921
return
SyntaxKind
.StackAllocKeyword;
923
return
SyntaxKind
.VolatileKeyword;
925
return
SyntaxKind
.NewKeyword;
927
return
SyntaxKind
.OverrideKeyword;
929
return
SyntaxKind
.AbstractKeyword;
931
return
SyntaxKind
.VirtualKeyword;
933
return
SyntaxKind
.EventKeyword;
935
return
SyntaxKind
.ExternKeyword;
937
return
SyntaxKind
.RefKeyword;
939
return
SyntaxKind
.OutKeyword;
941
return
SyntaxKind
.InKeyword;
943
return
SyntaxKind
.IsKeyword;
945
return
SyntaxKind
.AsKeyword;
947
return
SyntaxKind
.ParamsKeyword;
949
return
SyntaxKind
.ArgListKeyword;
951
return
SyntaxKind
.MakeRefKeyword;
953
return
SyntaxKind
.RefTypeKeyword;
955
return
SyntaxKind
.RefValueKeyword;
957
return
SyntaxKind
.ThisKeyword;
959
return
SyntaxKind
.BaseKeyword;
961
return
SyntaxKind
.NamespaceKeyword;
963
return
SyntaxKind
.UsingKeyword;
965
return
SyntaxKind
.ClassKeyword;
967
return
SyntaxKind
.StructKeyword;
969
return
SyntaxKind
.InterfaceKeyword;
971
return
SyntaxKind
.EnumKeyword;
973
return
SyntaxKind
.DelegateKeyword;
975
return
SyntaxKind
.CheckedKeyword;
977
return
SyntaxKind
.UncheckedKeyword;
979
return
SyntaxKind
.UnsafeKeyword;
981
return
SyntaxKind
.OperatorKeyword;
983
return
SyntaxKind
.ImplicitKeyword;
985
return
SyntaxKind
.ExplicitKeyword;
987
return
SyntaxKind
.None;
991
public static
SyntaxKind
GetOperatorKind(string operatorMetadataName)
997
return
SyntaxKind
.PlusToken;
999
case WellKnownMemberNames.BitwiseAndOperatorName: return
SyntaxKind
.AmpersandToken;
1000
case WellKnownMemberNames.BitwiseOrOperatorName: return
SyntaxKind
.BarToken;
1005
return
SyntaxKind
.MinusMinusToken;
1009
return
SyntaxKind
.SlashToken;
1011
case WellKnownMemberNames.EqualityOperatorName: return
SyntaxKind
.EqualsEqualsToken;
1012
case WellKnownMemberNames.ExclusiveOrOperatorName: return
SyntaxKind
.CaretToken;
1016
return
SyntaxKind
.ExplicitKeyword;
1019
case WellKnownMemberNames.FalseOperatorName: return
SyntaxKind
.FalseKeyword;
1020
case WellKnownMemberNames.GreaterThanOperatorName: return
SyntaxKind
.GreaterThanToken;
1021
case WellKnownMemberNames.GreaterThanOrEqualOperatorName: return
SyntaxKind
.GreaterThanEqualsToken;
1022
case WellKnownMemberNames.ImplicitConversionName: return
SyntaxKind
.ImplicitKeyword;
1026
return
SyntaxKind
.PlusPlusToken;
1028
case WellKnownMemberNames.InequalityOperatorName: return
SyntaxKind
.ExclamationEqualsToken;
1030
case WellKnownMemberNames.LeftShiftOperatorName: return
SyntaxKind
.LessThanLessThanToken;
1031
case WellKnownMemberNames.LessThanOperatorName: return
SyntaxKind
.LessThanToken;
1032
case WellKnownMemberNames.LessThanOrEqualOperatorName: return
SyntaxKind
.LessThanEqualsToken;
1034
case WellKnownMemberNames.LogicalNotOperatorName: return
SyntaxKind
.ExclamationToken;
1035
case WellKnownMemberNames.ModulusOperatorName: return
SyntaxKind
.PercentToken;
1039
return
SyntaxKind
.AsteriskToken;
1041
case WellKnownMemberNames.OnesComplementOperatorName: return
SyntaxKind
.TildeToken;
1042
case WellKnownMemberNames.RightShiftOperatorName: return
SyntaxKind
.GreaterThanGreaterThanToken;
1043
case WellKnownMemberNames.UnsignedRightShiftOperatorName: return
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken;
1047
return
SyntaxKind
.MinusToken;
1049
case WellKnownMemberNames.TrueOperatorName: return
SyntaxKind
.TrueKeyword;
1053
return
SyntaxKind
.MinusToken;
1055
case WellKnownMemberNames.UnaryPlusOperatorName: return
SyntaxKind
.PlusToken;
1057
return
SyntaxKind
.None;
1080
public static
SyntaxKind
GetPreprocessorKeywordKind(string text)
1085
return
SyntaxKind
.TrueKeyword;
1087
return
SyntaxKind
.FalseKeyword;
1089
return
SyntaxKind
.DefaultKeyword;
1091
return
SyntaxKind
.IfKeyword;
1093
return
SyntaxKind
.ElseKeyword;
1095
return
SyntaxKind
.ElifKeyword;
1097
return
SyntaxKind
.EndIfKeyword;
1099
return
SyntaxKind
.RegionKeyword;
1101
return
SyntaxKind
.EndRegionKeyword;
1103
return
SyntaxKind
.DefineKeyword;
1105
return
SyntaxKind
.UndefKeyword;
1107
return
SyntaxKind
.WarningKeyword;
1109
return
SyntaxKind
.ErrorKeyword;
1111
return
SyntaxKind
.LineKeyword;
1113
return
SyntaxKind
.PragmaKeyword;
1115
return
SyntaxKind
.HiddenKeyword;
1117
return
SyntaxKind
.ChecksumKeyword;
1119
return
SyntaxKind
.DisableKeyword;
1121
return
SyntaxKind
.RestoreKeyword;
1123
return
SyntaxKind
.ReferenceKeyword;
1125
return
SyntaxKind
.LoadKeyword;
1127
return
SyntaxKind
.NullableKeyword;
1129
return
SyntaxKind
.EnableKeyword;
1131
return
SyntaxKind
.WarningsKeyword;
1133
return
SyntaxKind
.AnnotationsKeyword;
1135
return
SyntaxKind
.None;
1139
public static IEnumerable<
SyntaxKind
> GetContextualKeywordKinds()
1141
for (int i = (int)
SyntaxKind
.YieldKeyword; i <= (int)
SyntaxKind
.FileKeyword; i++)
1143
yield return (
SyntaxKind
)i;
1147
public static bool IsContextualKeyword(
SyntaxKind
kind)
1151
case
SyntaxKind
.YieldKeyword:
1152
case
SyntaxKind
.PartialKeyword:
1153
case
SyntaxKind
.FromKeyword:
1154
case
SyntaxKind
.GroupKeyword:
1155
case
SyntaxKind
.JoinKeyword:
1156
case
SyntaxKind
.IntoKeyword:
1157
case
SyntaxKind
.LetKeyword:
1158
case
SyntaxKind
.ByKeyword:
1159
case
SyntaxKind
.WhereKeyword:
1160
case
SyntaxKind
.SelectKeyword:
1161
case
SyntaxKind
.GetKeyword:
1162
case
SyntaxKind
.SetKeyword:
1163
case
SyntaxKind
.AddKeyword:
1164
case
SyntaxKind
.RemoveKeyword:
1165
case
SyntaxKind
.OrderByKeyword:
1166
case
SyntaxKind
.AliasKeyword:
1167
case
SyntaxKind
.OnKeyword:
1168
case
SyntaxKind
.EqualsKeyword:
1169
case
SyntaxKind
.AscendingKeyword:
1170
case
SyntaxKind
.DescendingKeyword:
1171
case
SyntaxKind
.AssemblyKeyword:
1172
case
SyntaxKind
.ModuleKeyword:
1173
case
SyntaxKind
.TypeKeyword:
1174
case
SyntaxKind
.GlobalKeyword:
1175
case
SyntaxKind
.FieldKeyword:
1176
case
SyntaxKind
.MethodKeyword:
1177
case
SyntaxKind
.ParamKeyword:
1178
case
SyntaxKind
.PropertyKeyword:
1179
case
SyntaxKind
.TypeVarKeyword:
1180
case
SyntaxKind
.NameOfKeyword:
1181
case
SyntaxKind
.AsyncKeyword:
1182
case
SyntaxKind
.AwaitKeyword:
1183
case
SyntaxKind
.WhenKeyword:
1184
case
SyntaxKind
.UnderscoreToken:
1185
case
SyntaxKind
.VarKeyword:
1186
case
SyntaxKind
.OrKeyword:
1187
case
SyntaxKind
.AndKeyword:
1188
case
SyntaxKind
.NotKeyword:
1189
case
SyntaxKind
.WithKeyword:
1190
case
SyntaxKind
.InitKeyword:
1191
case
SyntaxKind
.RecordKeyword:
1192
case
SyntaxKind
.ManagedKeyword:
1193
case
SyntaxKind
.UnmanagedKeyword:
1194
case
SyntaxKind
.RequiredKeyword:
1195
case
SyntaxKind
.ScopedKeyword:
1196
case
SyntaxKind
.FileKeyword:
1203
public static bool IsQueryContextualKeyword(
SyntaxKind
kind)
1207
case
SyntaxKind
.FromKeyword:
1208
case
SyntaxKind
.WhereKeyword:
1209
case
SyntaxKind
.SelectKeyword:
1210
case
SyntaxKind
.GroupKeyword:
1211
case
SyntaxKind
.IntoKeyword:
1212
case
SyntaxKind
.OrderByKeyword:
1213
case
SyntaxKind
.JoinKeyword:
1214
case
SyntaxKind
.LetKeyword:
1215
case
SyntaxKind
.OnKeyword:
1216
case
SyntaxKind
.EqualsKeyword:
1217
case
SyntaxKind
.ByKeyword:
1218
case
SyntaxKind
.AscendingKeyword:
1219
case
SyntaxKind
.DescendingKeyword:
1226
public static
SyntaxKind
GetContextualKeywordKind(string text)
1231
return
SyntaxKind
.YieldKeyword;
1233
return
SyntaxKind
.PartialKeyword;
1235
return
SyntaxKind
.FromKeyword;
1237
return
SyntaxKind
.GroupKeyword;
1239
return
SyntaxKind
.JoinKeyword;
1241
return
SyntaxKind
.IntoKeyword;
1243
return
SyntaxKind
.LetKeyword;
1245
return
SyntaxKind
.ByKeyword;
1247
return
SyntaxKind
.WhereKeyword;
1249
return
SyntaxKind
.SelectKeyword;
1251
return
SyntaxKind
.GetKeyword;
1253
return
SyntaxKind
.SetKeyword;
1255
return
SyntaxKind
.AddKeyword;
1257
return
SyntaxKind
.RemoveKeyword;
1259
return
SyntaxKind
.OrderByKeyword;
1261
return
SyntaxKind
.AliasKeyword;
1263
return
SyntaxKind
.OnKeyword;
1265
return
SyntaxKind
.EqualsKeyword;
1267
return
SyntaxKind
.AscendingKeyword;
1269
return
SyntaxKind
.DescendingKeyword;
1271
return
SyntaxKind
.AssemblyKeyword;
1273
return
SyntaxKind
.ModuleKeyword;
1275
return
SyntaxKind
.TypeKeyword;
1277
return
SyntaxKind
.FieldKeyword;
1279
return
SyntaxKind
.MethodKeyword;
1281
return
SyntaxKind
.ParamKeyword;
1283
return
SyntaxKind
.PropertyKeyword;
1285
return
SyntaxKind
.TypeVarKeyword;
1287
return
SyntaxKind
.GlobalKeyword;
1289
return
SyntaxKind
.AsyncKeyword;
1291
return
SyntaxKind
.AwaitKeyword;
1293
return
SyntaxKind
.WhenKeyword;
1295
return
SyntaxKind
.NameOfKeyword;
1297
return
SyntaxKind
.UnderscoreToken;
1299
return
SyntaxKind
.VarKeyword;
1301
return
SyntaxKind
.AndKeyword;
1303
return
SyntaxKind
.OrKeyword;
1305
return
SyntaxKind
.NotKeyword;
1307
return
SyntaxKind
.WithKeyword;
1309
return
SyntaxKind
.InitKeyword;
1311
return
SyntaxKind
.RecordKeyword;
1313
return
SyntaxKind
.ManagedKeyword;
1315
return
SyntaxKind
.UnmanagedKeyword;
1317
return
SyntaxKind
.RequiredKeyword;
1319
return
SyntaxKind
.ScopedKeyword;
1321
return
SyntaxKind
.FileKeyword;
1323
return
SyntaxKind
.None;
1327
public static string GetText(
SyntaxKind
kind)
1331
case
SyntaxKind
.TildeToken:
1333
case
SyntaxKind
.ExclamationToken:
1335
case
SyntaxKind
.DollarToken:
1337
case
SyntaxKind
.PercentToken:
1339
case
SyntaxKind
.CaretToken:
1341
case
SyntaxKind
.AmpersandToken:
1343
case
SyntaxKind
.AsteriskToken:
1345
case
SyntaxKind
.OpenParenToken:
1347
case
SyntaxKind
.CloseParenToken:
1349
case
SyntaxKind
.MinusToken:
1351
case
SyntaxKind
.PlusToken:
1353
case
SyntaxKind
.EqualsToken:
1355
case
SyntaxKind
.OpenBraceToken:
1357
case
SyntaxKind
.CloseBraceToken:
1359
case
SyntaxKind
.OpenBracketToken:
1361
case
SyntaxKind
.CloseBracketToken:
1363
case
SyntaxKind
.BarToken:
1365
case
SyntaxKind
.BackslashToken:
1367
case
SyntaxKind
.ColonToken:
1369
case
SyntaxKind
.SemicolonToken:
1371
case
SyntaxKind
.DoubleQuoteToken:
1373
case
SyntaxKind
.SingleQuoteToken:
1375
case
SyntaxKind
.LessThanToken:
1377
case
SyntaxKind
.CommaToken:
1379
case
SyntaxKind
.GreaterThanToken:
1381
case
SyntaxKind
.DotToken:
1383
case
SyntaxKind
.QuestionToken:
1385
case
SyntaxKind
.HashToken:
1387
case
SyntaxKind
.SlashToken:
1389
case
SyntaxKind
.SlashGreaterThanToken:
1391
case
SyntaxKind
.LessThanSlashToken:
1393
case
SyntaxKind
.XmlCommentStartToken:
1395
case
SyntaxKind
.XmlCommentEndToken:
1397
case
SyntaxKind
.XmlCDataStartToken:
1399
case
SyntaxKind
.XmlCDataEndToken:
1401
case
SyntaxKind
.XmlProcessingInstructionStartToken:
1403
case
SyntaxKind
.XmlProcessingInstructionEndToken:
1407
case
SyntaxKind
.BarBarToken:
1409
case
SyntaxKind
.AmpersandAmpersandToken:
1411
case
SyntaxKind
.MinusMinusToken:
1413
case
SyntaxKind
.PlusPlusToken:
1415
case
SyntaxKind
.ColonColonToken:
1417
case
SyntaxKind
.QuestionQuestionToken:
1419
case
SyntaxKind
.MinusGreaterThanToken:
1421
case
SyntaxKind
.ExclamationEqualsToken:
1423
case
SyntaxKind
.EqualsEqualsToken:
1425
case
SyntaxKind
.EqualsGreaterThanToken:
1427
case
SyntaxKind
.LessThanEqualsToken:
1429
case
SyntaxKind
.LessThanLessThanToken:
1431
case
SyntaxKind
.LessThanLessThanEqualsToken:
1433
case
SyntaxKind
.GreaterThanEqualsToken:
1435
case
SyntaxKind
.GreaterThanGreaterThanToken:
1437
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
1439
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
1441
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
1443
case
SyntaxKind
.SlashEqualsToken:
1445
case
SyntaxKind
.AsteriskEqualsToken:
1447
case
SyntaxKind
.BarEqualsToken:
1449
case
SyntaxKind
.AmpersandEqualsToken:
1451
case
SyntaxKind
.PlusEqualsToken:
1453
case
SyntaxKind
.MinusEqualsToken:
1455
case
SyntaxKind
.CaretEqualsToken:
1457
case
SyntaxKind
.PercentEqualsToken:
1459
case
SyntaxKind
.QuestionQuestionEqualsToken:
1461
case
SyntaxKind
.DotDotToken:
1465
case
SyntaxKind
.BoolKeyword:
1467
case
SyntaxKind
.ByteKeyword:
1469
case
SyntaxKind
.SByteKeyword:
1471
case
SyntaxKind
.ShortKeyword:
1473
case
SyntaxKind
.UShortKeyword:
1475
case
SyntaxKind
.IntKeyword:
1477
case
SyntaxKind
.UIntKeyword:
1479
case
SyntaxKind
.LongKeyword:
1481
case
SyntaxKind
.ULongKeyword:
1483
case
SyntaxKind
.DoubleKeyword:
1485
case
SyntaxKind
.FloatKeyword:
1487
case
SyntaxKind
.DecimalKeyword:
1489
case
SyntaxKind
.StringKeyword:
1491
case
SyntaxKind
.CharKeyword:
1493
case
SyntaxKind
.VoidKeyword:
1495
case
SyntaxKind
.ObjectKeyword:
1497
case
SyntaxKind
.TypeOfKeyword:
1499
case
SyntaxKind
.SizeOfKeyword:
1501
case
SyntaxKind
.NullKeyword:
1503
case
SyntaxKind
.TrueKeyword:
1505
case
SyntaxKind
.FalseKeyword:
1507
case
SyntaxKind
.IfKeyword:
1509
case
SyntaxKind
.ElseKeyword:
1511
case
SyntaxKind
.WhileKeyword:
1513
case
SyntaxKind
.ForKeyword:
1515
case
SyntaxKind
.ForEachKeyword:
1517
case
SyntaxKind
.DoKeyword:
1519
case
SyntaxKind
.SwitchKeyword:
1521
case
SyntaxKind
.CaseKeyword:
1523
case
SyntaxKind
.DefaultKeyword:
1525
case
SyntaxKind
.TryKeyword:
1527
case
SyntaxKind
.CatchKeyword:
1529
case
SyntaxKind
.FinallyKeyword:
1531
case
SyntaxKind
.LockKeyword:
1533
case
SyntaxKind
.GotoKeyword:
1535
case
SyntaxKind
.BreakKeyword:
1537
case
SyntaxKind
.ContinueKeyword:
1539
case
SyntaxKind
.ReturnKeyword:
1541
case
SyntaxKind
.ThrowKeyword:
1543
case
SyntaxKind
.PublicKeyword:
1545
case
SyntaxKind
.PrivateKeyword:
1547
case
SyntaxKind
.InternalKeyword:
1549
case
SyntaxKind
.ProtectedKeyword:
1551
case
SyntaxKind
.StaticKeyword:
1553
case
SyntaxKind
.ReadOnlyKeyword:
1555
case
SyntaxKind
.SealedKeyword:
1557
case
SyntaxKind
.ConstKeyword:
1559
case
SyntaxKind
.FixedKeyword:
1561
case
SyntaxKind
.StackAllocKeyword:
1563
case
SyntaxKind
.VolatileKeyword:
1565
case
SyntaxKind
.NewKeyword:
1567
case
SyntaxKind
.OverrideKeyword:
1569
case
SyntaxKind
.AbstractKeyword:
1571
case
SyntaxKind
.VirtualKeyword:
1573
case
SyntaxKind
.EventKeyword:
1575
case
SyntaxKind
.ExternKeyword:
1577
case
SyntaxKind
.RefKeyword:
1579
case
SyntaxKind
.OutKeyword:
1581
case
SyntaxKind
.InKeyword:
1583
case
SyntaxKind
.IsKeyword:
1585
case
SyntaxKind
.AsKeyword:
1587
case
SyntaxKind
.ParamsKeyword:
1589
case
SyntaxKind
.ArgListKeyword:
1591
case
SyntaxKind
.MakeRefKeyword:
1593
case
SyntaxKind
.RefTypeKeyword:
1595
case
SyntaxKind
.RefValueKeyword:
1597
case
SyntaxKind
.ThisKeyword:
1599
case
SyntaxKind
.BaseKeyword:
1601
case
SyntaxKind
.NamespaceKeyword:
1603
case
SyntaxKind
.UsingKeyword:
1605
case
SyntaxKind
.ClassKeyword:
1607
case
SyntaxKind
.StructKeyword:
1609
case
SyntaxKind
.InterfaceKeyword:
1611
case
SyntaxKind
.EnumKeyword:
1613
case
SyntaxKind
.DelegateKeyword:
1615
case
SyntaxKind
.CheckedKeyword:
1617
case
SyntaxKind
.UncheckedKeyword:
1619
case
SyntaxKind
.UnsafeKeyword:
1621
case
SyntaxKind
.OperatorKeyword:
1623
case
SyntaxKind
.ImplicitKeyword:
1625
case
SyntaxKind
.ExplicitKeyword:
1627
case
SyntaxKind
.ElifKeyword:
1629
case
SyntaxKind
.EndIfKeyword:
1631
case
SyntaxKind
.RegionKeyword:
1633
case
SyntaxKind
.EndRegionKeyword:
1635
case
SyntaxKind
.DefineKeyword:
1637
case
SyntaxKind
.UndefKeyword:
1639
case
SyntaxKind
.WarningKeyword:
1641
case
SyntaxKind
.ErrorKeyword:
1643
case
SyntaxKind
.LineKeyword:
1645
case
SyntaxKind
.PragmaKeyword:
1647
case
SyntaxKind
.HiddenKeyword:
1649
case
SyntaxKind
.ChecksumKeyword:
1651
case
SyntaxKind
.DisableKeyword:
1653
case
SyntaxKind
.RestoreKeyword:
1655
case
SyntaxKind
.ReferenceKeyword:
1657
case
SyntaxKind
.LoadKeyword:
1659
case
SyntaxKind
.NullableKeyword:
1661
case
SyntaxKind
.EnableKeyword:
1663
case
SyntaxKind
.WarningsKeyword:
1665
case
SyntaxKind
.AnnotationsKeyword:
1669
case
SyntaxKind
.YieldKeyword:
1671
case
SyntaxKind
.PartialKeyword:
1673
case
SyntaxKind
.FromKeyword:
1675
case
SyntaxKind
.GroupKeyword:
1677
case
SyntaxKind
.JoinKeyword:
1679
case
SyntaxKind
.IntoKeyword:
1681
case
SyntaxKind
.LetKeyword:
1683
case
SyntaxKind
.ByKeyword:
1685
case
SyntaxKind
.WhereKeyword:
1687
case
SyntaxKind
.SelectKeyword:
1689
case
SyntaxKind
.GetKeyword:
1691
case
SyntaxKind
.SetKeyword:
1693
case
SyntaxKind
.AddKeyword:
1695
case
SyntaxKind
.RemoveKeyword:
1697
case
SyntaxKind
.OrderByKeyword:
1699
case
SyntaxKind
.AliasKeyword:
1701
case
SyntaxKind
.OnKeyword:
1703
case
SyntaxKind
.EqualsKeyword:
1705
case
SyntaxKind
.AscendingKeyword:
1707
case
SyntaxKind
.DescendingKeyword:
1709
case
SyntaxKind
.AssemblyKeyword:
1711
case
SyntaxKind
.ModuleKeyword:
1713
case
SyntaxKind
.TypeKeyword:
1715
case
SyntaxKind
.FieldKeyword:
1717
case
SyntaxKind
.MethodKeyword:
1719
case
SyntaxKind
.ParamKeyword:
1721
case
SyntaxKind
.PropertyKeyword:
1723
case
SyntaxKind
.TypeVarKeyword:
1725
case
SyntaxKind
.GlobalKeyword:
1727
case
SyntaxKind
.NameOfKeyword:
1729
case
SyntaxKind
.AsyncKeyword:
1731
case
SyntaxKind
.AwaitKeyword:
1733
case
SyntaxKind
.WhenKeyword:
1735
case
SyntaxKind
.InterpolatedStringStartToken:
1737
case
SyntaxKind
.InterpolatedStringEndToken:
1739
case
SyntaxKind
.InterpolatedVerbatimStringStartToken:
1741
case
SyntaxKind
.UnderscoreToken:
1743
case
SyntaxKind
.VarKeyword:
1745
case
SyntaxKind
.AndKeyword:
1747
case
SyntaxKind
.OrKeyword:
1749
case
SyntaxKind
.NotKeyword:
1751
case
SyntaxKind
.WithKeyword:
1753
case
SyntaxKind
.InitKeyword:
1755
case
SyntaxKind
.RecordKeyword:
1757
case
SyntaxKind
.ManagedKeyword:
1759
case
SyntaxKind
.UnmanagedKeyword:
1761
case
SyntaxKind
.RequiredKeyword:
1763
case
SyntaxKind
.ScopedKeyword:
1765
case
SyntaxKind
.FileKeyword:
1772
public static bool IsTypeParameterVarianceKeyword(
SyntaxKind
kind)
1774
return kind ==
SyntaxKind
.OutKeyword || kind ==
SyntaxKind
.InKeyword;
1777
public static bool IsDocumentationCommentTrivia(
SyntaxKind
kind)
1779
return kind ==
SyntaxKind
.SingleLineDocumentationCommentTrivia ||
1780
kind ==
SyntaxKind
.MultiLineDocumentationCommentTrivia;