Skip to content

Commit cfd242e

Browse files
committed
Swift: add human readable string representation for Location and UnkownAstNode
1 parent dd900e6 commit cfd242e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
21
private import codeql.swift.generated.Location
32

4-
class Location extends LocationBase { }
3+
class Location extends LocationBase {
4+
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
5+
path = getFile().getFullName() and
6+
sl = getStartLine() and
7+
sc = getStartColumn() and
8+
el = getEndLine() and
9+
ec = getEndColumn()
10+
}
11+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
21
private import codeql.swift.generated.UnknownAstNode
32

4-
class UnknownAstNode extends UnknownAstNodeBase { }
3+
class UnknownAstNode extends UnknownAstNodeBase {
4+
override string toString() { result = getName() }
5+
}

0 commit comments

Comments
 (0)