[Lldb-commits] [lldb] r134326 - /lldb/trunk/scripts/Python/modify-python-lldb.py
Johnny Chen
johnny.chen at apple.com
Sat Jul 2 13:01:09 PDT 2011
Author: johnny
Date: Sat Jul 2 15:01:09 2011
New Revision: 134326
URL: http://llvm.org/viewvc/llvm-project?rev=134326&view=rev
Log:
Refine the post-processing phase of lldb.py to remove some more doxygen/c++-comment residues.
Modified:
lldb/trunk/scripts/Python/modify-python-lldb.py
Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=134326&r1=134325&r2=134326&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Sat Jul 2 15:01:09 2011
@@ -8,7 +8,7 @@
#
# As a cleanup step, it also removes the 'residues' from the autodoc features of
# swig. For an example, take a look at SBTarget.h header file, where we take
-# advantage of the already existing C++-style headerdoc and make it the Python
+# advantage of the already existing doxygen C++-docblock and make it the Python
# docstring for the same method. The 'residues' in this context include the
# '#endif' and the '#ifdef SWIG' lines.
#
@@ -28,6 +28,9 @@
# Residues to be removed.
c_endif_swig = "#endif"
c_ifdef_swig = "#ifdef SWIG"
+c_comment_marker = "//------------"
+# The pattern for recognizing the doxygen comment block line.
+doxygen_comment_start = re.compile("^\s*( /// ?)")
#
# lldb_iter() should appear before our first SB* class definition.
@@ -161,8 +164,15 @@
# Cleanse the lldb.py of the autodoc'ed residues.
if c_ifdef_swig in line or c_endif_swig in line:
continue
+ # As well as the comment marker line.
+ if c_comment_marker in line:
+ continue
# Also remove the '\a ' substrings.
line = line.replace('\a ', '')
+ # And the leading '///' substring.
+ doxygen_comment_match = doxygen_comment_start.match(line)
+ if doxygen_comment_match:
+ line = line.replace(doxygen_comment_match.group(1), '', 1)
if state == NORMAL:
match = class_pattern.search(line)
More information about the lldb-commits
mailing list