Skip to content

Commit cfb4e76

Browse files
committed
Add a case to showAsTree for Loc
1 parent 943bf21 commit cfb4e76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hkmc2/shared/src/main/scala/hkmc2/utils/utils.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ extension (t: Product)
4242
if spec then flags += "spec"
4343
if genGetter then flags += "gen"
4444
if flags.isEmpty then "()" else flags.mkString("(", ", ", ")")
45+
case Loc(start, end, origin) =>
46+
val (sl, _, sc) = origin.fph.getLineColAt(start)
47+
val (el, _, ec) = origin.fph.getLineColAt(end)
48+
s"Loc at :$sl:$sc-$el:$ec"
4549
case t: Product => t.showAsTree(inTailPos)
4650
case v => v.toString
4751
val postfix = post(t)

0 commit comments

Comments
 (0)