mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
24 lines
580 B
Plaintext
24 lines
580 B
Plaintext
/**
|
|
* @kind graph
|
|
*/
|
|
|
|
import codeql.ruby.AST
|
|
import codeql.ruby.printAst
|
|
import codeql.ruby.ast.internal.Synthesis
|
|
|
|
class DesugarPrintAstConfiguration extends PrintAstConfiguration {
|
|
override predicate shouldPrintNode(AstNode n) {
|
|
isInDesugeredContext(n)
|
|
or
|
|
exists(n.getDesugared())
|
|
}
|
|
|
|
override predicate shouldPrintAstEdge(AstNode parent, string edgeName, AstNode child) {
|
|
super.shouldPrintAstEdge(parent, edgeName, child) and
|
|
desugarLevel(parent) = desugarLevel(child)
|
|
or
|
|
child = parent.getDesugared() and
|
|
edgeName = "getDesugared"
|
|
}
|
|
}
|