mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 14:59:41 +08:00
Forgot to add the the params in the case of a class in the previous commit.
This commit is contained in:
@@ -192,8 +192,11 @@ class Parser(object):
|
|||||||
param, tok = self._parse_statement(added_breaks=breaks,
|
param, tok = self._parse_statement(added_breaks=breaks,
|
||||||
stmt_class=pr.Statement
|
stmt_class=pr.Statement
|
||||||
if is_class else pr.Param)
|
if is_class else pr.Param)
|
||||||
if not is_class:
|
if is_class:
|
||||||
if param and tok.string == ':':
|
if param is not None:
|
||||||
|
params.append(param)
|
||||||
|
else:
|
||||||
|
if param is not None and tok.string == ':':
|
||||||
# parse annotations
|
# parse annotations
|
||||||
annotation, tok = self._parse_statement(added_breaks=breaks)
|
annotation, tok = self._parse_statement(added_breaks=breaks)
|
||||||
if annotation:
|
if annotation:
|
||||||
@@ -201,7 +204,7 @@ class Parser(object):
|
|||||||
|
|
||||||
# function params without vars are usually syntax errors.
|
# function params without vars are usually syntax errors.
|
||||||
# expressions are valid in superclass declarations.
|
# expressions are valid in superclass declarations.
|
||||||
if param and param.get_defined_names():
|
if param is not None and param.get_defined_names():
|
||||||
param.position_nr = pos
|
param.position_nr = pos
|
||||||
params.append(param)
|
params.append(param)
|
||||||
pos += 1
|
pos += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user