@@ -245,7 +245,7 @@ def _parse_param_list(self, content, single_element_is_type=False):
245245 #
246246 # <FUNCNAME>
247247 # <FUNCNAME> SPACE* COLON SPACE+ <DESC> SPACE*
248- # <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)* SPACE*
248+ # <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)+ (COMMA | PERIOD)? SPACE*
249249 # <FUNCNAME> ( COMMA SPACE+ <FUNCNAME>)* SPACE* COLON SPACE+ <DESC> SPACE*
250250
251251 # <FUNCNAME> is one of
@@ -258,8 +258,8 @@ def _parse_param_list(self, content, single_element_is_type=False):
258258 # <DESC> is a string describing the function.
259259
260260 _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_\ .-]+)"
263263 _funcname = r"(" + _role + _funcbacktick + r"|" + _funcplain + r")"
264264 _funcnamenext = _funcname .replace ('role' , 'rolenext' )
265265 _funcnamenext = _funcnamenext .replace ('name' , 'namenext' )
@@ -271,7 +271,7 @@ def _parse_param_list(self, content, single_element_is_type=False):
271271 _funcname +
272272 r"(?P<morefuncs>([,]\s+" + _funcnamenext + r")*)" +
273273 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*'
275275 _description )
276276
277277 # Empty <DESC> elements are replaced with '..'
@@ -306,9 +306,9 @@ def parse_item_name(text):
306306 description = None
307307 if line_match :
308308 description = line_match .group ('desc' )
309- if line_match .group ('trailing' ):
309+ if line_match .group ('trailing' ) and description :
310310 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 '
312312 'line "%s"' % (line_match .end ('trailing' ), line ),
313313 error = False )
314314 if not description and line .startswith (' ' ):
0 commit comments