summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-08-30 21:50:38 +0200
committerMartin Odersky <odersky@gmail.com>2012-08-30 22:12:22 +0200
commitb2ecb931e13abb18c25ac6d49c18e974e1dd793e (patch)
tree4a5d0b53bc0383fb042cb7919e09c39ecc90acc8 /src/library
parentc03777b3acb3a4e921a27b58322d198e6d6c58f5 (diff)
downloadscala-b2ecb931e13abb18c25ac6d49c18e974e1dd793e.tar.gz
scala-b2ecb931e13abb18c25ac6d49c18e974e1dd793e.tar.bz2
scala-b2ecb931e13abb18c25ac6d49c18e974e1dd793e.zip
Made instrumenter more robust by looking at tokens
Made instrumenter more robust by taking into account the positions of the tokens in the source. This allows us to reliably put instrumentation code at the end of the previous token, which tends to put it at end of lines. Furthermore, we now skip left parents. Previously, the instrumenter got confused for a statement like ( x + 1 ) because it thought that the statement started at the `x` and not at the `(`. Another small change is that we now use decoded names in the worksheet. So ??? will show as ??? not $qmark$qmark$qmark.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/runtime/WorksheetSupport.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/runtime/WorksheetSupport.scala b/src/library/scala/runtime/WorksheetSupport.scala
index 6f2a4d382d..a003bba034 100644
--- a/src/library/scala/runtime/WorksheetSupport.scala
+++ b/src/library/scala/runtime/WorksheetSupport.scala
@@ -40,9 +40,9 @@ object WorksheetSupport {
write((currentOffset+" ").getBytes)
}
out.write(c)
- col =
+ col =
if (c == '\n') -1
- else if (c == '\t') (col / tabInc) * tabInc + tabInc
+ else if (c == '\t') (col / tabInc) * tabInc + tabInc
else col + 1
if (col >= width) writeOne('\n')
}
@@ -86,7 +86,7 @@ object WorksheetSupport {
def $stop() = throw new StopException
- def $show(x: Any): String = stringOf(x, scala.Int.MaxValue)
+ def $show(x: Any): String = stringOf(x)
}
class StopException extends Exception