@Override public int getEndColumn(Object impl) { SourceSection section = (SourceSection) impl; return section.getEndColumn(); }
@Override public int getEndColumn(Object impl) { SourceSection section = (SourceSection) impl; return section.getEndColumn(); }
@Override boolean isIncluded(Set<Class<?>> providedTags, Node instrumentedNode, SourceSection sourceSection) { int otherStart = sourceSection.getStartColumn(); int otherEnd; if (sourceSection.getSource() == null) { otherEnd = otherStart; } else { otherEnd = sourceSection.getEndColumn(); } for (IndexRange indexRange : ranges) { if (indexRange.contains(otherEnd, otherEnd)) { return true; } } return false; }
@Override boolean isIncluded(Set<Class<?>> providedTags, Node instrumentedNode, SourceSection sourceSection) { int otherStart = sourceSection.getStartColumn(); int otherEnd; if (sourceSection.getSource() == null) { otherEnd = otherStart; } else { otherEnd = sourceSection.getEndColumn(); } for (IndexRange indexRange : ranges) { if (indexRange.contains(otherEnd, otherEnd)) { return true; } } return false; }
b.append(':').append(getEndColumn());
SourceSection adjustLocation(Source source, TruffleInstrument.Env env, SuspendAnchor suspendAnchor) { if (sourceSection != null) { return sourceSection; } if (key == null) { return null; } boolean hasColumn = column > 0; SourceSection location = SuspendableLocationFinder.findNearest(source, sourceElements, line, column, suspendAnchor, env); if (location != null) { switch (suspendAnchor) { case BEFORE: line = location.getStartLine(); if (hasColumn) { column = location.getStartColumn(); } break; case AFTER: line = location.getEndLine(); if (hasColumn) { column = location.getEndColumn(); } break; default: throw new IllegalArgumentException("Unknown suspend anchor: " + suspendAnchor); } } return location; }
@Override SourceSection adjustLocation(Source source, TruffleInstrument.Env env, SuspendAnchor suspendAnchor) { if (sourceSection != null) { return sourceSection; } if (key == null) { return null; } boolean hasColumn = column > 0; SourceSection location = SuspendableLocationFinder.findNearest(source, sourceElements, line, column, suspendAnchor, env); if (location != null) { switch (suspendAnchor) { case BEFORE: line = location.getStartLine(); if (hasColumn) { column = location.getStartColumn(); } break; case AFTER: line = location.getEndLine(); if (hasColumn) { column = location.getEndColumn(); } break; default: throw new IllegalArgumentException("Unknown suspend anchor: " + suspendAnchor); } } return location; }
static boolean isColumnIn(SourceSection sourceSection, IndexRange[] ranges) { if (!sourceSection.isAvailable()) { return false; } int otherStart = sourceSection.getStartColumn(); int otherEnd; if (sourceSection.getSource() == null) { otherEnd = otherStart; } else { otherEnd = sourceSection.getEndColumn(); } for (IndexRange indexRange : ranges) { if (indexRange.contains(otherStart, otherEnd)) { return true; } } return false; }
static boolean isColumnIn(SourceSection sourceSection, IndexRange[] ranges) { if (!sourceSection.isAvailable()) { return false; } int otherStart = sourceSection.getStartColumn(); int otherEnd; if (sourceSection.getSource() == null) { otherEnd = otherStart; } else { otherEnd = sourceSection.getEndColumn(); } for (IndexRange indexRange : ranges) { if (indexRange.contains(otherStart, otherEnd)) { return true; } } return false; }
} else if (section.hasColumns()) { return rSource.createSection(section.getStartLine(), section.getStartColumn(), section.getEndLine(), section.getEndColumn()); } else if (section.hasLines()) { int startLine = section.getStartLine();
static JSONObject sourceSectionToJSON(SourceSection sourceSection) { JSONObject sourceSectionJson = new JSONObject(); if (sourceSection != null) { Source source = sourceSection.getSource(); if (source != null) { if (source.getLanguage() != null) { sourceSectionJson.put("language", source.getLanguage().toString()); } String path = source.getPath(); if (path != null) { sourceSectionJson.put("path", path); } } sourceSectionJson.put("source_name", sourceSection.getSource().getName()); sourceSectionJson.put("start_line", sourceSection.getStartLine()); sourceSectionJson.put("end_line", sourceSection.getEndLine()); sourceSectionJson.put("start_column", sourceSection.getStartColumn()); sourceSectionJson.put("end_column", sourceSection.getEndColumn()); } return sourceSectionJson; }