Permalink
Browse files

DocumentationComment.py: Add in-line comment

Add subsequent in-line comment to `if-else` block.
  • Loading branch information...
damngamerz committed Jun 9, 2017
1 parent fa26911 commit 6abf8a024afc904af9773e7033dd491048030da8
Showing with 7 additions and 0 deletions.
  1. +7 −0 coalib/bearlib/languages/documentation/DocumentationComment.py
@@ -118,12 +118,16 @@ def _parse_documentation_with_symbols(self,
if stripped_line.startswith(param_identifiers[0]):
parse_mode = self.Parameter
# param_offset contains the starting column of param's name.
param_offset = line.find(
param_identifiers[0]) + len(param_identifiers[0])
# splitted contains the whole line from the param's name,
# which in turn is further divided into its name and desc.
splitted = line[param_offset:].split(param_identifiers[1], 1)
cur_param = splitted[0].strip()
param_desc = splitted[1]
# parsed section is added to the final list.
parsed.append(self.Parameter(name=cur_param, desc=param_desc))
elif stripped_line.startswith(exception_identifiers[0]):
@@ -145,6 +149,9 @@ def _parse_documentation_with_symbols(self,
retval_desc = line[return_offset:]
parsed.append(self.ReturnValue(desc=retval_desc))
# These conditions will take care if the parsed section
# descriptions are not on the same line as that of it's
# name. Further, adding the parsed section to the final list.
elif parse_mode == self.ReturnValue:
retval_desc += line
parsed.pop()

0 comments on commit 6abf8a0

Please sign in to comment.