Permalink
Browse files

DocumentationComment: Fix missing ending colon

Fix for missing ending colon, which made parser
to break.
Fixes #2143
  • Loading branch information...
damngamerz committed Jun 25, 2017
1 parent 852ba5e commit fa7bd17c685918cc33ee9a4ef88a539812fc61bc
@@ -131,6 +131,11 @@ def _parse_documentation_with_symbols(self,
# 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)
# parser breaks if param_identifiers[1] is not present.
# This checks for space and then splits the line accordingly
# to extract param's name and desc.
if len(splitted) == 1:
splitted = line[param_offset:].split(' ', 1)
cur_param = splitted[0].strip()
param_desc = splitted[1]
@@ -143,6 +148,11 @@ def _parse_documentation_with_symbols(self,
exception_identifiers[0]) + len(exception_identifiers[0])
splitted = line[exception_offset:].split(
exception_identifiers[1], 1)
# parser breaks if exception_identifiers[1] is not present.
# This checks for space and then splits the line accordingly
# to extract exception's name and desc.
if len(splitted) == 1:
splitted = line[exception_offset:].split(' ', 1)
cur_exception = splitted[0].strip()
exception_desc = splitted[1]
@@ -214,6 +214,17 @@ def test_python_doxygen(self):
self.assertEqual(parsed_docs, expected)
def test_python_missing_ending_colon(self):
doc = (' This is a malformed docstring\n'
' :param abc test description1\n'
' :raises xyz test description2\n')
expected = [self.Description(desc=' This is a malformed docstring\n'),
self.Parameter(name='abc',
desc=' test description1\n'),
self.ExceptionValue(name='xyz',
desc=' test description2\n')]
self.check_docstring(doc, expected)
class JavaDocumentationCommentTest(DocumentationCommentTest):

0 comments on commit fa7bd17

Please sign in to comment.