1
0
forked from VimPlug/jedi

get_code is now able to process returns again

This commit is contained in:
David Halter
2012-12-22 20:28:34 +01:00
parent e701a4ef92
commit c7fd196850
2 changed files with 7 additions and 4 deletions

View File

@@ -178,8 +178,11 @@ class Scope(Simple):
string += i.get_code()
for sub in self.subscopes:
string += sub.get_code(first_indent=True, indention=indention)
for stmt in self.statements:
string += stmt.get_code()
returns = self.returns if hasattr(self, 'returns') else []
ret_str = '' if isinstance(self, Lambda) else 'return '
for stmt in self.statements + returns:
string += (ret_str if stmt in returns else '') + stmt.get_code()
if first_indent:
string = common.indent_block(string, indention=indention)
@@ -1536,7 +1539,7 @@ class PyFuzzyParser(object):
start_pos = self.start_pos
while tok !=':':
param, tok = self._parse_statement(
added_breaks=[':', ','])
added_breaks=[':', ','], stmt_class=Param)
if param is None:
break
params.append(param)