Skip to content

Commit

Permalink
Remove withoutHash stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sakehl committed Feb 26, 2024
1 parent 74a71ec commit 29201bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 0 additions & 5 deletions src/col/vct/col/ast/node/NodeImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ trait NodeImpl[G] extends Show { this: Node[G] =>
Group(show).toStringWithContext
}

def toInlineStringWithoutHash: String = {
implicit val ctx = Ctx(withoutHash=true).namesIn(this).copy(width = Int.MaxValue)
Group(show).toStringWithContext
}

def highlight(node: Node[_]): HasContext =
new HasContext {
def contextText: String = {
Expand Down
7 changes: 2 additions & 5 deletions src/col/vct/col/print/Ctx.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ case class Ctx(
tabWidth: Int = 4,
names: Map[Declaration[_], String] = Map.empty,
inSpec: Boolean = false,
withoutHash: Boolean = false,
) {
def namesIn[G](node: Node[G]): Ctx =
copy(names = {
Expand All @@ -31,10 +30,8 @@ case class Ctx(
namer.finish.asInstanceOf[Map[Declaration[_], String]]
})

def name(decl: Declaration[_]): String = {
val hash = if(withoutHash) "" else "_${decl.hashCode()}"
names.getOrElse(decl, s"${decl.o.getPreferredNameOrElse().ucamel}${hash}")
}
def name(decl: Declaration[_]): String =
names.getOrElse(decl, s"${decl.o.getPreferredNameOrElse().ucamel}_${decl.hashCode()}")

def name(ref: Ref[_, _ <: Declaration[_]]): String =
name(Try(ref.decl).getOrElse(return "?brokenref?"))
Expand Down

0 comments on commit 29201bf

Please sign in to comment.