Example #1
0
  /**
   * Print the faulty source code line and point to the error.
   *
   * @param pos Buffer index of the error position, must be on current line
   */
  private void printErrLine(int pos, PrintWriter writer) {
    String line = (source == null ? null : source.getLine(pos));
    if (line == null) return;
    int col = source.getColumnNumber(pos, false);

    printRawLines(writer, line);
    for (int i = 0; i < col - 1; i++) {
      writer.print((line.charAt(i) == '\t') ? "\t" : " ");
    }
    writer.println("^");
    writer.flush();
  }