1
0
forked from VimPlug/jedi

fix some end_pos problems

This commit is contained in:
David Halter
2013-04-27 22:47:26 +04:30
parent 792808d835
commit 26ce32ec6b
2 changed files with 6 additions and 12 deletions

View File

@@ -19,7 +19,7 @@ SCOPE_CONTENTS = ['asserts', 'subscopes', 'imports', 'statements', 'returns']
class Module(pr.Simple, pr.Module):
def __init__(self, parsers):
self._end_pos = None, None
self.end_pos = None, None
super(Module, self).__init__(self, (1, 0))
self.parsers = parsers
self.reset_caches()
@@ -78,16 +78,6 @@ class Module(pr.Simple, pr.Module):
""" ignore """
raise NotImplementedError('TODO remove - just a check if everything works fine.')
@property
def end_pos(self):
return self._end_pos
@end_pos.setter
def end_pos(self, value):
if None in self._end_pos \
or None not in value and self._end_pos < value:
self._end_pos = value
def __repr__(self):
return "<%s: %s@%s-%s>" % (type(self).__name__, self.name,
self.start_pos[0], self.end_pos[0])
@@ -397,6 +387,9 @@ class FastParser(use_metaclass(CachedFastParser)):
if not self.parsers:
self.parsers.append(empty_parser())
self.module.end_pos = self.parsers[-1].end_pos
#print(self.parsers[0].module.get_code())
del code