AST: add printAST test case

This commit is contained in:
Arthur Baars
2021-02-25 13:22:06 +01:00
parent 75883b94cd
commit e2b2a450ac
2 changed files with 1721 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
/**
* @kind graph
*/
import codeql_ruby.printAst
class OrderedAstNode extends PrintAstNode {
override string getProperty(string key) {
result = super.getProperty(key)
or
key = "semmle.order" and
result =
any(int i |
this =
rank[i](AstNode p |
|
p
order by
p.getLocation().getFile().getBaseName(), p.getLocation().getFile().getAbsolutePath(),
p.getLocation().getStartLine()
)
).toString()
}
}