Skip to content

Commit 85e164d

Browse files
committed
Swift: QLDoc some stuff while we're here.
1 parent 3b9151c commit 85e164d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

swift/ql/lib/codeql/swift/elements/Location.qll

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
private import codeql.swift.generated.Location
22

3+
/**
4+
* A location of a program element.
5+
*/
36
class Location extends LocationBase {
4-
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
7+
/**
8+
* Holds if this location is described by `path`, `startLine`, `startColumn`, `endLine` and `endColumn`.
9+
*/
10+
predicate hasLocationInfo(string path, int startLine, int startColumn, int endLine, int endColumn) {
511
path = getFile().getFullName() and
6-
sl = getStartLine() and
7-
sc = getStartColumn() and
8-
el = getEndLine() and
9-
ec = getEndColumn()
12+
startLine = getStartLine() and
13+
startColumn = getStartColumn() and
14+
endLine = getEndLine() and
15+
endColumn = getEndColumn()
1016
}
1117

1218
/**

swift/ql/lib/codeql/swift/elements/UnknownLocation.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ private import codeql.swift.generated.UnknownLocation
22
private import codeql.swift.elements.UnknownFile
33
private import codeql.swift.elements.File
44

5+
/**
6+
* A `Location` that is given to something that is not associated with any position in the source code.
7+
*/
58
class UnknownLocation extends UnknownLocationBase {
69
override File getImmediateFile() { result instanceof UnknownFile }
710

0 commit comments

Comments
 (0)