]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - doxygen/thtml2doxy_clang.py
doxy: remove garbage lines from comments
[u/mrichter/AliRoot.git] / doxygen / thtml2doxy_clang.py
index 6c649a71c476fb30aee04355a20dd3db0a8f9840..0e09f1163f904af227d8c11535b81924fcc946b9 100755 (executable)
@@ -290,18 +290,18 @@ def traverse_ast(cursor, filename, comments, recursion=0):
   if cursor.kind == clang.cindex.CursorKind.CXX_METHOD or cursor.kind == clang.cindex.CursorKind.CONSTRUCTOR or cursor.kind == clang.cindex.CursorKind.DESTRUCTOR:
 
     # cursor ran into a C++ method
-    logging.debug( "%5d %s%s(%s)" % (cursor.extent.start.line, indent, Colt(kind).magenta(), Colt(text).blue()) )
+    logging.debug( "%5d %s%s(%s)" % (cursor.location.line, indent, Colt(kind).magenta(), Colt(text).blue()) )
     comment_method(cursor, comments)
 
   elif cursor.kind == clang.cindex.CursorKind.FIELD_DECL:
 
     # cursor ran into a data member declaration
-    logging.debug( "%5d %s%s(%s)" % (cursor.extent.start.line, indent, Colt(kind).magenta(), Colt(text).blue()) )
+    logging.debug( "%5d %s%s(%s)" % (cursor.location.line, indent, Colt(kind).magenta(), Colt(text).blue()) )
     comment_datamember(cursor, comments)
 
   else:
 
-    logging.debug( "%5d %s%s(%s)" % (cursor.extent.start.line, indent, kind, text) )
+    logging.debug( "%5d %s%s(%s)" % (cursor.location.line, indent, kind, text) )
 
   for child_cursor in cursor.get_children():
     traverse_ast(child_cursor, filename, comments, recursion+1)
@@ -313,6 +313,7 @@ def traverse_ast(cursor, filename, comments, recursion=0):
 def refactor_comment(comment):
 
   recomm = r'^(/{2,}|/\*)?\s*(.*?)\s*((/{2,})?\s*|\*/)$'
+  regarbage = r'^[\s*=-_#]+$'
 
   new_comment = []
   insert_blank = False
@@ -321,7 +322,8 @@ def refactor_comment(comment):
     mcomm = re.search( recomm, line_comment )
     if mcomm:
       new_line_comment = mcomm.group(2)
-      if new_line_comment == '':
+      mgarbage = re.search( regarbage, new_line_comment )
+      if new_line_comment == '' or mgarbage is not None:
         insert_blank = True
       else:
         if insert_blank and not wait_first_non_blank: