Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java @ 16674:70f47dbbcabd
Truffle/SourceAttribution: NodeUtil.displaySourceAttribution() outut revised for legibility.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Fri, 01 Aug 2014 16:28:06 -0700 |
parents | 8be5c68a779d |
children | e52ad0d3b7d6 |
comparison
equal
deleted
inserted
replaced
16673:9a8f4c9e11a8 | 16674:70f47dbbcabd |
---|---|
838 return "source: " + section.getShortDescription(); | 838 return "source: " + section.getShortDescription(); |
839 } | 839 } |
840 if (section != null) { | 840 if (section != null) { |
841 final String srcText = section.getCode(); | 841 final String srcText = section.getCode(); |
842 final StringBuilder sb = new StringBuilder(); | 842 final StringBuilder sb = new StringBuilder(); |
843 sb.append("source: len=" + srcText.length()); | 843 sb.append("source:"); |
844 sb.append(" (" + section.getCharIndex() + "," + (section.getCharEndIndex() - 1) + ")"); | 844 sb.append(" (" + section.getCharIndex() + "," + (section.getCharEndIndex() - 1) + ")"); |
845 sb.append(" ___" + srcText + "___"); | 845 sb.append(" len=" + srcText.length()); |
846 sb.append(" text=\"" + srcText + "\""); | |
846 return sb.toString(); | 847 return sb.toString(); |
847 } | 848 } |
848 return ""; | 849 return ""; |
849 } | 850 } |
850 | 851 |