987 references to SyntaxKind
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (987)
src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (984)
13
public static bool IsKeywordKind(
SyntaxKind
kind)
18
public static IEnumerable<
SyntaxKind
> GetReservedKeywordKinds()
20
for (int i = (int)
SyntaxKind
.BoolKeyword; i <= (int)
SyntaxKind
.ImplicitKeyword; i++)
22
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
23
yield return (
SyntaxKind
)i;
27
public static IEnumerable<
SyntaxKind
> GetKeywordKinds()
29
foreach (
var
reserved in GetReservedKeywordKinds())
34
foreach (
var
contextual in GetContextualKeywordKinds())
40
public static bool IsReservedKeyword(
SyntaxKind
kind)
42
return kind >=
SyntaxKind
.BoolKeyword && kind <=
SyntaxKind
.ImplicitKeyword;
45
public static bool IsAttributeTargetSpecifier(
SyntaxKind
kind)
49
case
SyntaxKind
.AssemblyKeyword:
50
case
SyntaxKind
.ModuleKeyword:
51
case
SyntaxKind
.EventKeyword:
52
case
SyntaxKind
.FieldKeyword:
53
case
SyntaxKind
.MethodKeyword:
54
case
SyntaxKind
.ParamKeyword:
55
case
SyntaxKind
.PropertyKeyword:
56
case
SyntaxKind
.ReturnKeyword:
57
case
SyntaxKind
.TypeKeyword:
58
case
SyntaxKind
.TypeVarKeyword:
65
public static bool IsAccessibilityModifier(
SyntaxKind
kind)
69
case
SyntaxKind
.PrivateKeyword:
70
case
SyntaxKind
.ProtectedKeyword:
71
case
SyntaxKind
.InternalKeyword:
72
case
SyntaxKind
.PublicKeyword:
79
public static bool IsPreprocessorKeyword(
SyntaxKind
kind)
83
case
SyntaxKind
.TrueKeyword:
84
case
SyntaxKind
.FalseKeyword:
85
case
SyntaxKind
.DefaultKeyword:
86
case
SyntaxKind
.IfKeyword:
87
case
SyntaxKind
.ElseKeyword:
88
case
SyntaxKind
.ElifKeyword:
89
case
SyntaxKind
.EndIfKeyword:
90
case
SyntaxKind
.RegionKeyword:
91
case
SyntaxKind
.EndRegionKeyword:
92
case
SyntaxKind
.DefineKeyword:
93
case
SyntaxKind
.UndefKeyword:
94
case
SyntaxKind
.WarningKeyword:
95
case
SyntaxKind
.ErrorKeyword:
96
case
SyntaxKind
.LineKeyword:
97
case
SyntaxKind
.PragmaKeyword:
98
case
SyntaxKind
.HiddenKeyword:
99
case
SyntaxKind
.ChecksumKeyword:
100
case
SyntaxKind
.DisableKeyword:
101
case
SyntaxKind
.RestoreKeyword:
102
case
SyntaxKind
.ReferenceKeyword:
103
case
SyntaxKind
.LoadKeyword:
104
case
SyntaxKind
.NullableKeyword:
105
case
SyntaxKind
.EnableKeyword:
106
case
SyntaxKind
.WarningsKeyword:
107
case
SyntaxKind
.AnnotationsKeyword:
123
internal static bool IsPreprocessorContextualKeyword(
SyntaxKind
kind)
127
case
SyntaxKind
.TrueKeyword:
128
case
SyntaxKind
.FalseKeyword:
129
case
SyntaxKind
.DefaultKeyword:
130
case
SyntaxKind
.HiddenKeyword:
131
case
SyntaxKind
.ChecksumKeyword:
132
case
SyntaxKind
.DisableKeyword:
133
case
SyntaxKind
.RestoreKeyword:
134
case
SyntaxKind
.EnableKeyword:
135
case
SyntaxKind
.WarningsKeyword:
136
case
SyntaxKind
.AnnotationsKeyword:
143
public static IEnumerable<
SyntaxKind
> GetPreprocessorKeywordKinds()
145
yield return
SyntaxKind
.TrueKeyword;
146
yield return
SyntaxKind
.FalseKeyword;
147
yield return
SyntaxKind
.DefaultKeyword;
149
for (int i = (int)
SyntaxKind
.ElifKeyword; i <= (int)
SyntaxKind
.RestoreKeyword; i++)
151
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
152
yield return (
SyntaxKind
)i;
156
public static bool IsPunctuation(
SyntaxKind
kind)
158
return kind >=
SyntaxKind
.TildeToken && kind <=
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken;
161
public static bool IsLanguagePunctuation(
SyntaxKind
kind)
166
public static bool IsPreprocessorPunctuation(
SyntaxKind
kind)
168
return kind ==
SyntaxKind
.HashToken;
171
private static bool IsDebuggerSpecialPunctuation(
SyntaxKind
kind)
174
return kind ==
SyntaxKind
.DollarToken;
177
public static IEnumerable<
SyntaxKind
> GetPunctuationKinds()
179
for (int i = (int)
SyntaxKind
.TildeToken; i <= (int)
SyntaxKind
.DotDotToken; i++)
181
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
182
yield return (
SyntaxKind
)i;
185
for (int i = (int)
SyntaxKind
.SlashGreaterThanToken; i <= (int)
SyntaxKind
.XmlProcessingInstructionEndToken; i++)
187
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
188
yield return (
SyntaxKind
)i;
191
for (int i = (int)
SyntaxKind
.BarBarToken; i <= (int)
SyntaxKind
.QuestionQuestionEqualsToken; i++)
193
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
194
yield return (
SyntaxKind
)i;
197
yield return
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken;
198
yield return
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken;
201
public static bool IsPunctuationOrKeyword(
SyntaxKind
kind)
203
return kind >=
SyntaxKind
.TildeToken && kind <=
SyntaxKind
.EndOfFileToken;
206
internal static bool IsLiteral(
SyntaxKind
kind)
210
case
SyntaxKind
.IdentifierToken:
211
case
SyntaxKind
.StringLiteralToken:
212
case
SyntaxKind
.Utf8StringLiteralToken:
213
case
SyntaxKind
.SingleLineRawStringLiteralToken:
214
case
SyntaxKind
.Utf8SingleLineRawStringLiteralToken:
215
case
SyntaxKind
.MultiLineRawStringLiteralToken:
216
case
SyntaxKind
.Utf8MultiLineRawStringLiteralToken:
217
case
SyntaxKind
.CharacterLiteralToken:
218
case
SyntaxKind
.NumericLiteralToken:
219
case
SyntaxKind
.XmlTextLiteralToken:
220
case
SyntaxKind
.XmlTextLiteralNewLineToken:
221
case
SyntaxKind
.XmlEntityLiteralToken:
228
public static bool IsAnyToken(
SyntaxKind
kind)
230
if (kind >=
SyntaxKind
.TildeToken && kind <
SyntaxKind
.EndOfLineTrivia) return true;
233
case
SyntaxKind
.InterpolatedStringToken:
234
case
SyntaxKind
.InterpolatedStringStartToken:
235
case
SyntaxKind
.InterpolatedVerbatimStringStartToken:
236
case
SyntaxKind
.InterpolatedMultiLineRawStringStartToken:
237
case
SyntaxKind
.InterpolatedSingleLineRawStringStartToken:
238
case
SyntaxKind
.InterpolatedStringTextToken:
239
case
SyntaxKind
.InterpolatedStringEndToken:
240
case
SyntaxKind
.InterpolatedRawStringEndToken:
241
case
SyntaxKind
.LoadKeyword:
242
case
SyntaxKind
.NullableKeyword:
243
case
SyntaxKind
.EnableKeyword:
244
case
SyntaxKind
.UnderscoreToken:
245
case
SyntaxKind
.MultiLineRawStringLiteralToken:
246
case
SyntaxKind
.SingleLineRawStringLiteralToken:
253
public static bool IsTrivia(
SyntaxKind
kind)
257
case
SyntaxKind
.EndOfLineTrivia:
258
case
SyntaxKind
.WhitespaceTrivia:
259
case
SyntaxKind
.SingleLineCommentTrivia:
260
case
SyntaxKind
.MultiLineCommentTrivia:
261
case
SyntaxKind
.SingleLineDocumentationCommentTrivia:
262
case
SyntaxKind
.MultiLineDocumentationCommentTrivia:
263
case
SyntaxKind
.DisabledTextTrivia:
264
case
SyntaxKind
.DocumentationCommentExteriorTrivia:
265
case
SyntaxKind
.ConflictMarkerTrivia:
272
public static bool IsPreprocessorDirective(
SyntaxKind
kind)
276
case
SyntaxKind
.IfDirectiveTrivia:
277
case
SyntaxKind
.ElifDirectiveTrivia:
278
case
SyntaxKind
.ElseDirectiveTrivia:
279
case
SyntaxKind
.EndIfDirectiveTrivia:
280
case
SyntaxKind
.RegionDirectiveTrivia:
281
case
SyntaxKind
.EndRegionDirectiveTrivia:
282
case
SyntaxKind
.DefineDirectiveTrivia:
283
case
SyntaxKind
.UndefDirectiveTrivia:
284
case
SyntaxKind
.ErrorDirectiveTrivia:
285
case
SyntaxKind
.WarningDirectiveTrivia:
286
case
SyntaxKind
.LineDirectiveTrivia:
287
case
SyntaxKind
.LineSpanDirectiveTrivia:
288
case
SyntaxKind
.PragmaWarningDirectiveTrivia:
289
case
SyntaxKind
.PragmaChecksumDirectiveTrivia:
290
case
SyntaxKind
.ReferenceDirectiveTrivia:
291
case
SyntaxKind
.LoadDirectiveTrivia:
292
case
SyntaxKind
.BadDirectiveTrivia:
293
case
SyntaxKind
.ShebangDirectiveTrivia:
294
case
SyntaxKind
.NullableDirectiveTrivia:
301
public static bool IsName(
SyntaxKind
kind)
305
case
SyntaxKind
.IdentifierName:
306
case
SyntaxKind
.GenericName:
307
case
SyntaxKind
.QualifiedName:
308
case
SyntaxKind
.AliasQualifiedName:
315
public static bool IsPredefinedType(
SyntaxKind
kind)
319
case
SyntaxKind
.BoolKeyword:
320
case
SyntaxKind
.ByteKeyword:
321
case
SyntaxKind
.SByteKeyword:
322
case
SyntaxKind
.IntKeyword:
323
case
SyntaxKind
.UIntKeyword:
324
case
SyntaxKind
.ShortKeyword:
325
case
SyntaxKind
.UShortKeyword:
326
case
SyntaxKind
.LongKeyword:
327
case
SyntaxKind
.ULongKeyword:
328
case
SyntaxKind
.FloatKeyword:
329
case
SyntaxKind
.DoubleKeyword:
330
case
SyntaxKind
.DecimalKeyword:
331
case
SyntaxKind
.StringKeyword:
332
case
SyntaxKind
.CharKeyword:
333
case
SyntaxKind
.ObjectKeyword:
334
case
SyntaxKind
.VoidKeyword:
341
public static bool IsTypeSyntax(
SyntaxKind
kind)
345
case
SyntaxKind
.ArrayType:
346
case
SyntaxKind
.PointerType:
347
case
SyntaxKind
.NullableType:
348
case
SyntaxKind
.PredefinedType:
349
case
SyntaxKind
.TupleType:
350
case
SyntaxKind
.FunctionPointerType:
360
public static bool IsGlobalMemberDeclaration(
SyntaxKind
kind)
364
case
SyntaxKind
.GlobalStatement:
365
case
SyntaxKind
.FieldDeclaration:
366
case
SyntaxKind
.MethodDeclaration:
367
case
SyntaxKind
.PropertyDeclaration:
368
case
SyntaxKind
.EventDeclaration:
369
case
SyntaxKind
.EventFieldDeclaration:
375
public static bool IsTypeDeclaration(
SyntaxKind
kind)
379
case
SyntaxKind
.ClassDeclaration:
380
case
SyntaxKind
.StructDeclaration:
381
case
SyntaxKind
.InterfaceDeclaration:
382
case
SyntaxKind
.DelegateDeclaration:
383
case
SyntaxKind
.EnumDeclaration:
384
case
SyntaxKind
.RecordDeclaration:
385
case
SyntaxKind
.RecordStructDeclaration:
393
public static bool IsNamespaceMemberDeclaration(
SyntaxKind
kind)
395
kind ==
SyntaxKind
.NamespaceDeclaration ||
396
kind ==
SyntaxKind
.FileScopedNamespaceDeclaration;
398
public static bool IsAnyUnaryExpression(
SyntaxKind
token)
403
public static bool IsPrefixUnaryExpression(
SyntaxKind
token)
405
return GetPrefixUnaryExpression(token) !=
SyntaxKind
.None;
408
public static bool IsPrefixUnaryExpressionOperatorToken(
SyntaxKind
token)
410
return GetPrefixUnaryExpression(token) !=
SyntaxKind
.None;
413
public static
SyntaxKind
GetPrefixUnaryExpression(
SyntaxKind
token)
417
case
SyntaxKind
.PlusToken:
418
return
SyntaxKind
.UnaryPlusExpression;
419
case
SyntaxKind
.MinusToken:
420
return
SyntaxKind
.UnaryMinusExpression;
421
case
SyntaxKind
.TildeToken:
422
return
SyntaxKind
.BitwiseNotExpression;
423
case
SyntaxKind
.ExclamationToken:
424
return
SyntaxKind
.LogicalNotExpression;
425
case
SyntaxKind
.PlusPlusToken:
426
return
SyntaxKind
.PreIncrementExpression;
427
case
SyntaxKind
.MinusMinusToken:
428
return
SyntaxKind
.PreDecrementExpression;
429
case
SyntaxKind
.AmpersandToken:
430
return
SyntaxKind
.AddressOfExpression;
431
case
SyntaxKind
.AsteriskToken:
432
return
SyntaxKind
.PointerIndirectionExpression;
433
case
SyntaxKind
.CaretToken:
434
return
SyntaxKind
.IndexExpression;
436
return
SyntaxKind
.None;
440
public static bool IsPostfixUnaryExpression(
SyntaxKind
token)
442
return GetPostfixUnaryExpression(token) !=
SyntaxKind
.None;
445
public static bool IsPostfixUnaryExpressionToken(
SyntaxKind
token)
447
return GetPostfixUnaryExpression(token) !=
SyntaxKind
.None;
450
public static
SyntaxKind
GetPostfixUnaryExpression(
SyntaxKind
token)
454
case
SyntaxKind
.PlusPlusToken:
455
return
SyntaxKind
.PostIncrementExpression;
456
case
SyntaxKind
.MinusMinusToken:
457
return
SyntaxKind
.PostDecrementExpression;
458
case
SyntaxKind
.ExclamationToken:
459
return
SyntaxKind
.SuppressNullableWarningExpression;
461
return
SyntaxKind
.None;
465
internal static bool IsIncrementOrDecrementOperator(
SyntaxKind
token)
469
case
SyntaxKind
.PlusPlusToken:
470
case
SyntaxKind
.MinusMinusToken:
477
public static bool IsUnaryOperatorDeclarationToken(
SyntaxKind
token)
480
token ==
SyntaxKind
.TrueKeyword ||
481
token ==
SyntaxKind
.FalseKeyword;
484
public static bool IsAnyOverloadableOperator(
SyntaxKind
kind)
489
public static bool IsOverloadableBinaryOperator(
SyntaxKind
kind)
493
case
SyntaxKind
.PlusToken:
494
case
SyntaxKind
.MinusToken:
495
case
SyntaxKind
.AsteriskToken:
496
case
SyntaxKind
.SlashToken:
497
case
SyntaxKind
.PercentToken:
498
case
SyntaxKind
.CaretToken:
499
case
SyntaxKind
.AmpersandToken:
500
case
SyntaxKind
.BarToken:
501
case
SyntaxKind
.EqualsEqualsToken:
502
case
SyntaxKind
.LessThanToken:
503
case
SyntaxKind
.LessThanEqualsToken:
504
case
SyntaxKind
.LessThanLessThanToken:
505
case
SyntaxKind
.GreaterThanToken:
506
case
SyntaxKind
.GreaterThanEqualsToken:
507
case
SyntaxKind
.GreaterThanGreaterThanToken:
508
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
509
case
SyntaxKind
.ExclamationEqualsToken:
516
public static bool IsOverloadableUnaryOperator(
SyntaxKind
kind)
520
case
SyntaxKind
.PlusToken:
521
case
SyntaxKind
.MinusToken:
522
case
SyntaxKind
.TildeToken:
523
case
SyntaxKind
.ExclamationToken:
524
case
SyntaxKind
.PlusPlusToken:
525
case
SyntaxKind
.MinusMinusToken:
526
case
SyntaxKind
.TrueKeyword:
527
case
SyntaxKind
.FalseKeyword:
534
public static bool IsPrimaryFunction(
SyntaxKind
keyword)
536
return GetPrimaryFunction(keyword) !=
SyntaxKind
.None;
539
public static
SyntaxKind
GetPrimaryFunction(
SyntaxKind
keyword)
543
case
SyntaxKind
.MakeRefKeyword:
544
return
SyntaxKind
.MakeRefExpression;
545
case
SyntaxKind
.RefTypeKeyword:
546
return
SyntaxKind
.RefTypeExpression;
547
case
SyntaxKind
.RefValueKeyword:
548
return
SyntaxKind
.RefValueExpression;
549
case
SyntaxKind
.CheckedKeyword:
550
return
SyntaxKind
.CheckedExpression;
551
case
SyntaxKind
.UncheckedKeyword:
552
return
SyntaxKind
.UncheckedExpression;
553
case
SyntaxKind
.DefaultKeyword:
554
return
SyntaxKind
.DefaultExpression;
555
case
SyntaxKind
.TypeOfKeyword:
556
return
SyntaxKind
.TypeOfExpression;
557
case
SyntaxKind
.SizeOfKeyword:
558
return
SyntaxKind
.SizeOfExpression;
560
return
SyntaxKind
.None;
564
public static bool IsLiteralExpression(
SyntaxKind
token)
566
return GetLiteralExpression(token) !=
SyntaxKind
.None;
569
public static
SyntaxKind
GetLiteralExpression(
SyntaxKind
token)
573
SyntaxKind
.StringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
574
SyntaxKind
.Utf8StringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
575
SyntaxKind
.SingleLineRawStringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
576
SyntaxKind
.Utf8SingleLineRawStringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
577
SyntaxKind
.MultiLineRawStringLiteralToken =>
SyntaxKind
.StringLiteralExpression,
578
SyntaxKind
.Utf8MultiLineRawStringLiteralToken =>
SyntaxKind
.Utf8StringLiteralExpression,
579
SyntaxKind
.CharacterLiteralToken =>
SyntaxKind
.CharacterLiteralExpression,
580
SyntaxKind
.NumericLiteralToken =>
SyntaxKind
.NumericLiteralExpression,
581
SyntaxKind
.NullKeyword =>
SyntaxKind
.NullLiteralExpression,
582
SyntaxKind
.TrueKeyword =>
SyntaxKind
.TrueLiteralExpression,
583
SyntaxKind
.FalseKeyword =>
SyntaxKind
.FalseLiteralExpression,
584
SyntaxKind
.ArgListKeyword =>
SyntaxKind
.ArgListExpression,
585
_ =>
SyntaxKind
.None,
589
public static bool IsInstanceExpression(
SyntaxKind
token)
591
return GetInstanceExpression(token) !=
SyntaxKind
.None;
594
public static
SyntaxKind
GetInstanceExpression(
SyntaxKind
token)
598
case
SyntaxKind
.ThisKeyword:
599
return
SyntaxKind
.ThisExpression;
600
case
SyntaxKind
.BaseKeyword:
601
return
SyntaxKind
.BaseExpression;
603
return
SyntaxKind
.None;
607
public static bool IsBinaryExpression(
SyntaxKind
token)
609
return GetBinaryExpression(token) !=
SyntaxKind
.None;
612
public static bool IsBinaryExpressionOperatorToken(
SyntaxKind
token)
614
return GetBinaryExpression(token) !=
SyntaxKind
.None;
617
public static
SyntaxKind
GetBinaryExpression(
SyntaxKind
token)
621
case
SyntaxKind
.QuestionQuestionToken:
622
return
SyntaxKind
.CoalesceExpression;
623
case
SyntaxKind
.IsKeyword:
624
return
SyntaxKind
.IsExpression;
625
case
SyntaxKind
.AsKeyword:
626
return
SyntaxKind
.AsExpression;
627
case
SyntaxKind
.BarToken:
628
return
SyntaxKind
.BitwiseOrExpression;
629
case
SyntaxKind
.CaretToken:
630
return
SyntaxKind
.ExclusiveOrExpression;
631
case
SyntaxKind
.AmpersandToken:
632
return
SyntaxKind
.BitwiseAndExpression;
633
case
SyntaxKind
.EqualsEqualsToken:
634
return
SyntaxKind
.EqualsExpression;
635
case
SyntaxKind
.ExclamationEqualsToken:
636
return
SyntaxKind
.NotEqualsExpression;
637
case
SyntaxKind
.LessThanToken:
638
return
SyntaxKind
.LessThanExpression;
639
case
SyntaxKind
.LessThanEqualsToken:
640
return
SyntaxKind
.LessThanOrEqualExpression;
641
case
SyntaxKind
.GreaterThanToken:
642
return
SyntaxKind
.GreaterThanExpression;
643
case
SyntaxKind
.GreaterThanEqualsToken:
644
return
SyntaxKind
.GreaterThanOrEqualExpression;
645
case
SyntaxKind
.LessThanLessThanToken:
646
return
SyntaxKind
.LeftShiftExpression;
647
case
SyntaxKind
.GreaterThanGreaterThanToken:
648
return
SyntaxKind
.RightShiftExpression;
649
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
650
return
SyntaxKind
.UnsignedRightShiftExpression;
651
case
SyntaxKind
.PlusToken:
652
return
SyntaxKind
.AddExpression;
653
case
SyntaxKind
.MinusToken:
654
return
SyntaxKind
.SubtractExpression;
655
case
SyntaxKind
.AsteriskToken:
656
return
SyntaxKind
.MultiplyExpression;
657
case
SyntaxKind
.SlashToken:
658
return
SyntaxKind
.DivideExpression;
659
case
SyntaxKind
.PercentToken:
660
return
SyntaxKind
.ModuloExpression;
661
case
SyntaxKind
.AmpersandAmpersandToken:
662
return
SyntaxKind
.LogicalAndExpression;
663
case
SyntaxKind
.BarBarToken:
664
return
SyntaxKind
.LogicalOrExpression;
666
return
SyntaxKind
.None;
670
public static bool IsAssignmentExpression(
SyntaxKind
kind)
674
case
SyntaxKind
.CoalesceAssignmentExpression:
675
case
SyntaxKind
.OrAssignmentExpression:
676
case
SyntaxKind
.AndAssignmentExpression:
677
case
SyntaxKind
.ExclusiveOrAssignmentExpression:
678
case
SyntaxKind
.LeftShiftAssignmentExpression:
679
case
SyntaxKind
.RightShiftAssignmentExpression:
680
case
SyntaxKind
.UnsignedRightShiftAssignmentExpression:
681
case
SyntaxKind
.AddAssignmentExpression:
682
case
SyntaxKind
.SubtractAssignmentExpression:
683
case
SyntaxKind
.MultiplyAssignmentExpression:
684
case
SyntaxKind
.DivideAssignmentExpression:
685
case
SyntaxKind
.ModuloAssignmentExpression:
686
case
SyntaxKind
.SimpleAssignmentExpression:
693
public static bool IsAssignmentExpressionOperatorToken(
SyntaxKind
token)
697
case
SyntaxKind
.QuestionQuestionEqualsToken:
698
case
SyntaxKind
.BarEqualsToken:
699
case
SyntaxKind
.AmpersandEqualsToken:
700
case
SyntaxKind
.CaretEqualsToken:
701
case
SyntaxKind
.LessThanLessThanEqualsToken:
702
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
703
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
704
case
SyntaxKind
.PlusEqualsToken:
705
case
SyntaxKind
.MinusEqualsToken:
706
case
SyntaxKind
.AsteriskEqualsToken:
707
case
SyntaxKind
.SlashEqualsToken:
708
case
SyntaxKind
.PercentEqualsToken:
709
case
SyntaxKind
.EqualsToken:
716
public static
SyntaxKind
GetAssignmentExpression(
SyntaxKind
token)
720
case
SyntaxKind
.BarEqualsToken:
721
return
SyntaxKind
.OrAssignmentExpression;
722
case
SyntaxKind
.AmpersandEqualsToken:
723
return
SyntaxKind
.AndAssignmentExpression;
724
case
SyntaxKind
.CaretEqualsToken:
725
return
SyntaxKind
.ExclusiveOrAssignmentExpression;
726
case
SyntaxKind
.LessThanLessThanEqualsToken:
727
return
SyntaxKind
.LeftShiftAssignmentExpression;
728
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
729
return
SyntaxKind
.RightShiftAssignmentExpression;
730
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
731
return
SyntaxKind
.UnsignedRightShiftAssignmentExpression;
732
case
SyntaxKind
.PlusEqualsToken:
733
return
SyntaxKind
.AddAssignmentExpression;
734
case
SyntaxKind
.MinusEqualsToken:
735
return
SyntaxKind
.SubtractAssignmentExpression;
736
case
SyntaxKind
.AsteriskEqualsToken:
737
return
SyntaxKind
.MultiplyAssignmentExpression;
738
case
SyntaxKind
.SlashEqualsToken:
739
return
SyntaxKind
.DivideAssignmentExpression;
740
case
SyntaxKind
.PercentEqualsToken:
741
return
SyntaxKind
.ModuloAssignmentExpression;
742
case
SyntaxKind
.EqualsToken:
743
return
SyntaxKind
.SimpleAssignmentExpression;
744
case
SyntaxKind
.QuestionQuestionEqualsToken:
745
return
SyntaxKind
.CoalesceAssignmentExpression;
747
return
SyntaxKind
.None;
751
public static
SyntaxKind
GetCheckStatement(
SyntaxKind
keyword)
755
case
SyntaxKind
.CheckedKeyword:
756
return
SyntaxKind
.CheckedStatement;
757
case
SyntaxKind
.UncheckedKeyword:
758
return
SyntaxKind
.UncheckedStatement;
760
return
SyntaxKind
.None;
764
public static
SyntaxKind
GetAccessorDeclarationKind(
SyntaxKind
keyword)
768
case
SyntaxKind
.GetKeyword:
769
return
SyntaxKind
.GetAccessorDeclaration;
770
case
SyntaxKind
.SetKeyword:
771
return
SyntaxKind
.SetAccessorDeclaration;
772
case
SyntaxKind
.InitKeyword:
773
return
SyntaxKind
.InitAccessorDeclaration;
774
case
SyntaxKind
.AddKeyword:
775
return
SyntaxKind
.AddAccessorDeclaration;
776
case
SyntaxKind
.RemoveKeyword:
777
return
SyntaxKind
.RemoveAccessorDeclaration;
779
return
SyntaxKind
.None;
783
public static bool IsAccessorDeclaration(
SyntaxKind
kind)
787
case
SyntaxKind
.GetAccessorDeclaration:
788
case
SyntaxKind
.SetAccessorDeclaration:
789
case
SyntaxKind
.InitAccessorDeclaration:
790
case
SyntaxKind
.AddAccessorDeclaration:
791
case
SyntaxKind
.RemoveAccessorDeclaration:
798
public static bool IsAccessorDeclarationKeyword(
SyntaxKind
keyword)
802
case
SyntaxKind
.GetKeyword:
803
case
SyntaxKind
.SetKeyword:
804
case
SyntaxKind
.InitKeyword:
805
case
SyntaxKind
.AddKeyword:
806
case
SyntaxKind
.RemoveKeyword:
813
public static
SyntaxKind
GetSwitchLabelKind(
SyntaxKind
keyword)
817
case
SyntaxKind
.CaseKeyword:
818
return
SyntaxKind
.CaseSwitchLabel;
819
case
SyntaxKind
.DefaultKeyword:
820
return
SyntaxKind
.DefaultSwitchLabel;
822
return
SyntaxKind
.None;
826
public static
SyntaxKind
GetBaseTypeDeclarationKind(
SyntaxKind
kind)
828
return kind ==
SyntaxKind
.EnumKeyword ?
SyntaxKind
.EnumDeclaration : GetTypeDeclarationKind(kind);
831
public static
SyntaxKind
GetTypeDeclarationKind(
SyntaxKind
kind)
835
case
SyntaxKind
.ClassKeyword:
836
return
SyntaxKind
.ClassDeclaration;
837
case
SyntaxKind
.StructKeyword:
838
return
SyntaxKind
.StructDeclaration;
839
case
SyntaxKind
.InterfaceKeyword:
840
return
SyntaxKind
.InterfaceDeclaration;
841
case
SyntaxKind
.RecordKeyword:
842
return
SyntaxKind
.RecordDeclaration;
844
return
SyntaxKind
.None;
848
public static
SyntaxKind
GetKeywordKind(string text)
853
return
SyntaxKind
.BoolKeyword;
855
return
SyntaxKind
.ByteKeyword;
857
return
SyntaxKind
.SByteKeyword;
859
return
SyntaxKind
.ShortKeyword;
861
return
SyntaxKind
.UShortKeyword;
863
return
SyntaxKind
.IntKeyword;
865
return
SyntaxKind
.UIntKeyword;
867
return
SyntaxKind
.LongKeyword;
869
return
SyntaxKind
.ULongKeyword;
871
return
SyntaxKind
.DoubleKeyword;
873
return
SyntaxKind
.FloatKeyword;
875
return
SyntaxKind
.DecimalKeyword;
877
return
SyntaxKind
.StringKeyword;
879
return
SyntaxKind
.CharKeyword;
881
return
SyntaxKind
.VoidKeyword;
883
return
SyntaxKind
.ObjectKeyword;
885
return
SyntaxKind
.TypeOfKeyword;
887
return
SyntaxKind
.SizeOfKeyword;
889
return
SyntaxKind
.NullKeyword;
891
return
SyntaxKind
.TrueKeyword;
893
return
SyntaxKind
.FalseKeyword;
895
return
SyntaxKind
.IfKeyword;
897
return
SyntaxKind
.ElseKeyword;
899
return
SyntaxKind
.WhileKeyword;
901
return
SyntaxKind
.ForKeyword;
903
return
SyntaxKind
.ForEachKeyword;
905
return
SyntaxKind
.DoKeyword;
907
return
SyntaxKind
.SwitchKeyword;
909
return
SyntaxKind
.CaseKeyword;
911
return
SyntaxKind
.DefaultKeyword;
913
return
SyntaxKind
.LockKeyword;
915
return
SyntaxKind
.TryKeyword;
917
return
SyntaxKind
.ThrowKeyword;
919
return
SyntaxKind
.CatchKeyword;
921
return
SyntaxKind
.FinallyKeyword;
923
return
SyntaxKind
.GotoKeyword;
925
return
SyntaxKind
.BreakKeyword;
927
return
SyntaxKind
.ContinueKeyword;
929
return
SyntaxKind
.ReturnKeyword;
931
return
SyntaxKind
.PublicKeyword;
933
return
SyntaxKind
.PrivateKeyword;
935
return
SyntaxKind
.InternalKeyword;
937
return
SyntaxKind
.ProtectedKeyword;
939
return
SyntaxKind
.StaticKeyword;
941
return
SyntaxKind
.ReadOnlyKeyword;
943
return
SyntaxKind
.SealedKeyword;
945
return
SyntaxKind
.ConstKeyword;
947
return
SyntaxKind
.FixedKeyword;
949
return
SyntaxKind
.StackAllocKeyword;
951
return
SyntaxKind
.VolatileKeyword;
953
return
SyntaxKind
.NewKeyword;
955
return
SyntaxKind
.OverrideKeyword;
957
return
SyntaxKind
.AbstractKeyword;
959
return
SyntaxKind
.VirtualKeyword;
961
return
SyntaxKind
.EventKeyword;
963
return
SyntaxKind
.ExternKeyword;
965
return
SyntaxKind
.RefKeyword;
967
return
SyntaxKind
.OutKeyword;
969
return
SyntaxKind
.InKeyword;
971
return
SyntaxKind
.IsKeyword;
973
return
SyntaxKind
.AsKeyword;
975
return
SyntaxKind
.ParamsKeyword;
977
return
SyntaxKind
.ArgListKeyword;
979
return
SyntaxKind
.MakeRefKeyword;
981
return
SyntaxKind
.RefTypeKeyword;
983
return
SyntaxKind
.RefValueKeyword;
985
return
SyntaxKind
.ThisKeyword;
987
return
SyntaxKind
.BaseKeyword;
989
return
SyntaxKind
.NamespaceKeyword;
991
return
SyntaxKind
.UsingKeyword;
993
return
SyntaxKind
.ClassKeyword;
995
return
SyntaxKind
.StructKeyword;
997
return
SyntaxKind
.InterfaceKeyword;
999
return
SyntaxKind
.EnumKeyword;
1001
return
SyntaxKind
.DelegateKeyword;
1003
return
SyntaxKind
.CheckedKeyword;
1005
return
SyntaxKind
.UncheckedKeyword;
1007
return
SyntaxKind
.UnsafeKeyword;
1009
return
SyntaxKind
.OperatorKeyword;
1011
return
SyntaxKind
.ImplicitKeyword;
1013
return
SyntaxKind
.ExplicitKeyword;
1015
return
SyntaxKind
.None;
1019
public static
SyntaxKind
GetOperatorKind(string operatorMetadataName)
1025
return
SyntaxKind
.PlusToken;
1027
case WellKnownMemberNames.BitwiseAndOperatorName: return
SyntaxKind
.AmpersandToken;
1028
case WellKnownMemberNames.BitwiseOrOperatorName: return
SyntaxKind
.BarToken;
1033
return
SyntaxKind
.MinusMinusToken;
1037
return
SyntaxKind
.SlashToken;
1039
case WellKnownMemberNames.EqualityOperatorName: return
SyntaxKind
.EqualsEqualsToken;
1040
case WellKnownMemberNames.ExclusiveOrOperatorName: return
SyntaxKind
.CaretToken;
1044
return
SyntaxKind
.ExplicitKeyword;
1047
case WellKnownMemberNames.FalseOperatorName: return
SyntaxKind
.FalseKeyword;
1048
case WellKnownMemberNames.GreaterThanOperatorName: return
SyntaxKind
.GreaterThanToken;
1049
case WellKnownMemberNames.GreaterThanOrEqualOperatorName: return
SyntaxKind
.GreaterThanEqualsToken;
1050
case WellKnownMemberNames.ImplicitConversionName: return
SyntaxKind
.ImplicitKeyword;
1054
return
SyntaxKind
.PlusPlusToken;
1056
case WellKnownMemberNames.InequalityOperatorName: return
SyntaxKind
.ExclamationEqualsToken;
1058
case WellKnownMemberNames.LeftShiftOperatorName: return
SyntaxKind
.LessThanLessThanToken;
1059
case WellKnownMemberNames.LessThanOperatorName: return
SyntaxKind
.LessThanToken;
1060
case WellKnownMemberNames.LessThanOrEqualOperatorName: return
SyntaxKind
.LessThanEqualsToken;
1062
case WellKnownMemberNames.LogicalNotOperatorName: return
SyntaxKind
.ExclamationToken;
1063
case WellKnownMemberNames.ModulusOperatorName: return
SyntaxKind
.PercentToken;
1067
return
SyntaxKind
.AsteriskToken;
1069
case WellKnownMemberNames.OnesComplementOperatorName: return
SyntaxKind
.TildeToken;
1070
case WellKnownMemberNames.RightShiftOperatorName: return
SyntaxKind
.GreaterThanGreaterThanToken;
1071
case WellKnownMemberNames.UnsignedRightShiftOperatorName: return
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken;
1075
return
SyntaxKind
.MinusToken;
1077
case WellKnownMemberNames.TrueOperatorName: return
SyntaxKind
.TrueKeyword;
1081
return
SyntaxKind
.MinusToken;
1083
case WellKnownMemberNames.UnaryPlusOperatorName: return
SyntaxKind
.PlusToken;
1085
return
SyntaxKind
.None;
1108
public static
SyntaxKind
GetPreprocessorKeywordKind(string text)
1113
return
SyntaxKind
.TrueKeyword;
1115
return
SyntaxKind
.FalseKeyword;
1117
return
SyntaxKind
.DefaultKeyword;
1119
return
SyntaxKind
.IfKeyword;
1121
return
SyntaxKind
.ElseKeyword;
1123
return
SyntaxKind
.ElifKeyword;
1125
return
SyntaxKind
.EndIfKeyword;
1127
return
SyntaxKind
.RegionKeyword;
1129
return
SyntaxKind
.EndRegionKeyword;
1131
return
SyntaxKind
.DefineKeyword;
1133
return
SyntaxKind
.UndefKeyword;
1135
return
SyntaxKind
.WarningKeyword;
1137
return
SyntaxKind
.ErrorKeyword;
1139
return
SyntaxKind
.LineKeyword;
1141
return
SyntaxKind
.PragmaKeyword;
1143
return
SyntaxKind
.HiddenKeyword;
1145
return
SyntaxKind
.ChecksumKeyword;
1147
return
SyntaxKind
.DisableKeyword;
1149
return
SyntaxKind
.RestoreKeyword;
1151
return
SyntaxKind
.ReferenceKeyword;
1153
return
SyntaxKind
.LoadKeyword;
1155
return
SyntaxKind
.NullableKeyword;
1157
return
SyntaxKind
.EnableKeyword;
1159
return
SyntaxKind
.WarningsKeyword;
1161
return
SyntaxKind
.AnnotationsKeyword;
1163
return
SyntaxKind
.None;
1167
public static IEnumerable<
SyntaxKind
> GetContextualKeywordKinds()
1169
for (int i = (int)
SyntaxKind
.YieldKeyword; i <= (int)
SyntaxKind
.AllowsKeyword; i++)
1174
Debug.Assert(Enum.IsDefined(typeof(
SyntaxKind
), (
SyntaxKind
)i));
1175
yield return (
SyntaxKind
)i;
1180
public static bool IsContextualKeyword(
SyntaxKind
kind)
1184
case
SyntaxKind
.YieldKeyword:
1185
case
SyntaxKind
.PartialKeyword:
1186
case
SyntaxKind
.FromKeyword:
1187
case
SyntaxKind
.GroupKeyword:
1188
case
SyntaxKind
.JoinKeyword:
1189
case
SyntaxKind
.IntoKeyword:
1190
case
SyntaxKind
.LetKeyword:
1191
case
SyntaxKind
.ByKeyword:
1192
case
SyntaxKind
.WhereKeyword:
1193
case
SyntaxKind
.SelectKeyword:
1194
case
SyntaxKind
.GetKeyword:
1195
case
SyntaxKind
.SetKeyword:
1196
case
SyntaxKind
.AddKeyword:
1197
case
SyntaxKind
.RemoveKeyword:
1198
case
SyntaxKind
.OrderByKeyword:
1199
case
SyntaxKind
.AliasKeyword:
1200
case
SyntaxKind
.OnKeyword:
1201
case
SyntaxKind
.EqualsKeyword:
1202
case
SyntaxKind
.AscendingKeyword:
1203
case
SyntaxKind
.DescendingKeyword:
1204
case
SyntaxKind
.AssemblyKeyword:
1205
case
SyntaxKind
.ModuleKeyword:
1206
case
SyntaxKind
.TypeKeyword:
1207
case
SyntaxKind
.GlobalKeyword:
1208
case
SyntaxKind
.FieldKeyword:
1209
case
SyntaxKind
.MethodKeyword:
1210
case
SyntaxKind
.ParamKeyword:
1211
case
SyntaxKind
.PropertyKeyword:
1212
case
SyntaxKind
.TypeVarKeyword:
1213
case
SyntaxKind
.NameOfKeyword:
1214
case
SyntaxKind
.AsyncKeyword:
1215
case
SyntaxKind
.AwaitKeyword:
1216
case
SyntaxKind
.WhenKeyword:
1217
case
SyntaxKind
.UnderscoreToken:
1218
case
SyntaxKind
.VarKeyword:
1219
case
SyntaxKind
.OrKeyword:
1220
case
SyntaxKind
.AndKeyword:
1221
case
SyntaxKind
.NotKeyword:
1222
case
SyntaxKind
.WithKeyword:
1223
case
SyntaxKind
.InitKeyword:
1224
case
SyntaxKind
.RecordKeyword:
1225
case
SyntaxKind
.ManagedKeyword:
1226
case
SyntaxKind
.UnmanagedKeyword:
1227
case
SyntaxKind
.RequiredKeyword:
1228
case
SyntaxKind
.ScopedKeyword:
1229
case
SyntaxKind
.FileKeyword:
1230
case
SyntaxKind
.AllowsKeyword:
1237
public static bool IsQueryContextualKeyword(
SyntaxKind
kind)
1241
case
SyntaxKind
.FromKeyword:
1242
case
SyntaxKind
.WhereKeyword:
1243
case
SyntaxKind
.SelectKeyword:
1244
case
SyntaxKind
.GroupKeyword:
1245
case
SyntaxKind
.IntoKeyword:
1246
case
SyntaxKind
.OrderByKeyword:
1247
case
SyntaxKind
.JoinKeyword:
1248
case
SyntaxKind
.LetKeyword:
1249
case
SyntaxKind
.OnKeyword:
1250
case
SyntaxKind
.EqualsKeyword:
1251
case
SyntaxKind
.ByKeyword:
1252
case
SyntaxKind
.AscendingKeyword:
1253
case
SyntaxKind
.DescendingKeyword:
1260
public static
SyntaxKind
GetContextualKeywordKind(string text)
1265
return
SyntaxKind
.YieldKeyword;
1267
return
SyntaxKind
.PartialKeyword;
1269
return
SyntaxKind
.FromKeyword;
1271
return
SyntaxKind
.GroupKeyword;
1273
return
SyntaxKind
.JoinKeyword;
1275
return
SyntaxKind
.IntoKeyword;
1277
return
SyntaxKind
.LetKeyword;
1279
return
SyntaxKind
.ByKeyword;
1281
return
SyntaxKind
.WhereKeyword;
1283
return
SyntaxKind
.SelectKeyword;
1285
return
SyntaxKind
.GetKeyword;
1287
return
SyntaxKind
.SetKeyword;
1289
return
SyntaxKind
.AddKeyword;
1291
return
SyntaxKind
.RemoveKeyword;
1293
return
SyntaxKind
.OrderByKeyword;
1295
return
SyntaxKind
.AliasKeyword;
1297
return
SyntaxKind
.OnKeyword;
1299
return
SyntaxKind
.EqualsKeyword;
1301
return
SyntaxKind
.AscendingKeyword;
1303
return
SyntaxKind
.DescendingKeyword;
1305
return
SyntaxKind
.AssemblyKeyword;
1307
return
SyntaxKind
.ModuleKeyword;
1309
return
SyntaxKind
.TypeKeyword;
1311
return
SyntaxKind
.FieldKeyword;
1313
return
SyntaxKind
.MethodKeyword;
1315
return
SyntaxKind
.ParamKeyword;
1317
return
SyntaxKind
.PropertyKeyword;
1319
return
SyntaxKind
.TypeVarKeyword;
1321
return
SyntaxKind
.GlobalKeyword;
1323
return
SyntaxKind
.AsyncKeyword;
1325
return
SyntaxKind
.AwaitKeyword;
1327
return
SyntaxKind
.WhenKeyword;
1329
return
SyntaxKind
.NameOfKeyword;
1331
return
SyntaxKind
.UnderscoreToken;
1333
return
SyntaxKind
.VarKeyword;
1335
return
SyntaxKind
.AndKeyword;
1337
return
SyntaxKind
.OrKeyword;
1339
return
SyntaxKind
.NotKeyword;
1341
return
SyntaxKind
.WithKeyword;
1343
return
SyntaxKind
.InitKeyword;
1345
return
SyntaxKind
.RecordKeyword;
1347
return
SyntaxKind
.ManagedKeyword;
1349
return
SyntaxKind
.UnmanagedKeyword;
1351
return
SyntaxKind
.RequiredKeyword;
1353
return
SyntaxKind
.ScopedKeyword;
1355
return
SyntaxKind
.FileKeyword;
1357
return
SyntaxKind
.AllowsKeyword;
1359
return
SyntaxKind
.None;
1363
public static string GetText(
SyntaxKind
kind)
1367
case
SyntaxKind
.TildeToken:
1369
case
SyntaxKind
.ExclamationToken:
1371
case
SyntaxKind
.DollarToken:
1373
case
SyntaxKind
.PercentToken:
1375
case
SyntaxKind
.CaretToken:
1377
case
SyntaxKind
.AmpersandToken:
1379
case
SyntaxKind
.AsteriskToken:
1381
case
SyntaxKind
.OpenParenToken:
1383
case
SyntaxKind
.CloseParenToken:
1385
case
SyntaxKind
.MinusToken:
1387
case
SyntaxKind
.PlusToken:
1389
case
SyntaxKind
.EqualsToken:
1391
case
SyntaxKind
.OpenBraceToken:
1393
case
SyntaxKind
.CloseBraceToken:
1395
case
SyntaxKind
.OpenBracketToken:
1397
case
SyntaxKind
.CloseBracketToken:
1399
case
SyntaxKind
.BarToken:
1401
case
SyntaxKind
.BackslashToken:
1403
case
SyntaxKind
.ColonToken:
1405
case
SyntaxKind
.SemicolonToken:
1407
case
SyntaxKind
.DoubleQuoteToken:
1409
case
SyntaxKind
.SingleQuoteToken:
1411
case
SyntaxKind
.LessThanToken:
1413
case
SyntaxKind
.CommaToken:
1415
case
SyntaxKind
.GreaterThanToken:
1417
case
SyntaxKind
.DotToken:
1419
case
SyntaxKind
.QuestionToken:
1421
case
SyntaxKind
.HashToken:
1423
case
SyntaxKind
.SlashToken:
1425
case
SyntaxKind
.SlashGreaterThanToken:
1427
case
SyntaxKind
.LessThanSlashToken:
1429
case
SyntaxKind
.XmlCommentStartToken:
1431
case
SyntaxKind
.XmlCommentEndToken:
1433
case
SyntaxKind
.XmlCDataStartToken:
1435
case
SyntaxKind
.XmlCDataEndToken:
1437
case
SyntaxKind
.XmlProcessingInstructionStartToken:
1439
case
SyntaxKind
.XmlProcessingInstructionEndToken:
1443
case
SyntaxKind
.BarBarToken:
1445
case
SyntaxKind
.AmpersandAmpersandToken:
1447
case
SyntaxKind
.MinusMinusToken:
1449
case
SyntaxKind
.PlusPlusToken:
1451
case
SyntaxKind
.ColonColonToken:
1453
case
SyntaxKind
.QuestionQuestionToken:
1455
case
SyntaxKind
.MinusGreaterThanToken:
1457
case
SyntaxKind
.ExclamationEqualsToken:
1459
case
SyntaxKind
.EqualsEqualsToken:
1461
case
SyntaxKind
.EqualsGreaterThanToken:
1463
case
SyntaxKind
.LessThanEqualsToken:
1465
case
SyntaxKind
.LessThanLessThanToken:
1467
case
SyntaxKind
.LessThanLessThanEqualsToken:
1469
case
SyntaxKind
.GreaterThanEqualsToken:
1471
case
SyntaxKind
.GreaterThanGreaterThanToken:
1473
case
SyntaxKind
.GreaterThanGreaterThanEqualsToken:
1475
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanToken:
1477
case
SyntaxKind
.GreaterThanGreaterThanGreaterThanEqualsToken:
1479
case
SyntaxKind
.SlashEqualsToken:
1481
case
SyntaxKind
.AsteriskEqualsToken:
1483
case
SyntaxKind
.BarEqualsToken:
1485
case
SyntaxKind
.AmpersandEqualsToken:
1487
case
SyntaxKind
.PlusEqualsToken:
1489
case
SyntaxKind
.MinusEqualsToken:
1491
case
SyntaxKind
.CaretEqualsToken:
1493
case
SyntaxKind
.PercentEqualsToken:
1495
case
SyntaxKind
.QuestionQuestionEqualsToken:
1497
case
SyntaxKind
.DotDotToken:
1501
case
SyntaxKind
.BoolKeyword:
1503
case
SyntaxKind
.ByteKeyword:
1505
case
SyntaxKind
.SByteKeyword:
1507
case
SyntaxKind
.ShortKeyword:
1509
case
SyntaxKind
.UShortKeyword:
1511
case
SyntaxKind
.IntKeyword:
1513
case
SyntaxKind
.UIntKeyword:
1515
case
SyntaxKind
.LongKeyword:
1517
case
SyntaxKind
.ULongKeyword:
1519
case
SyntaxKind
.DoubleKeyword:
1521
case
SyntaxKind
.FloatKeyword:
1523
case
SyntaxKind
.DecimalKeyword:
1525
case
SyntaxKind
.StringKeyword:
1527
case
SyntaxKind
.CharKeyword:
1529
case
SyntaxKind
.VoidKeyword:
1531
case
SyntaxKind
.ObjectKeyword:
1533
case
SyntaxKind
.TypeOfKeyword:
1535
case
SyntaxKind
.SizeOfKeyword:
1537
case
SyntaxKind
.NullKeyword:
1539
case
SyntaxKind
.TrueKeyword:
1541
case
SyntaxKind
.FalseKeyword:
1543
case
SyntaxKind
.IfKeyword:
1545
case
SyntaxKind
.ElseKeyword:
1547
case
SyntaxKind
.WhileKeyword:
1549
case
SyntaxKind
.ForKeyword:
1551
case
SyntaxKind
.ForEachKeyword:
1553
case
SyntaxKind
.DoKeyword:
1555
case
SyntaxKind
.SwitchKeyword:
1557
case
SyntaxKind
.CaseKeyword:
1559
case
SyntaxKind
.DefaultKeyword:
1561
case
SyntaxKind
.TryKeyword:
1563
case
SyntaxKind
.CatchKeyword:
1565
case
SyntaxKind
.FinallyKeyword:
1567
case
SyntaxKind
.LockKeyword:
1569
case
SyntaxKind
.GotoKeyword:
1571
case
SyntaxKind
.BreakKeyword:
1573
case
SyntaxKind
.ContinueKeyword:
1575
case
SyntaxKind
.ReturnKeyword:
1577
case
SyntaxKind
.ThrowKeyword:
1579
case
SyntaxKind
.PublicKeyword:
1581
case
SyntaxKind
.PrivateKeyword:
1583
case
SyntaxKind
.InternalKeyword:
1585
case
SyntaxKind
.ProtectedKeyword:
1587
case
SyntaxKind
.StaticKeyword:
1589
case
SyntaxKind
.ReadOnlyKeyword:
1591
case
SyntaxKind
.SealedKeyword:
1593
case
SyntaxKind
.ConstKeyword:
1595
case
SyntaxKind
.FixedKeyword:
1597
case
SyntaxKind
.StackAllocKeyword:
1599
case
SyntaxKind
.VolatileKeyword:
1601
case
SyntaxKind
.NewKeyword:
1603
case
SyntaxKind
.OverrideKeyword:
1605
case
SyntaxKind
.AbstractKeyword:
1607
case
SyntaxKind
.VirtualKeyword:
1609
case
SyntaxKind
.EventKeyword:
1611
case
SyntaxKind
.ExternKeyword:
1613
case
SyntaxKind
.RefKeyword:
1615
case
SyntaxKind
.OutKeyword:
1617
case
SyntaxKind
.InKeyword:
1619
case
SyntaxKind
.IsKeyword:
1621
case
SyntaxKind
.AsKeyword:
1623
case
SyntaxKind
.ParamsKeyword:
1625
case
SyntaxKind
.ArgListKeyword:
1627
case
SyntaxKind
.MakeRefKeyword:
1629
case
SyntaxKind
.RefTypeKeyword:
1631
case
SyntaxKind
.RefValueKeyword:
1633
case
SyntaxKind
.ThisKeyword:
1635
case
SyntaxKind
.BaseKeyword:
1637
case
SyntaxKind
.NamespaceKeyword:
1639
case
SyntaxKind
.UsingKeyword:
1641
case
SyntaxKind
.ClassKeyword:
1643
case
SyntaxKind
.StructKeyword:
1645
case
SyntaxKind
.InterfaceKeyword:
1647
case
SyntaxKind
.EnumKeyword:
1649
case
SyntaxKind
.DelegateKeyword:
1651
case
SyntaxKind
.CheckedKeyword:
1653
case
SyntaxKind
.UncheckedKeyword:
1655
case
SyntaxKind
.UnsafeKeyword:
1657
case
SyntaxKind
.OperatorKeyword:
1659
case
SyntaxKind
.ImplicitKeyword:
1661
case
SyntaxKind
.ExplicitKeyword:
1663
case
SyntaxKind
.ElifKeyword:
1665
case
SyntaxKind
.EndIfKeyword:
1667
case
SyntaxKind
.RegionKeyword:
1669
case
SyntaxKind
.EndRegionKeyword:
1671
case
SyntaxKind
.DefineKeyword:
1673
case
SyntaxKind
.UndefKeyword:
1675
case
SyntaxKind
.WarningKeyword:
1677
case
SyntaxKind
.ErrorKeyword:
1679
case
SyntaxKind
.LineKeyword:
1681
case
SyntaxKind
.PragmaKeyword:
1683
case
SyntaxKind
.HiddenKeyword:
1685
case
SyntaxKind
.ChecksumKeyword:
1687
case
SyntaxKind
.DisableKeyword:
1689
case
SyntaxKind
.RestoreKeyword:
1691
case
SyntaxKind
.ReferenceKeyword:
1693
case
SyntaxKind
.LoadKeyword:
1695
case
SyntaxKind
.NullableKeyword:
1697
case
SyntaxKind
.EnableKeyword:
1699
case
SyntaxKind
.WarningsKeyword:
1701
case
SyntaxKind
.AnnotationsKeyword:
1705
case
SyntaxKind
.YieldKeyword:
1707
case
SyntaxKind
.PartialKeyword:
1709
case
SyntaxKind
.FromKeyword:
1711
case
SyntaxKind
.GroupKeyword:
1713
case
SyntaxKind
.JoinKeyword:
1715
case
SyntaxKind
.IntoKeyword:
1717
case
SyntaxKind
.LetKeyword:
1719
case
SyntaxKind
.ByKeyword:
1721
case
SyntaxKind
.WhereKeyword:
1723
case
SyntaxKind
.SelectKeyword:
1725
case
SyntaxKind
.GetKeyword:
1727
case
SyntaxKind
.SetKeyword:
1729
case
SyntaxKind
.AddKeyword:
1731
case
SyntaxKind
.RemoveKeyword:
1733
case
SyntaxKind
.OrderByKeyword:
1735
case
SyntaxKind
.AliasKeyword:
1737
case
SyntaxKind
.OnKeyword:
1739
case
SyntaxKind
.EqualsKeyword:
1741
case
SyntaxKind
.AscendingKeyword:
1743
case
SyntaxKind
.DescendingKeyword:
1745
case
SyntaxKind
.AssemblyKeyword:
1747
case
SyntaxKind
.ModuleKeyword:
1749
case
SyntaxKind
.TypeKeyword:
1751
case
SyntaxKind
.FieldKeyword:
1753
case
SyntaxKind
.MethodKeyword:
1755
case
SyntaxKind
.ParamKeyword:
1757
case
SyntaxKind
.PropertyKeyword:
1759
case
SyntaxKind
.TypeVarKeyword:
1761
case
SyntaxKind
.GlobalKeyword:
1763
case
SyntaxKind
.NameOfKeyword:
1765
case
SyntaxKind
.AsyncKeyword:
1767
case
SyntaxKind
.AwaitKeyword:
1769
case
SyntaxKind
.WhenKeyword:
1771
case
SyntaxKind
.InterpolatedStringStartToken:
1773
case
SyntaxKind
.InterpolatedStringEndToken:
1775
case
SyntaxKind
.InterpolatedVerbatimStringStartToken:
1777
case
SyntaxKind
.UnderscoreToken:
1779
case
SyntaxKind
.VarKeyword:
1781
case
SyntaxKind
.AndKeyword:
1783
case
SyntaxKind
.OrKeyword:
1785
case
SyntaxKind
.NotKeyword:
1787
case
SyntaxKind
.WithKeyword:
1789
case
SyntaxKind
.InitKeyword:
1791
case
SyntaxKind
.RecordKeyword:
1793
case
SyntaxKind
.ManagedKeyword:
1795
case
SyntaxKind
.UnmanagedKeyword:
1797
case
SyntaxKind
.RequiredKeyword:
1799
case
SyntaxKind
.ScopedKeyword:
1801
case
SyntaxKind
.FileKeyword:
1803
case
SyntaxKind
.AllowsKeyword:
1810
public static bool IsTypeParameterVarianceKeyword(
SyntaxKind
kind)
1812
return kind ==
SyntaxKind
.OutKeyword || kind ==
SyntaxKind
.InKeyword;
1815
public static bool IsDocumentationCommentTrivia(
SyntaxKind
kind)
1817
return kind ==
SyntaxKind
.SingleLineDocumentationCommentTrivia ||
1818
kind ==
SyntaxKind
.MultiLineDocumentationCommentTrivia;
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.TypeNames.cs (2)
19
return SyntaxFacts.GetKeywordKind(identifier) !=
SyntaxKind
.None || SyntaxFacts.GetContextualKeywordKind(identifier) !=
SyntaxKind
.None;
src\ExpressionEvaluator\CSharp\Source\ResultProvider\Helpers\Placeholders.cs (1)
14
/// Required by <see cref="
SyntaxKind
"/>.