1
0
forked from VimPlug/jedi

added a line_offset attribute - enables fast_parser to change positions

This commit is contained in:
David Halter
2012-12-16 17:23:15 +01:00
parent 099e2410ad
commit c1d442fa17
5 changed files with 138 additions and 67 deletions

View File

@@ -714,7 +714,8 @@ class Generator(use_metaclass(cache.CachedMetaClass, parsing.Base)):
none_pos = (0, 0)
executes_generator = ('__next__', 'send')
for n in ('close', 'throw') + executes_generator:
name = parsing.Name([(n, none_pos)], none_pos, none_pos)
name = parsing.Name(builtin.Builtin.scope, [(n, none_pos)],
none_pos, none_pos)
if n in executes_generator:
name.parent = self
names.append(name)
@@ -1332,7 +1333,8 @@ def follow_call_list(call_list):
if isinstance(nested_lc, parsing.ListComprehension):
# is nested LC
input = nested_lc.stmt
loop = parsing.ForFlow([input], lc.stmt.start_pos,
module = input.get_parent_until()
loop = parsing.ForFlow(module, [input], lc.stmt.start_pos,
lc.middle, True)
if parent is None:
loop.parent = lc.stmt.parent