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

Commit 6c23098

Browse files
authored
Merge pull request #187 from max-schaefer/fill-in-qldoc
Add qldoc for three public predicates in `PrintAst.qll`.
2 parents 79b0ea8 + 0f4297f commit 6c23098

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ql/src/semmle/go/PrintAst.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,16 @@ class FileNode extends BaseAstNode {
187187
override string toString() { result = qlClass(ast) + ast.getRelativePath() }
188188
}
189189

190+
/** Holds if `node` belongs to the output tree, and its property `key` has the given `value`. */
190191
query predicate nodes(PrintAstNode node, string key, string value) {
191192
node.shouldPrint() and
192193
value = node.getProperty(key)
193194
}
194195

196+
/**
197+
* Holds if `target` is a child of `source` in the AST, and property `key` of the edge has the
198+
* given `value`.
199+
*/
195200
query predicate edges(PrintAstNode source, PrintAstNode target, string key, string value) {
196201
exists(int childIndex |
197202
source.shouldPrint() and
@@ -204,6 +209,7 @@ query predicate edges(PrintAstNode source, PrintAstNode target, string key, stri
204209
)
205210
}
206211

212+
/** Holds if property `key` of the graph has the given `value`. */
207213
query predicate graphProperties(string key, string value) {
208214
key = "semmle.graphKind" and value = "tree"
209215
}

0 commit comments

Comments
 (0)