diff options
author | paltherr <paltherr@epfl.ch> | 2003-06-24 08:57:30 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-06-24 08:57:30 +0000 |
commit | 9753961477f1f648656ec130675ed1b78f4f73b1 (patch) | |
tree | 3d0d93f692d5f7ca3a0eedfe1b0b74eab6dd027d /sources/scalac/Unit.java | |
parent | 3102d7d40fcc65e6174e84d5424cd45d688c0257 (diff) | |
download | scala-9753961477f1f648656ec130675ed1b78f4f73b1.tar.gz scala-9753961477f1f648656ec130675ed1b78f4f73b1.tar.bz2 scala-9753961477f1f648656ec130675ed1b78f4f73b1.zip |
- Removed file from encoded positions
Diffstat (limited to 'sources/scalac/Unit.java')
-rw-r--r-- | sources/scalac/Unit.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sources/scalac/Unit.java b/sources/scalac/Unit.java index 0a529efbfb..354fc1af55 100644 --- a/sources/scalac/Unit.java +++ b/sources/scalac/Unit.java @@ -52,16 +52,22 @@ public class Unit { this.console = console; } + /** return the position representing the given encoded position + */ + public Position position(int pos) { + return new Position(source, pos); + } + /** issue an error in this compilation unit at a specific location */ public void error(int pos, String message) { - global.reporter.error(decode(pos), message); + global.reporter.error(position(pos), message); } /** issue a warning in this compilation unit at a specific location */ public void warning(int pos, String message) { - global.reporter.warning(decode(pos), message); + global.reporter.warning(position(pos), message); } /** return a string representation @@ -70,13 +76,4 @@ public class Unit { return source.toString(); } - - private Position decode(int pos) { - Position position = new Position(pos); - if (position.file().id() == 0) - if (/* !!! source.id() > Position.FILE_MASK && */ position.line() != 0) - return source.getPosition(position.line(), position.column()); - return position; - } - } |