mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Update ruby/ql/lib/codeql/ruby/printAst.qll
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -36,6 +36,8 @@ private predicate shouldPrintAstEdge(AstNode parent, string edgeName, AstNode ch
|
||||
any(PrintAstConfiguration config).shouldPrintAstEdge(parent, edgeName, child)
|
||||
}
|
||||
|
||||
private int nonSynthIndex() { result = min([-1, any(int i | exists(getSynthChild(_, i)))]) - 1 }
|
||||
|
||||
newtype TPrintNode =
|
||||
TPrintRegularAstNode(AstNode n) { shouldPrintNode(n) } or
|
||||
TPrintRegExpNode(RE::RegExpTerm term) {
|
||||
@@ -114,7 +116,7 @@ class PrintRegularAstNode extends PrintAstNode, TPrintRegularAstNode {
|
||||
}
|
||||
|
||||
private int getSynthAstNodeIndex() {
|
||||
not astNode.isSynthesized() and result = -10
|
||||
not astNode.isSynthesized() and result = nonSynthIndex()
|
||||
or
|
||||
astNode = getSynthChild(astNode.getParent(), result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user