Skip to content

Commit

Permalink
Fixed label for unknown positions, added javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Dec 5, 2024
1 parent b4ad14d commit 297af44
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/scala/verifier/Verifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ trait Verifier {
def reportFurtherErrors(): Boolean = (Verifier.config.numberOfErrorsToReport() > errorsReportedSoFar.get()
|| Verifier.config.numberOfErrorsToReport() == 0);

/**
* Returns debug labels for 1) the given heap (will reuse an existing one if one already exists), independently of
* the position of the current expression, and 2) the current expression in the given heap.
* @param s the current state
* @param pos the position of the current expression
* @param h the heap to consider, if not the heap from state s
* @return a pair containing the label of the given heap, and the label of the current expression in the given heap
*/
def getDebugOldLabel(s: State, pos: ast.Position, h: Option[Heap] = None): (String, String) = {
val posString = pos match {
case column: ast.HasLineColumn => s"l:${column.line + 1}.${column.column + 1}"
case _ => s"line:unknown"
case _ => s"l:unknown"
}
val heap = h match {
case Some(heap) => heap
Expand Down

0 comments on commit 297af44

Please sign in to comment.