changeset 16514:247a6c2fc382

SL: update tests; error locations reported differently with source attribution change.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 15 Jul 2014 14:22:14 -0700
parents d86f948268da
children d6ac7470603e
files graal/com.oracle.truffle.sl.test/tests/String.output graal/com.oracle.truffle.sl.test/tests/error/TypeError01.output graal/com.oracle.truffle.sl.test/tests/error/TypeError03.output graal/com.oracle.truffle.sl.test/tests/error/TypeError04.output graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java
diffstat 5 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl.test/tests/String.output	Mon Jul 14 17:06:32 2014 -0700
+++ b/graal/com.oracle.truffle.sl.test/tests/String.output	Tue Jul 15 14:22:14 2014 -0700
@@ -7,4 +7,4 @@
 bars
 foos
 2 < 4: true
-Type error at String.sl line 9 col 36: operation "<" not defined for Number 2, String "4"
+Type error at String.sl line 9 col 34: operation "<" not defined for Number 2, String "4"
--- a/graal/com.oracle.truffle.sl.test/tests/error/TypeError01.output	Mon Jul 14 17:06:32 2014 -0700
+++ b/graal/com.oracle.truffle.sl.test/tests/error/TypeError01.output	Tue Jul 15 14:22:14 2014 -0700
@@ -1,1 +1,1 @@
-Type error at TypeError01.sl line 2 col 5: operation "-" not defined for Number 3, String "4"
+Type error at TypeError01.sl line 2 col 3: operation "-" not defined for Number 3, String "4"
--- a/graal/com.oracle.truffle.sl.test/tests/error/TypeError03.output	Mon Jul 14 17:06:32 2014 -0700
+++ b/graal/com.oracle.truffle.sl.test/tests/error/TypeError03.output	Tue Jul 15 14:22:14 2014 -0700
@@ -1,1 +1,1 @@
-Type error at TypeError03.sl line 2 col 7: operation "&&" not defined for String "4", ANY
+Type error at TypeError03.sl line 2 col 3: operation "&&" not defined for String "4", ANY
--- a/graal/com.oracle.truffle.sl.test/tests/error/TypeError04.output	Mon Jul 14 17:06:32 2014 -0700
+++ b/graal/com.oracle.truffle.sl.test/tests/error/TypeError04.output	Tue Jul 15 14:22:14 2014 -0700
@@ -1,1 +1,1 @@
-Type error at TypeError04.sl line 2 col 11: operation "||" not defined for Boolean false, Number 4
+Type error at TypeError04.sl line 2 col 4: operation "||" not defined for Boolean false, Number 4
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Mon Jul 14 17:06:32 2014 -0700
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Tue Jul 15 14:22:14 2014 -0700
@@ -245,9 +245,7 @@
         result.append("Type error");
         if (ex.getNode() != null && ex.getNode().getSourceSection() != null) {
             SourceSection ss = ex.getNode().getSourceSection();
-            if (ss == null || ss instanceof NullSourceSection) {
-                result.append(" at <unknown>");
-            } else {
+            if (ss != null && !(ss instanceof NullSourceSection)) {
                 result.append(" at ").append(ss.getSource().getName()).append(" line ").append(ss.getStartLine()).append(" col ").append(ss.getStartColumn());
             }
         }