forked from VimPlug/jedi
indentation reduced with iterator (see previous commit)
This commit is contained in:
@@ -1615,8 +1615,7 @@ class PyFuzzyParser(object):
|
|||||||
#debug.dbg('main: tok=[%s] type=[%s] indent=[%s]'\
|
#debug.dbg('main: tok=[%s] type=[%s] indent=[%s]'\
|
||||||
# % (tok, tokenize.tok_name[token_type], start_position[0]))
|
# % (tok, tokenize.tok_name[token_type], start_position[0]))
|
||||||
|
|
||||||
while token_type == tokenize.DEDENT \
|
while token_type == tokenize.DEDENT and self.scope != self.module:
|
||||||
and self.scope != self.module:
|
|
||||||
token_type, tok = self.next()
|
token_type, tok = self.next()
|
||||||
if self.start_pos[1] <= self.scope.start_pos[1]:
|
if self.start_pos[1] <= self.scope.start_pos[1]:
|
||||||
self.scope.end_pos = self.start_pos
|
self.scope.end_pos = self.start_pos
|
||||||
@@ -1644,8 +1643,7 @@ class PyFuzzyParser(object):
|
|||||||
elif tok == 'class':
|
elif tok == 'class':
|
||||||
cls = self._parseclass()
|
cls = self._parseclass()
|
||||||
if cls is None:
|
if cls is None:
|
||||||
debug.warning("class: syntax error@%s" %
|
debug.warning("class: syntax error@%s" % self.start_pos[0])
|
||||||
self.start_pos[0])
|
|
||||||
continue
|
continue
|
||||||
self.freshscope = True
|
self.freshscope = True
|
||||||
self.scope = self.scope.add_scope(cls, decorators)
|
self.scope = self.scope.add_scope(cls, decorators)
|
||||||
@@ -1678,8 +1676,7 @@ class PyFuzzyParser(object):
|
|||||||
tok = 'import'
|
tok = 'import'
|
||||||
mod = None
|
mod = None
|
||||||
if not mod and not relative_count or tok != "import":
|
if not mod and not relative_count or tok != "import":
|
||||||
debug.warning("from: syntax error@%s" %
|
debug.warning("from: syntax error@%s" % self.start_pos[0])
|
||||||
self.start_pos[0])
|
|
||||||
defunct = True
|
defunct = True
|
||||||
if tok != 'import':
|
if tok != 'import':
|
||||||
self.gen.push_back(self._current_full)
|
self.gen.push_back(self._current_full)
|
||||||
|
|||||||
Reference in New Issue
Block a user