Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 0e5e116

Browse files
author
Max Schaefer
committed
Add a few more utility predicates to DataFlow::Node.
1 parent 18db1fe commit 0e5e116

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ql/src/semmle/go/dataflow/internal/DataFlowUtil.qll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ class Node extends TNode {
6464
endcolumn = 0
6565
}
6666

67+
/** Gets the file in which this node appears. */
68+
File getFile() { hasLocationInfo(result.getAbsolutePath(), _, _, _, _) }
69+
70+
/** Gets the start line of the location of this node. */
71+
int getStartLine() { hasLocationInfo(_, result, _, _, _) }
72+
73+
/** Gets the start column of the location of this node. */
74+
int getStartColumn() { hasLocationInfo(_, _, result, _, _) }
75+
76+
/** Gets the end line of the location of this node. */
77+
int getEndLine() { hasLocationInfo(_, _, _, result, _) }
78+
79+
/** Gets the end column of the location of this node. */
80+
int getEndColumn() { hasLocationInfo(_, _, _, _, result) }
81+
6782
/**
6883
* Gets an upper bound on the type of this node.
6984
*/

0 commit comments

Comments
 (0)