From 02d463afad48835d8143a179c574ce5b246b3e31 Mon Sep 17 00:00:00 2001 From: kyessenov Date: Fri, 20 Aug 2010 00:39:58 +0000 Subject: VS 2010 mode for Chalice: some errors didn't show up in the window because positions were negative --- Chalice/src/Chalice.scala | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'Chalice/src/Chalice.scala') diff --git a/Chalice/src/Chalice.scala b/Chalice/src/Chalice.scala index 43b3a330..0b2d43c5 100644 --- a/Chalice/src/Chalice.scala +++ b/Chalice/src/Chalice.scala @@ -9,6 +9,7 @@ import java.io.InputStreamReader import java.io.File import java.io.FileWriter import scala.util.parsing.input.Position +import scala.util.parsing.input.NoPosition import collection.mutable.ListBuffer object Chalice { @@ -36,16 +37,6 @@ object Chalice { var boogiePath = "C:\\boogie\\Binaries\\Boogie.exe" val inputs = new ListBuffer[String]() var printProgram = false - - def ReportError(pos: Position, msg: String) = { - if (vsMode) { - val r = pos.line - 1; - val c = pos.column - 1; - Console.out.println(r + "," + c + "," + r + "," + (c+5) + ":" + msg); - } else { - Console.err.println(pos + ": " + msg) - } - } var doTypecheck = true var doTranslate = true var boogieArgs = " "; @@ -196,6 +187,14 @@ object Chalice { def CommandLineError(msg: String, help: String) = { Console.err.println("Error: " + msg) - Console.err.println(help); } + + def ReportError(pos: Position, msg: String) = { + if (vsMode) { + val (r,c) = (pos.line, pos.column) + Console.out.println(r + "," + c + "," + r + "," + (c+5) + ":" + msg); + } else { + Console.err.println(pos + ": " + msg) + } + } } -- cgit v1.2.3