@@ -412,6 +412,8 @@ class ArgumentPosition = Position;
412412
413413abstract class Position extends TPosition {
414414 abstract string toString ( ) ;
415+
416+ abstract int getIndirectionIndex ( ) ;
415417}
416418
417419class DirectPosition extends Position , TDirectPosition {
@@ -421,13 +423,15 @@ class DirectPosition extends Position, TDirectPosition {
421423
422424 override string toString ( ) {
423425 index = - 1 and
424- result = "this"
426+ result = "this pointer "
425427 or
426428 index != - 1 and
427429 result = index .toString ( )
428430 }
429431
430432 int getIndex ( ) { result = index }
433+
434+ final override int getIndirectionIndex ( ) { result = 0 }
431435}
432436
433437class IndirectionPosition extends Position , TIndirectionPosition {
@@ -438,16 +442,13 @@ class IndirectionPosition extends Position, TIndirectionPosition {
438442
439443 override string toString ( ) {
440444 if argumentIndex = - 1
441- then if indirectionIndex > 0 then result = "this indirection" else result = "this"
442- else
443- if indirectionIndex > 0
444- then result = argumentIndex .toString ( ) + " indirection"
445- else result = argumentIndex .toString ( )
445+ then result = repeatStars ( indirectionIndex - 1 ) + "this"
446+ else result = repeatStars ( indirectionIndex ) + argumentIndex .toString ( )
446447 }
447448
448449 int getArgumentIndex ( ) { result = argumentIndex }
449450
450- int getIndirectionIndex ( ) { result = indirectionIndex }
451+ final override int getIndirectionIndex ( ) { result = indirectionIndex }
451452}
452453
453454newtype TPosition =
0 commit comments