mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Ruby printAst: order by line, synth index in synth parent, column, synth index in real parent
This prevents a bunch of unrelated movements in AstDesugar.ql
This commit is contained in:
@@ -134,6 +134,10 @@ class PrintRegularAstNode extends PrintAstNode, TPrintRegularAstNode {
|
||||
else result = 0
|
||||
}
|
||||
|
||||
private int getSynthAstNodeIndexForSynthParent() {
|
||||
if this.parentIsSynthesized() then result = this.getSynthAstNodeIndex() else result = 0
|
||||
}
|
||||
|
||||
override int getOrder() {
|
||||
this =
|
||||
rank[result](PrintRegularAstNode p, Location l, File f |
|
||||
@@ -142,8 +146,9 @@ class PrintRegularAstNode extends PrintAstNode, TPrintRegularAstNode {
|
||||
|
|
||||
p
|
||||
order by
|
||||
f.getBaseName(), f.getAbsolutePath(), l.getStartLine(), l.getStartColumn(),
|
||||
p.getSynthAstNodeIndex(), l.getEndLine(), l.getEndColumn()
|
||||
f.getBaseName(), f.getAbsolutePath(), l.getStartLine(),
|
||||
p.getSynthAstNodeIndexForSynthParent(), l.getStartColumn(), p.getSynthAstNodeIndex(),
|
||||
l.getEndLine(), l.getEndColumn()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user