Skip to content

Commit 6abf8a0

Browse files
committed
DocumentationComment.py: Add in-line comment
Add subsequent in-line comment to `if-else` block.
1 parent fa26911 commit 6abf8a0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎coalib/bearlib/languages/documentation/DocumentationComment.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,16 @@ def _parse_documentation_with_symbols(self,
118118

119119
if stripped_line.startswith(param_identifiers[0]):
120120
parse_mode = self.Parameter
121+
# param_offset contains the starting column of param's name.
121122
param_offset = line.find(
122123
param_identifiers[0]) + len(param_identifiers[0])
124+
# splitted contains the whole line from the param's name,
125+
# which in turn is further divided into its name and desc.
123126
splitted = line[param_offset:].split(param_identifiers[1], 1)
124127
cur_param = splitted[0].strip()
125128

126129
param_desc = splitted[1]
130+
# parsed section is added to the final list.
127131
parsed.append(self.Parameter(name=cur_param, desc=param_desc))
128132

129133
elif stripped_line.startswith(exception_identifiers[0]):
@@ -145,6 +149,9 @@ def _parse_documentation_with_symbols(self,
145149
retval_desc = line[return_offset:]
146150
parsed.append(self.ReturnValue(desc=retval_desc))
147151

152+
# These conditions will take care if the parsed section
153+
# descriptions are not on the same line as that of it's
154+
# name. Further, adding the parsed section to the final list.
148155
elif parse_mode == self.ReturnValue:
149156
retval_desc += line
150157
parsed.pop()

0 commit comments

Comments
 (0)