Пример #1
0
 private int getLastChildLine(FSTDirective directive, int lastLine) {
   for (FSTDirective child : directive.getChildren()) {
     int childEnd = child.getEndLine();
     if (child.getEndLength() > 0) {
       childEnd++;
     }
     lastLine = Math.max(childEnd, lastLine);
     lastLine = Math.max(getLastChildLine(child, lastLine), lastLine);
   }
   return lastLine;
 }
Пример #2
0
  private boolean hasChildAtLine(FSTDirective directive, int line, boolean hasValidColor) {
    for (FSTDirective child : directive.getChildren()) {
      int start = child.getStartLine();
      int end = child.getEndLine();

      if (line >= start
          && line <= end
          && (!hasValidColor || child.getColor() != FeatureColor.NO_COLOR.getValue())) {
        return true;
      }
      if (hasChildAtLine(child, line, hasValidColor)) {
        return true;
      }
    }
    return false;
  }