comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/DefaultASTPrinter.java @ 21987:b2d1c8ff592a

Less classes in the source API package. Merging interfaces and their only implementation into final classes. Hiding NullSourceSection behind factory method. Using JDK's standard CharsetDecoder instead of proprietary BytesDecoder.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 01 Jul 2015 10:23:36 +0200
parents 9c8c0937da41
children dc83cc1f94f2
comparison
equal deleted inserted replaced
21986:67ea94a23074 21987:b2d1c8ff592a
185 } 185 }
186 186
187 protected static String sourceInfo(Node node) { 187 protected static String sourceInfo(Node node) {
188 final SourceSection src = node.getSourceSection(); 188 final SourceSection src = node.getSourceSection();
189 if (src != null) { 189 if (src != null) {
190 if (src instanceof NullSourceSection) { 190 if (src.getSource() == null) {
191 final NullSourceSection nullSection = (NullSourceSection) src; 191 return src.getShortDescription();
192 return nullSection.getShortDescription();
193 } else { 192 } else {
194 return src.getSource().getName() + ":" + src.getStartLine(); 193 return src.getSource().getName() + ":" + src.getStartLine();
195 } 194 }
196 } 195 }
197 return ""; 196 return "";