use of kalang.compiler.OffsetRange in project kalang by kasonyang.
the class OffsetRangeHelper method getOffsetRange.
public static OffsetRange getOffsetRange(Token start, Token stop) {
OffsetRange offset = new OffsetRange();
offset.startOffset = start.getStartIndex();
offset.stopOffset = stop.getStopIndex();
offset.startLine = start.getLine();
offset.startLineColumn = start.getCharPositionInLine();
offset.stopLine = stop.getLine();
offset.stopLineColumn = stop.getCharPositionInLine();
return offset;
}
use of kalang.compiler.OffsetRange in project kalang by kasonyang.
the class KalangClassLoader method handleDiagnosis.
@Override
public void handleDiagnosis(Diagnosis diagnosis) {
if (diagnosis.getKind().isError()) {
KalangSource source = diagnosis.getSource();
OffsetRange offset = diagnosis.getOffset();
throw new CompileException(String.format("%s:%s\n%s", source.getFileName(), offset.startLine, diagnosis.getDescription()));
}
}
Aggregations