Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java @ 19695:33bdafbf285d
Truffle: SourceSection can now produce the line/column coordinates of its final character
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 03 Mar 2015 17:11:46 -0800 |
parents | 787b5aa53401 |
children | c152a485d747 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Tue Mar 03 16:54:43 2015 -0800 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Tue Mar 03 17:11:46 2015 -0800 @@ -851,6 +851,14 @@ return startColumn; } + public int getEndLine() { + return source.getLineNumber(charIndex + charLength - 1); + } + + public int getEndColumn() { + return source.getColumnNumber(charIndex + charLength - 1); + } + @Override public int getCharIndex() { return charIndex; @@ -939,7 +947,6 @@ } return true; } - } private static final class LineLocationImpl implements LineLocation {