add parsing of //! style docstrings
MODIFY
hdr_parser.py
hdr_parser.py
@@ -905,7 +905,7 @@ class CppHeaderParser(object):
sys.exit(-1)
while 1:
- token, pos = self.find_next_token(l, [";", "\"", "{", "}", "//", "/*"])
+ token, pos = self.find_next_token(l, [";", "\"", "{", "}", "//!", "//", "/*"])
if not token:
block_head += " " + l
@@ -915,6 +915,11 @@ class CppHeaderParser(object):
block_head += " " + l[:pos]
break
+ if token == "//!":
+ block_head += " " + l[:pos]
+ docstring += l[pos+3:].lstrip() + "\n"
+ break
+
if token == "/*":
block_head += " " + l[:pos]
end_pos = l.find("*/", pos+2)
@@ -979,6 +984,8 @@ class CppHeaderParser(object):
_, _, _, umat_decl = self.parse_stmt(stmt, token, use_umat=True, docstring=docstring)
decls.append(umat_decl)
docstring = ""
+ elif parse_flag:
+ docstring = ""
if stmt_type == "namespace":
chunks = [block[1] for block in self.block_stack if block[0] == 'namespace'] + [name]
self.namespaces.add('.'.join(chunks))

add parsing of //! style docstrings