1
0
forked from VimPlug/jedi

fixed some bugs within fast_parser and added an option 'settings.fast_parser' to turn on fast parsing.

This commit is contained in:
David Halter
2012-12-14 18:16:54 +01:00
parent 6963a6ac4a
commit b8b4a02398
5 changed files with 77 additions and 26 deletions

View File

@@ -26,7 +26,8 @@ of a statement.
All those classes are being generated by PyFuzzyParser, which takes python text
as input and ignores just all the non-python stuff. Basically you could feed it
a perl script, and it should still work (which means throw no error.
a perl script, and it should still work (which means throw no error).
TODO remove docstr params from Scope.__init__()
"""
from _compatibility import (next, literal_eval, StringIO,
property, cleandoc, Python3Method)
@@ -252,7 +253,7 @@ class SubModule(Scope, Module):
self.used_names = {}
self.temp_used_names = []
# this may be changed depending on fast_parser
self.line_offset = 0
self._line_offset = 0
def add_global(self, name):
"""
@@ -1596,7 +1597,7 @@ class PyFuzzyParser(object):
raise
if self.user_position and (self.start_pos[0] == self.user_position[0]
or self.user_scope is None
or self.user_scope is None
and self.start_pos[0] >= self.user_position[0]):
debug.dbg('user scope found [%s] = %s' % \
(self.parserline.replace('\n', ''), repr(self.scope)))