Exemplo n.º 1
0
 /**
  * Checks if the specified position intersects with a CPP comment.
  *
  * @param startLineNo the starting line number
  * @param startColNo the starting column number
  * @param endLineNo the ending line number
  * @param endColNo the ending column number
  * @return true if the positions intersects with a CPP comment.
  */
 private boolean hasIntersectionWithCppComment(
     int startLineNo, int startColNo, int endLineNo, int endColNo) {
   // Check CPP comments (line searching is possible)
   for (int lineNumber = startLineNo; lineNumber <= endLineNo; lineNumber++) {
     final TextBlock comment = cppComments.get(lineNumber);
     if (comment != null && comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 2
0
 /**
  * Checks if the specified position intersects with a C comment.
  *
  * @param startLineNo the starting line number
  * @param startColNo the starting column number
  * @param endLineNo the ending line number
  * @param endColNo the ending column number
  * @return true if the positions intersects with a C comment.
  */
 private boolean hasIntersectionWithCComment(
     int startLineNo, int startColNo, int endLineNo, int endColNo) {
   // Check C comments (all comments should be checked)
   final Collection<List<TextBlock>> values = clangComments.values();
   for (final List<TextBlock> row : values) {
     for (final TextBlock comment : row) {
       if (comment.intersects(startLineNo, startColNo, endLineNo, endColNo)) {
         return true;
       }
     }
   }
   return false;
 }