@@ -8,7 +8,9 @@ private import codeql.swift.generated.MacroRole
8
8
* The role of a macro, for example #freestanding(declaration) or @attached(member).
9
9
*/
10
10
class MacroRole extends Generated:: MacroRole {
11
- // String representation of the role kind.
11
+ /**
12
+ * String representation of the role kind.
13
+ */
12
14
string getKindName ( ) {
13
15
this .isExpressionKind ( ) and result = "expression"
14
16
or
@@ -29,44 +31,68 @@ class MacroRole extends Generated::MacroRole {
29
31
this .isExtensionKind ( ) and result = "extension"
30
32
}
31
33
32
- // Holds for `expression` roles.
34
+ /**
35
+ * Holds for `expression` roles.
36
+ */
33
37
predicate isExpressionKind ( ) { this .getKind ( ) = 1 }
34
38
35
- // Holds for `declaration` roles.
39
+ /**
40
+ * Holds for `declaration` roles.
41
+ */
36
42
predicate isDeclarationKind ( ) { this .getKind ( ) = 2 }
37
43
38
- // Holds for `accessor` roles.
44
+ /**
45
+ * Holds for `accessor` roles.
46
+ */
39
47
predicate isAccessorKind ( ) { this .getKind ( ) = 4 }
40
48
41
- // Holds for `memberAttribute` roles.
49
+ /**
50
+ * Holds for `memberAttribute` roles.
51
+ */
42
52
predicate isMemberAttributeKind ( ) { this .getKind ( ) = 8 }
43
53
44
- // Holds for `member` roles.
54
+ /**
55
+ * Holds for `member` roles.
56
+ */
45
57
predicate isMemberKind ( ) { this .getKind ( ) = 16 }
46
58
47
- // Holds for `peer` roles.
59
+ /**
60
+ * Holds for `peer` roles.
61
+ */
48
62
predicate isPeerKind ( ) { this .getKind ( ) = 32 }
49
63
50
- // Holds for `conformance` roles.
64
+ /**
65
+ * Holds for `conformance` roles.
66
+ */
51
67
predicate isConformanceKind ( ) { this .getKind ( ) = 64 }
52
68
53
- // Holds for `codeItem` roles.
69
+ /**
70
+ * Holds for `codeItem` roles.
71
+ */
54
72
predicate isCodeItemKind ( ) { this .getKind ( ) = 128 }
55
73
56
- // Holds for `extension` roles.
74
+ /**
75
+ * Holds for `extension` roles.
76
+ */
57
77
predicate isExtensionKind ( ) { this .getKind ( ) = 256 }
58
78
59
- // String representation of the syntax kind.
79
+ /**
80
+ * String representation of the macro syntax.
81
+ */
60
82
string getMacroSyntaxName ( ) {
61
83
this .isFreestandingMacroSyntax ( ) and result = "#freestanding"
62
84
or
63
85
this .isAttachedMacroSyntax ( ) and result = "@attached"
64
86
}
65
87
66
- // Holds for #freestanding macros.
88
+ /**
89
+ * Holds for #freestanding macros.
90
+ */
67
91
predicate isFreestandingMacroSyntax ( ) { this .getMacroSyntax ( ) = 0 }
68
92
69
- // Holds for @attached macros.
93
+ /**
94
+ * Holds for @attached macros.
95
+ */
70
96
predicate isAttachedMacroSyntax ( ) { this .getMacroSyntax ( ) = 1 }
71
97
72
98
override string toString ( ) { result = this .getMacroSyntaxName ( ) + "(" + this .getKindName ( ) + ")" }
0 commit comments