comparison 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
comparison
equal deleted inserted replaced
19694:787b5aa53401 19695:33bdafbf285d
849 @Override 849 @Override
850 public int getStartColumn() { 850 public int getStartColumn() {
851 return startColumn; 851 return startColumn;
852 } 852 }
853 853
854 public int getEndLine() {
855 return source.getLineNumber(charIndex + charLength - 1);
856 }
857
858 public int getEndColumn() {
859 return source.getColumnNumber(charIndex + charLength - 1);
860 }
861
854 @Override 862 @Override
855 public int getCharIndex() { 863 public int getCharIndex() {
856 return charIndex; 864 return charIndex;
857 } 865 }
858 866
937 if (startLine != other.startLine) { 945 if (startLine != other.startLine) {
938 return false; 946 return false;
939 } 947 }
940 return true; 948 return true;
941 } 949 }
942
943 } 950 }
944 951
945 private static final class LineLocationImpl implements LineLocation { 952 private static final class LineLocationImpl implements LineLocation {
946 private final Source source; 953 private final Source source;
947 private final int line; 954 private final int line;