-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swift: Add missing
module Impl
wrappers
- Loading branch information
Showing
154 changed files
with
2,157 additions
and
1,835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 23 additions & 21 deletions
44
swift/ql/lib/codeql/swift/elements/AvailabilityInfoImpl.qll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
private import codeql.swift.generated.AvailabilityInfo | ||
|
||
// the following QLdoc is generated: if you need to edit it, do it in the schema file | ||
/** | ||
* An availability condition of an `if`, `while`, or `guard` statements. | ||
* | ||
* Examples: | ||
* ``` | ||
* if #available(iOS 12, *) { | ||
* // Runs on iOS 12 and above | ||
* } else { | ||
* // Runs only anything below iOS 12 | ||
* } | ||
* if #unavailable(macOS 10.14, *) { | ||
* // Runs only on macOS 10 and below | ||
* } | ||
* ``` | ||
*/ | ||
class AvailabilityInfo extends Generated::AvailabilityInfo { | ||
override string toString() { | ||
result = "#available" and not this.isUnavailable() | ||
or | ||
result = "#unavailable" and this.isUnavailable() | ||
module Impl { | ||
// the following QLdoc is generated: if you need to edit it, do it in the schema file | ||
/** | ||
* An availability condition of an `if`, `while`, or `guard` statements. | ||
* | ||
* Examples: | ||
* ``` | ||
* if #available(iOS 12, *) { | ||
* // Runs on iOS 12 and above | ||
* } else { | ||
* // Runs only anything below iOS 12 | ||
* } | ||
* if #unavailable(macOS 10.14, *) { | ||
* // Runs only on macOS 10 and below | ||
* } | ||
* ``` | ||
*/ | ||
class AvailabilityInfo extends Generated::AvailabilityInfo { | ||
override string toString() { | ||
result = "#available" and not this.isUnavailable() | ||
or | ||
result = "#unavailable" and this.isUnavailable() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
private import codeql.swift.generated.Comment | ||
|
||
class Comment extends Generated::Comment { | ||
/** toString */ | ||
override string toString() { result = this.getText() } | ||
} | ||
module Impl { | ||
class Comment extends Generated::Comment { | ||
/** toString */ | ||
override string toString() { result = this.getText() } | ||
} | ||
|
||
class SingleLineComment extends Comment { | ||
SingleLineComment() { | ||
this.getText().matches("//%") and | ||
not this instanceof SingleLineDocComment | ||
class SingleLineComment extends Comment { | ||
SingleLineComment() { | ||
this.getText().matches("//%") and | ||
not this instanceof SingleLineDocComment | ||
} | ||
} | ||
} | ||
|
||
class MultiLineComment extends Comment { | ||
MultiLineComment() { | ||
this.getText().matches("/*%") and | ||
not this instanceof MultiLineDocComment | ||
class MultiLineComment extends Comment { | ||
MultiLineComment() { | ||
this.getText().matches("/*%") and | ||
not this instanceof MultiLineDocComment | ||
} | ||
} | ||
} | ||
|
||
class DocComment extends Comment { | ||
DocComment() { | ||
this instanceof SingleLineDocComment or | ||
this instanceof MultiLineDocComment | ||
class DocComment extends Comment { | ||
DocComment() { | ||
this instanceof SingleLineDocComment or | ||
this instanceof MultiLineDocComment | ||
} | ||
} | ||
} | ||
|
||
class SingleLineDocComment extends Comment { | ||
SingleLineDocComment() { this.getText().matches("///%") } | ||
} | ||
class SingleLineDocComment extends Comment { | ||
SingleLineDocComment() { this.getText().matches("///%") } | ||
} | ||
|
||
class MultiLineDocComment extends Comment { | ||
MultiLineDocComment() { this.getText().matches("/**%") } | ||
class MultiLineDocComment extends Comment { | ||
MultiLineDocComment() { this.getText().matches("/**%") } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
private import codeql.swift.generated.Diagnostics | ||
|
||
/** | ||
* A compiler-generated error, warning, note or remark. | ||
*/ | ||
class Diagnostics extends Generated::Diagnostics { | ||
override string toString() { result = this.getSeverity() + ": " + this.getText() } | ||
|
||
module Impl { | ||
/** | ||
* Gets a string representing the severity of this compiler diagnostic. | ||
* A compiler-generated error, warning, note or remark. | ||
*/ | ||
string getSeverity() { | ||
this.getKind() = 1 and result = "error" | ||
or | ||
this.getKind() = 2 and result = "warning" | ||
or | ||
this.getKind() = 3 and result = "note" | ||
or | ||
this.getKind() = 4 and result = "remark" | ||
class Diagnostics extends Generated::Diagnostics { | ||
override string toString() { result = this.getSeverity() + ": " + this.getText() } | ||
|
||
/** | ||
* Gets a string representing the severity of this compiler diagnostic. | ||
*/ | ||
string getSeverity() { | ||
this.getKind() = 1 and result = "error" | ||
or | ||
this.getKind() = 2 and result = "warning" | ||
or | ||
this.getKind() = 3 and result = "note" | ||
or | ||
this.getKind() = 4 and result = "remark" | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* A compiler error message. | ||
*/ | ||
class CompilerError extends Diagnostics { | ||
CompilerError() { this.getSeverity() = "error" } | ||
} | ||
/** | ||
* A compiler error message. | ||
*/ | ||
class CompilerError extends Diagnostics { | ||
CompilerError() { this.getSeverity() = "error" } | ||
} | ||
|
||
/** | ||
* A compiler-generated warning. | ||
*/ | ||
class CompilerWarning extends Diagnostics { | ||
CompilerWarning() { this.getSeverity() = "warning" } | ||
} | ||
/** | ||
* A compiler-generated warning. | ||
*/ | ||
class CompilerWarning extends Diagnostics { | ||
CompilerWarning() { this.getSeverity() = "warning" } | ||
} | ||
|
||
/** | ||
* A compiler-generated note (typically attached to an error or warning). | ||
*/ | ||
class CompilerNote extends Diagnostics { | ||
CompilerNote() { this.getSeverity() = "note" } | ||
} | ||
/** | ||
* A compiler-generated note (typically attached to an error or warning). | ||
*/ | ||
class CompilerNote extends Diagnostics { | ||
CompilerNote() { this.getSeverity() = "note" } | ||
} | ||
|
||
/** | ||
* A compiler-generated remark (milder than a warning, this does not indicate an issue). | ||
*/ | ||
class CompilerRemark extends Diagnostics { | ||
CompilerRemark() { this.getSeverity() = "remark" } | ||
/** | ||
* A compiler-generated remark (milder than a warning, this does not indicate an issue). | ||
*/ | ||
class CompilerRemark extends Diagnostics { | ||
CompilerRemark() { this.getSeverity() = "remark" } | ||
} | ||
} |
Oops, something went wrong.