Skip to content

Commit

Permalink
parser: unify line spacing, remove stale comments
Browse files Browse the repository at this point in the history
Unify the line spacing in _recursive_parse. Remove a couple of stale
comments while at it.
  • Loading branch information
jnikula committed Nov 19, 2023
1 parent 0a4a2c1 commit 327a00c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hawkmoth/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _comment_extract(tu):
def _recursive_parse(errors, cursor, nest):

if cursor.kind == CursorKind.MACRO_DEFINITION:
# FIXME: check args against comment

if cursor.args is None:
ds = docstring.MacroDocstring(cursor=cursor, nest=nest)
else:
Expand All @@ -213,7 +213,6 @@ def _recursive_parse(errors, cursor, nest):
return [ds]

elif cursor.kind == CursorKind.TYPEDEF_DECL:
# FIXME: function pointers typedefs.

ds = docstring.TypeDocstring(cursor=cursor, nest=nest)

Expand Down Expand Up @@ -244,19 +243,24 @@ def _recursive_parse(errors, cursor, nest):
return [ds]

elif cursor.kind == CursorKind.ENUM_CONSTANT_DECL:

ds = docstring.EnumeratorDocstring(cursor=cursor, nest=nest)

return [ds]

elif cursor.kind == CursorKind.FUNCTION_DECL:

ds = docstring.FunctionDocstring(cursor=cursor, nest=nest)

return [ds]

elif cursor.kind in [CursorKind.CONSTRUCTOR,
CursorKind.DESTRUCTOR,
CursorKind.CXX_METHOD,
CursorKind.FUNCTION_TEMPLATE]:

ds = docstring.FunctionDocstring(cursor=cursor, nest=nest)

return [ds]

# If we reach here, nothing matched i.e. there's a documentation comment
Expand Down

0 comments on commit 327a00c

Please sign in to comment.