code: private TextPosition startOf(String token, ASTNode node) {
      // try to compensate for the fact that getLastLineNumber() is sometimes wrong
      int lastLineIndex = Math.max(node.getLineNumber(), node.getLastLineNumber()) - 1;
  
      for (int lineIndex = lastLineIndex; lineIndex >= 0; lineIndex--) {
        int columnIndex = lineIndex == lastLineIndex ?
            lines[lineIndex].lastIndexOf(token, node.getColumnNumber() - 1) :
            lines[lineIndex].lastIndexOf(token);
        if (columnIndex != -1)
          return TextPosition.create(lineIndex + 1, columnIndex + 1);
      }
  
      throw new IllegalArgumentException(String.format("token %s not found in expression", token));
    }
docs: IDEA: move to class TextPosition?