Skip to content

Commit

Permalink
Merge PR #22: Add SourceCoordinate.getLocationQualifier(int startInde…
Browse files Browse the repository at this point in the history
…x, Source source)
  • Loading branch information
smarr authored May 6, 2022
2 parents 470e40d + 0e008d3 commit f8764d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bd/source/SourceCoordinate.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public static String getLocationQualifier(final SourceSection section) {
return ":" + section.getStartLine() + ":" + section.getStartColumn();
}

public static String getLocationQualifier(final int startIndex, final Source source) {
int lineNumber = source.getLineNumber(startIndex);
int column = source.getColumnNumber(startIndex);
return ":" + lineNumber + ":" + column;
}

public static String getURI(final Source source) {
return source.getURI().toString();
}
Expand Down

0 comments on commit f8764d6

Please sign in to comment.