mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Swift: use multiline comments for docs
This commit is contained in:
@@ -8,7 +8,9 @@ private import codeql.swift.generated.MacroRole
|
||||
* The role of a macro, for example #freestanding(declaration) or @attached(member).
|
||||
*/
|
||||
class MacroRole extends Generated::MacroRole {
|
||||
// String representation of the role kind.
|
||||
/**
|
||||
* String representation of the role kind.
|
||||
*/
|
||||
string getKindName() {
|
||||
this.isExpressionKind() and result = "expression"
|
||||
or
|
||||
@@ -29,44 +31,68 @@ class MacroRole extends Generated::MacroRole {
|
||||
this.isExtensionKind() and result = "extension"
|
||||
}
|
||||
|
||||
// Holds for `expression` roles.
|
||||
/**
|
||||
* Holds for `expression` roles.
|
||||
*/
|
||||
predicate isExpressionKind() { this.getKind() = 1 }
|
||||
|
||||
// Holds for `declaration` roles.
|
||||
/**
|
||||
* Holds for `declaration` roles.
|
||||
*/
|
||||
predicate isDeclarationKind() { this.getKind() = 2 }
|
||||
|
||||
// Holds for `accessor` roles.
|
||||
/**
|
||||
* Holds for `accessor` roles.
|
||||
*/
|
||||
predicate isAccessorKind() { this.getKind() = 4 }
|
||||
|
||||
// Holds for `memberAttribute` roles.
|
||||
/**
|
||||
* Holds for `memberAttribute` roles.
|
||||
*/
|
||||
predicate isMemberAttributeKind() { this.getKind() = 8 }
|
||||
|
||||
// Holds for `member` roles.
|
||||
/**
|
||||
* Holds for `member` roles.
|
||||
*/
|
||||
predicate isMemberKind() { this.getKind() = 16 }
|
||||
|
||||
// Holds for `peer` roles.
|
||||
/**
|
||||
* Holds for `peer` roles.
|
||||
*/
|
||||
predicate isPeerKind() { this.getKind() = 32 }
|
||||
|
||||
// Holds for `conformance` roles.
|
||||
/**
|
||||
* Holds for `conformance` roles.
|
||||
*/
|
||||
predicate isConformanceKind() { this.getKind() = 64 }
|
||||
|
||||
// Holds for `codeItem` roles.
|
||||
/**
|
||||
* Holds for `codeItem` roles.
|
||||
*/
|
||||
predicate isCodeItemKind() { this.getKind() = 128 }
|
||||
|
||||
// Holds for `extension` roles.
|
||||
/**
|
||||
* Holds for `extension` roles.
|
||||
*/
|
||||
predicate isExtensionKind() { this.getKind() = 256 }
|
||||
|
||||
// String representation of the syntax kind.
|
||||
/**
|
||||
* String representation of the macro syntax.
|
||||
*/
|
||||
string getMacroSyntaxName() {
|
||||
this.isFreestandingMacroSyntax() and result = "#freestanding"
|
||||
or
|
||||
this.isAttachedMacroSyntax() and result = "@attached"
|
||||
}
|
||||
|
||||
// Holds for #freestanding macros.
|
||||
/**
|
||||
* Holds for #freestanding macros.
|
||||
*/
|
||||
predicate isFreestandingMacroSyntax() { this.getMacroSyntax() = 0 }
|
||||
|
||||
// Holds for @attached macros.
|
||||
/**
|
||||
* Holds for @attached macros.
|
||||
*/
|
||||
predicate isAttachedMacroSyntax() { this.getMacroSyntax() = 1 }
|
||||
|
||||
override string toString() { result = this.getMacroSyntaxName() + "(" + this.getKindName() + ")" }
|
||||
|
||||
Reference in New Issue
Block a user