PrintAst: reliably sort function overloads

This commit is contained in:
Chris Smowton
2022-10-03 15:22:57 +01:00
parent d3d3ce843a
commit 5e2c607650
2 changed files with 164 additions and 159 deletions

View File

@@ -534,12 +534,17 @@ final class ClassInterfaceNode extends ElementNode {
or
childIndex >= 0 and
result.(ElementNode).getElement() =
rank[childIndex](Element e, string file, int line, int column, string childStr |
rank[childIndex](Element e, string file, int line, int column, string childStr, int argCount |
e = this.getADeclaration() and
locationSortKeys(e, file, line, column) and
childStr = e.toString()
childStr = e.toString() and
(
if e instanceof Callable
then argCount = e.(Callable).getNumberOfParameters()
else argCount = 0
)
|
e order by file, line, column, childStr
e order by file, line, column, childStr, argCount
)
}
}

View File

@@ -3846,58 +3846,6 @@ funcExprs.kt:
# 36| 5: [BlockStmt] { ... }
# 36| 0: [SuperConstructorInvocationStmt] super(...)
# 36| 2: [Method] invoke
# 36| 3: [TypeAccess] String
#-----| 4: (Parameters)
# 36| 0: [Parameter] a0
# 36| 0: [TypeAccess] int
# 36| 1: [Parameter] a1
# 36| 0: [TypeAccess] int
# 36| 2: [Parameter] a2
# 36| 0: [TypeAccess] int
# 36| 3: [Parameter] a3
# 36| 0: [TypeAccess] int
# 36| 4: [Parameter] a4
# 36| 0: [TypeAccess] int
# 36| 5: [Parameter] a5
# 36| 0: [TypeAccess] int
# 36| 6: [Parameter] a6
# 36| 0: [TypeAccess] int
# 36| 7: [Parameter] a7
# 36| 0: [TypeAccess] int
# 36| 8: [Parameter] a8
# 36| 0: [TypeAccess] int
# 36| 9: [Parameter] a9
# 36| 0: [TypeAccess] int
# 36| 10: [Parameter] a10
# 36| 0: [TypeAccess] int
# 36| 11: [Parameter] a11
# 36| 0: [TypeAccess] int
# 36| 12: [Parameter] a12
# 36| 0: [TypeAccess] int
# 36| 13: [Parameter] a13
# 36| 0: [TypeAccess] int
# 36| 14: [Parameter] a14
# 36| 0: [TypeAccess] int
# 36| 15: [Parameter] a15
# 36| 0: [TypeAccess] int
# 36| 16: [Parameter] a16
# 36| 0: [TypeAccess] int
# 36| 17: [Parameter] a17
# 36| 0: [TypeAccess] int
# 36| 18: [Parameter] a18
# 36| 0: [TypeAccess] int
# 36| 19: [Parameter] a19
# 36| 0: [TypeAccess] int
# 36| 20: [Parameter] a20
# 36| 0: [TypeAccess] int
# 36| 21: [Parameter] a21
# 36| 0: [TypeAccess] int
# 36| 22: [Parameter] a22
# 36| 0: [TypeAccess] int
# 36| 5: [BlockStmt] { ... }
# 36| 0: [ReturnStmt] return ...
# 36| 0: [StringLiteral]
# 36| 2: [Method] invoke
#-----| 4: (Parameters)
# 36| 0: [Parameter] a0
# 36| 5: [BlockStmt] { ... }
@@ -4019,6 +3967,58 @@ funcExprs.kt:
# 36| 1: [ArrayAccess] ...[...]
# 36| 0: [VarAccess] a0
# 36| 1: [IntegerLiteral] 22
# 36| 3: [Method] invoke
# 36| 3: [TypeAccess] String
#-----| 4: (Parameters)
# 36| 0: [Parameter] a0
# 36| 0: [TypeAccess] int
# 36| 1: [Parameter] a1
# 36| 0: [TypeAccess] int
# 36| 2: [Parameter] a2
# 36| 0: [TypeAccess] int
# 36| 3: [Parameter] a3
# 36| 0: [TypeAccess] int
# 36| 4: [Parameter] a4
# 36| 0: [TypeAccess] int
# 36| 5: [Parameter] a5
# 36| 0: [TypeAccess] int
# 36| 6: [Parameter] a6
# 36| 0: [TypeAccess] int
# 36| 7: [Parameter] a7
# 36| 0: [TypeAccess] int
# 36| 8: [Parameter] a8
# 36| 0: [TypeAccess] int
# 36| 9: [Parameter] a9
# 36| 0: [TypeAccess] int
# 36| 10: [Parameter] a10
# 36| 0: [TypeAccess] int
# 36| 11: [Parameter] a11
# 36| 0: [TypeAccess] int
# 36| 12: [Parameter] a12
# 36| 0: [TypeAccess] int
# 36| 13: [Parameter] a13
# 36| 0: [TypeAccess] int
# 36| 14: [Parameter] a14
# 36| 0: [TypeAccess] int
# 36| 15: [Parameter] a15
# 36| 0: [TypeAccess] int
# 36| 16: [Parameter] a16
# 36| 0: [TypeAccess] int
# 36| 17: [Parameter] a17
# 36| 0: [TypeAccess] int
# 36| 18: [Parameter] a18
# 36| 0: [TypeAccess] int
# 36| 19: [Parameter] a19
# 36| 0: [TypeAccess] int
# 36| 20: [Parameter] a20
# 36| 0: [TypeAccess] int
# 36| 21: [Parameter] a21
# 36| 0: [TypeAccess] int
# 36| 22: [Parameter] a22
# 36| 0: [TypeAccess] int
# 36| 5: [BlockStmt] { ... }
# 36| 0: [ReturnStmt] return ...
# 36| 0: [StringLiteral]
# 36| -3: [TypeAccess] FunctionN<String>
# 36| 0: [TypeAccess] String
# 38| 14: [ExprStmt] <Expr>;
@@ -4683,58 +4683,6 @@ funcExprs.kt:
# 90| 5: [BlockStmt] { ... }
# 90| 0: [SuperConstructorInvocationStmt] super(...)
# 90| 2: [Method] invoke
# 90| 3: [TypeAccess] String
#-----| 4: (Parameters)
# 90| 0: [Parameter] p0
# 90| 0: [TypeAccess] int
# 90| 1: [Parameter] p1
# 90| 0: [TypeAccess] int
# 90| 2: [Parameter] p2
# 90| 0: [TypeAccess] int
# 90| 3: [Parameter] p3
# 90| 0: [TypeAccess] int
# 90| 4: [Parameter] p4
# 90| 0: [TypeAccess] int
# 90| 5: [Parameter] p5
# 90| 0: [TypeAccess] int
# 90| 6: [Parameter] p6
# 90| 0: [TypeAccess] int
# 90| 7: [Parameter] p7
# 90| 0: [TypeAccess] int
# 90| 8: [Parameter] p8
# 90| 0: [TypeAccess] int
# 90| 9: [Parameter] p9
# 90| 0: [TypeAccess] int
# 90| 10: [Parameter] p10
# 90| 0: [TypeAccess] int
# 90| 11: [Parameter] p11
# 90| 0: [TypeAccess] int
# 90| 12: [Parameter] p12
# 90| 0: [TypeAccess] int
# 90| 13: [Parameter] p13
# 90| 0: [TypeAccess] int
# 90| 14: [Parameter] p14
# 90| 0: [TypeAccess] int
# 90| 15: [Parameter] p15
# 90| 0: [TypeAccess] int
# 90| 16: [Parameter] p16
# 90| 0: [TypeAccess] int
# 90| 17: [Parameter] p17
# 90| 0: [TypeAccess] int
# 90| 18: [Parameter] p18
# 90| 0: [TypeAccess] int
# 90| 19: [Parameter] p19
# 90| 0: [TypeAccess] int
# 90| 20: [Parameter] p20
# 90| 0: [TypeAccess] int
# 90| 21: [Parameter] p21
# 90| 0: [TypeAccess] int
# 90| 22: [Parameter] p22
# 90| 0: [TypeAccess] int
# 90| 5: [BlockStmt] { ... }
# 90| 0: [ReturnStmt] return ...
# 90| 0: [StringLiteral]
# 90| 2: [Method] invoke
#-----| 4: (Parameters)
# 90| 0: [Parameter] a0
# 90| 5: [BlockStmt] { ... }
@@ -4856,6 +4804,58 @@ funcExprs.kt:
# 90| 1: [ArrayAccess] ...[...]
# 90| 0: [VarAccess] a0
# 90| 1: [IntegerLiteral] 22
# 90| 3: [Method] invoke
# 90| 3: [TypeAccess] String
#-----| 4: (Parameters)
# 90| 0: [Parameter] p0
# 90| 0: [TypeAccess] int
# 90| 1: [Parameter] p1
# 90| 0: [TypeAccess] int
# 90| 2: [Parameter] p2
# 90| 0: [TypeAccess] int
# 90| 3: [Parameter] p3
# 90| 0: [TypeAccess] int
# 90| 4: [Parameter] p4
# 90| 0: [TypeAccess] int
# 90| 5: [Parameter] p5
# 90| 0: [TypeAccess] int
# 90| 6: [Parameter] p6
# 90| 0: [TypeAccess] int
# 90| 7: [Parameter] p7
# 90| 0: [TypeAccess] int
# 90| 8: [Parameter] p8
# 90| 0: [TypeAccess] int
# 90| 9: [Parameter] p9
# 90| 0: [TypeAccess] int
# 90| 10: [Parameter] p10
# 90| 0: [TypeAccess] int
# 90| 11: [Parameter] p11
# 90| 0: [TypeAccess] int
# 90| 12: [Parameter] p12
# 90| 0: [TypeAccess] int
# 90| 13: [Parameter] p13
# 90| 0: [TypeAccess] int
# 90| 14: [Parameter] p14
# 90| 0: [TypeAccess] int
# 90| 15: [Parameter] p15
# 90| 0: [TypeAccess] int
# 90| 16: [Parameter] p16
# 90| 0: [TypeAccess] int
# 90| 17: [Parameter] p17
# 90| 0: [TypeAccess] int
# 90| 18: [Parameter] p18
# 90| 0: [TypeAccess] int
# 90| 19: [Parameter] p19
# 90| 0: [TypeAccess] int
# 90| 20: [Parameter] p20
# 90| 0: [TypeAccess] int
# 90| 21: [Parameter] p21
# 90| 0: [TypeAccess] int
# 90| 22: [Parameter] p22
# 90| 0: [TypeAccess] int
# 90| 5: [BlockStmt] { ... }
# 90| 0: [ReturnStmt] return ...
# 90| 0: [StringLiteral]
# 90| -3: [TypeAccess] FunctionN<String>
# 90| 0: [TypeAccess] String
# 91| 5: [ExprStmt] <Expr>;
@@ -6038,58 +6038,6 @@ samConversion.kt:
# 43| 5: [BlockStmt] { ... }
# 43| 0: [SuperConstructorInvocationStmt] super(...)
# 43| 2: [Method] invoke
# 43| 3: [TypeAccess] boolean
#-----| 4: (Parameters)
# 43| 0: [Parameter] i0
# 43| 0: [TypeAccess] int
# 43| 1: [Parameter] i1
# 43| 0: [TypeAccess] int
# 43| 2: [Parameter] i2
# 43| 0: [TypeAccess] int
# 43| 3: [Parameter] i3
# 43| 0: [TypeAccess] int
# 43| 4: [Parameter] i4
# 43| 0: [TypeAccess] int
# 43| 5: [Parameter] i5
# 43| 0: [TypeAccess] int
# 43| 6: [Parameter] i6
# 43| 0: [TypeAccess] int
# 43| 7: [Parameter] i7
# 43| 0: [TypeAccess] int
# 43| 8: [Parameter] i8
# 43| 0: [TypeAccess] int
# 43| 9: [Parameter] i9
# 43| 0: [TypeAccess] int
# 44| 10: [Parameter] i10
# 44| 0: [TypeAccess] int
# 44| 11: [Parameter] i11
# 44| 0: [TypeAccess] int
# 44| 12: [Parameter] i12
# 44| 0: [TypeAccess] int
# 44| 13: [Parameter] i13
# 44| 0: [TypeAccess] int
# 44| 14: [Parameter] i14
# 44| 0: [TypeAccess] int
# 44| 15: [Parameter] i15
# 44| 0: [TypeAccess] int
# 44| 16: [Parameter] i16
# 44| 0: [TypeAccess] int
# 44| 17: [Parameter] i17
# 44| 0: [TypeAccess] int
# 44| 18: [Parameter] i18
# 44| 0: [TypeAccess] int
# 44| 19: [Parameter] i19
# 44| 0: [TypeAccess] int
# 45| 20: [Parameter] i20
# 45| 0: [TypeAccess] int
# 45| 21: [Parameter] i21
# 45| 0: [TypeAccess] int
# 45| 22: [Parameter] i22
# 45| 0: [TypeAccess] int
# 45| 5: [BlockStmt] { ... }
# 45| 0: [ReturnStmt] return ...
# 45| 0: [BooleanLiteral] true
# 43| 2: [Method] invoke
#-----| 4: (Parameters)
# 43| 0: [Parameter] a0
# 43| 5: [BlockStmt] { ... }
@@ -6211,6 +6159,58 @@ samConversion.kt:
# 43| 1: [ArrayAccess] ...[...]
# 43| 0: [VarAccess] a0
# 43| 1: [IntegerLiteral] 22
# 43| 3: [Method] invoke
# 43| 3: [TypeAccess] boolean
#-----| 4: (Parameters)
# 43| 0: [Parameter] i0
# 43| 0: [TypeAccess] int
# 43| 1: [Parameter] i1
# 43| 0: [TypeAccess] int
# 43| 2: [Parameter] i2
# 43| 0: [TypeAccess] int
# 43| 3: [Parameter] i3
# 43| 0: [TypeAccess] int
# 43| 4: [Parameter] i4
# 43| 0: [TypeAccess] int
# 43| 5: [Parameter] i5
# 43| 0: [TypeAccess] int
# 43| 6: [Parameter] i6
# 43| 0: [TypeAccess] int
# 43| 7: [Parameter] i7
# 43| 0: [TypeAccess] int
# 43| 8: [Parameter] i8
# 43| 0: [TypeAccess] int
# 43| 9: [Parameter] i9
# 43| 0: [TypeAccess] int
# 44| 10: [Parameter] i10
# 44| 0: [TypeAccess] int
# 44| 11: [Parameter] i11
# 44| 0: [TypeAccess] int
# 44| 12: [Parameter] i12
# 44| 0: [TypeAccess] int
# 44| 13: [Parameter] i13
# 44| 0: [TypeAccess] int
# 44| 14: [Parameter] i14
# 44| 0: [TypeAccess] int
# 44| 15: [Parameter] i15
# 44| 0: [TypeAccess] int
# 44| 16: [Parameter] i16
# 44| 0: [TypeAccess] int
# 44| 17: [Parameter] i17
# 44| 0: [TypeAccess] int
# 44| 18: [Parameter] i18
# 44| 0: [TypeAccess] int
# 44| 19: [Parameter] i19
# 44| 0: [TypeAccess] int
# 45| 20: [Parameter] i20
# 45| 0: [TypeAccess] int
# 45| 21: [Parameter] i21
# 45| 0: [TypeAccess] int
# 45| 22: [Parameter] i22
# 45| 0: [TypeAccess] int
# 45| 5: [BlockStmt] { ... }
# 45| 0: [ReturnStmt] return ...
# 45| 0: [BooleanLiteral] true
# 43| -3: [TypeAccess] FunctionN<Boolean>
# 43| 0: [TypeAccess] Boolean
# 46| 3: [LocalVariableDeclStmt] var ...;