-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swift: Manual changes after running code generator
- Loading branch information
Showing
159 changed files
with
2,147 additions
and
1,765 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
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
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" } | ||
} | ||
} |
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,20 +1,22 @@ | ||
private import codeql.swift.generated.Element | ||
|
||
class Element extends Generated::Element { | ||
private predicate resolvesFrom(Element e) { e.getResolveStep() = this } | ||
module Impl { | ||
class Element extends Generated::Element { | ||
private predicate resolvesFrom(Element e) { e.getResolveStep() = this } | ||
|
||
override string toString() { result = this.getPrimaryQlClasses() } | ||
override string toString() { result = this.getPrimaryQlClasses() } | ||
|
||
Element getFullyUnresolved() { | ||
not this.resolvesFrom(_) and result = this | ||
or | ||
exists(Element e | | ||
this.resolvesFrom(e) and | ||
result = e.getFullyUnresolved() | ||
) | ||
Element getFullyUnresolved() { | ||
not this.resolvesFrom(_) and result = this | ||
or | ||
exists(Element e | | ||
this.resolvesFrom(e) and | ||
result = e.getFullyUnresolved() | ||
) | ||
} | ||
} | ||
} | ||
|
||
class UnknownElement extends Element { | ||
UnknownElement() { this.isUnknown() } | ||
class UnknownElement extends Element { | ||
UnknownElement() { this.isUnknown() } | ||
} | ||
} |
Oops, something went wrong.