@@ -18,6 +18,9 @@ signature module InputSig<LocationSig Location> {
1818 Location getLocation ( ) ;
1919
2020 string toString ( ) ;
21+
22+ /** Gets a string to distinguish nodes that have the same location and toString value. */
23+ string getOrderDisambiguation ( ) ;
2124 }
2225
2326 Node getASuccessor ( Node n , string label ) ;
@@ -53,7 +56,10 @@ module PrintGraph<LocationSig Location, InputSig<Location> Input> {
5356 p .getLocation ( )
5457 .hasLocationInfo ( filePath , startLine , startColumn , endLine , endColumn )
5558 |
56- p order by filePath , startLine , startColumn , endLine , endColumn , p .toString ( )
59+ p
60+ order by
61+ filePath , startLine , startColumn , endLine , endColumn , p .toString ( ) ,
62+ p .getOrderDisambiguation ( )
5763 )
5864 ) .toString ( )
5965 }
@@ -87,7 +93,8 @@ module PrintGraph<LocationSig Location, InputSig<Location> Input> {
8793 |
8894 edge , "\n"
8995 order by
90- filePath , startLine , startColumn , endLine , endColumn , pred .toString ( )
96+ filePath , startLine , startColumn , endLine , endColumn , pred .toString ( ) ,
97+ pred .getOrderDisambiguation ( )
9198 )
9299 }
93100
@@ -165,8 +172,6 @@ module PrintGraph<LocationSig Location, InputSig<Location> Input> {
165172 smallestEnclosingScope ( getFileBySourceArchiveName ( selectedSourceFile ( ) ) ,
166173 selectedSourceLine ( ) , selectedSourceColumn ( ) )
167174 }
168-
169- string getOrderDisambiguation ( ) { result = "" }
170175 }
171176
172177 private module Output = TestOutput< RelevantNode > ;
0 commit comments