mirror of
https://github.com/davidhalter/parso.git
synced 2026-02-20 16:48:54 +08:00
Correct a parent issue in param rewriting.
This commit is contained in:
@@ -28,6 +28,7 @@ Any subclasses of :class:`Scope`, including :class:`Module` has an attribute
|
|||||||
from parso._compatibility import utf8_repr, unicode
|
from parso._compatibility import utf8_repr, unicode
|
||||||
from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, \
|
from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, \
|
||||||
search_ancestor
|
search_ancestor
|
||||||
|
from parso.python import normalizer
|
||||||
from parso.python import pep8
|
from parso.python import pep8
|
||||||
from parso.python.prefix import split_prefix
|
from parso.python.prefix import split_prefix
|
||||||
|
|
||||||
@@ -96,6 +97,10 @@ class PythonMixin(object):
|
|||||||
return result
|
return result
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def _iter_errors(self):
|
||||||
|
config = normalizer.ErrorFinderConfig()
|
||||||
|
return self._get_normalizer_issues(config)
|
||||||
|
|
||||||
|
|
||||||
class PythonLeaf(PythonMixin, Leaf):
|
class PythonLeaf(PythonMixin, Leaf):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
@@ -457,9 +462,10 @@ def _create_params(parent, argslist_list):
|
|||||||
if child is None or child == ',':
|
if child is None or child == ',':
|
||||||
param_children = children[start:end]
|
param_children = children[start:end]
|
||||||
if param_children: # Could as well be comma and then end.
|
if param_children: # Could as well be comma and then end.
|
||||||
if check_python2_nested_param(param_children[0]):
|
if param_children[0] == '*' and param_children[1] == ',' \
|
||||||
new_children += param_children
|
or check_python2_nested_param(param_children[0]):
|
||||||
elif param_children[0] == '*' and param_children[1] == ',':
|
for p in param_children:
|
||||||
|
p.parent = parent
|
||||||
new_children += param_children
|
new_children += param_children
|
||||||
else:
|
else:
|
||||||
new_children.append(Param(param_children, parent))
|
new_children.append(Param(param_children, parent))
|
||||||
|
|||||||
Reference in New Issue
Block a user