Skip to content

Commit 014db3d

Browse files
committed
Clarify types and print stack-trace on exception in parser
1 parent f2c714e commit 014db3d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/scala/viper/silver/parser/FastParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object FastParser {
3838
*/
3939
def FP[T](t: => P[T])(implicit ctx: P[_]): P[((FilePosition, FilePosition), T)] = {
4040
val startPos = LineCol(ctx.index)
41-
val res = t
41+
val res: P[T] = t
4242
val finishPos = LineCol(ctx.index)
4343
res.map({ parsed => ((FilePosition(_file, startPos._1, startPos._2), FilePosition(_file, finishPos._1, finishPos._2)), parsed) })
4444
}

src/main/scala/viper/silver/reporter/Reporter.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ case class StdIOReporter(name: String = "stdout_reporter", timeInfo: Boolean = t
112112

113113
case ExceptionReport(e) =>
114114
/** Theoretically, we may encounter an exceptional message that has
115-
* not yet been reported via AbortedExceptionally. */
115+
* not yet been reported via AbortedExceptionally. This can happen
116+
* if we encounter exeptions in e.g. the parser. */
116117
println( s"Verification aborted exceptionally: ${e.toString}" )
118+
e.printStackTrace(System.out);
117119
Option(e.getCause) match {
118120
case Some(cause) => println( s" Cause: ${cause.toString}" )
119121
case None =>

0 commit comments

Comments
 (0)