@@ -245,7 +245,7 @@ def _parse_param_list(self, content, single_element_is_type=False):
245
245
#
246
246
# <FUNCNAME>
247
247
# <FUNCNAME> SPACE* COLON SPACE+ <DESC> SPACE*
248
- # <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)* SPACE*
248
+ # <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)+ (COMMA | PERIOD)? SPACE*
249
249
# <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)* SPACE* COLON SPACE+ <DESC> SPACE*
250
250
251
251
# <FUNCNAME> is one of
@@ -258,8 +258,8 @@ def _parse_param_list(self, content, single_element_is_type=False):
258
258
# <DESC> is a string describing the function.
259
259
260
260
_role = r":(?P<role>\w+):"
261
- _funcbacktick = r"`(?P<name>(?:~\w+\.)?[a-zA-Z0-9_.-]+)`"
262
- _funcplain = r"(?P<name2>[a-zA-Z0-9_.-]+)"
261
+ _funcbacktick = r"`(?P<name>(?:~\w+\.)?[a-zA-Z0-9_\ .-]+)`"
262
+ _funcplain = r"(?P<name2>[a-zA-Z0-9_\ .-]+)"
263
263
_funcname = r"(" + _role + _funcbacktick + r"|" + _funcplain + r")"
264
264
_funcnamenext = _funcname .replace ('role' , 'rolenext' )
265
265
_funcnamenext = _funcnamenext .replace ('name' , 'namenext' )
@@ -271,7 +271,7 @@ def _parse_param_list(self, content, single_element_is_type=False):
271
271
_funcname +
272
272
r"(?P<morefuncs>([,]\s+" + _funcnamenext + r")*)" +
273
273
r")" + # end of "allfuncs"
274
- r"(?P<trailing>\s*, )?" + # Some function lists have a trailing comma
274
+ r"(?P<trailing>[,\.] )?" + # Some function lists have a trailing comma (or period) '\s*'
275
275
_description )
276
276
277
277
# Empty <DESC> elements are replaced with '..'
@@ -306,9 +306,9 @@ def parse_item_name(text):
306
306
description = None
307
307
if line_match :
308
308
description = line_match .group ('desc' )
309
- if line_match .group ('trailing' ):
309
+ if line_match .group ('trailing' ) and description :
310
310
self ._error_location (
311
- 'Unexpected comma after function list at index %d of '
311
+ 'Unexpected comma or period after function list at index %d of '
312
312
'line "%s"' % (line_match .end ('trailing' ), line ),
313
313
error = False )
314
314
if not description and line .startswith (' ' ):
0 commit comments