]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
doxy: correctly consider macro blocks in methods
authordberzano <dario.berzano@cern.ch>
Wed, 11 Feb 2015 20:26:38 +0000 (21:26 +0100)
committerdberzano <dario.berzano@cern.ch>
Wed, 11 Feb 2015 21:02:15 +0000 (22:02 +0100)
doxygen/thtml2doxy.py

index 243b747287171db2ec6ad43b0116ab20f16d3012..15f54e9f51e15d87ab6b0c10d4347aa75d77bb1c 100755 (executable)
@@ -743,29 +743,6 @@ def refactor_comment(comment, do_strip_html=True, infilename=None):
   wait_first_non_blank = True
   for line_comment in comment:
 
-    # Check if we are in a macro block
-    mmacro = re.search(remacro, line_comment)
-    if mmacro:
-      if in_macro:
-        in_macro = False
-
-        # Dump macro
-        outimg = write_macro(infilename, current_macro) + '.png'
-        current_macro = []
-
-        # Insert image
-        new_comment.append( '![Picture from ROOT macro](%s)' % (os.path.basename(outimg)) )
-
-        logging.debug( 'Found macro for generating image %s' % Colt(outimg).magenta() )
-
-      else:
-        in_macro = True
-
-      continue
-    elif in_macro:
-      current_macro.append( line_comment )
-      continue
-
     # Strip some HTML tags
     if do_strip_html:
       line_comment = strip_html(line_comment)
@@ -774,6 +751,29 @@ def refactor_comment(comment, do_strip_html=True, infilename=None):
     if mcomm:
       new_line_comment = mcomm.group(2) + mcomm.group(3)  # indent + comm
 
+      # Check if we are in a macro block
+      mmacro = re.search(remacro, new_line_comment)
+      if mmacro:
+        if in_macro:
+          in_macro = False
+
+          # Dump macro
+          outimg = write_macro(infilename, current_macro) + '.png'
+          current_macro = []
+
+          # Insert image
+          new_comment.append( '![Picture from ROOT macro](%s)' % (os.path.basename(outimg)) )
+
+          logging.debug( 'Found macro for generating image %s' % Colt(outimg).magenta() )
+
+        else:
+          in_macro = True
+
+        continue
+      elif in_macro:
+        current_macro.append( new_line_comment )
+        continue
+
       mgarbage = re.search( regarbage, new_line_comment )
 
       if mgarbage is None and not mcomm.group(3).startswith('\\') and mcomm.group(3) != '':