1
0
forked from VimPlug/jedi

fix name end_pos problems

This commit is contained in:
David Halter
2013-08-16 22:31:51 +04:30
parent 098397aa79
commit d4f605d213
2 changed files with 4 additions and 4 deletions

View File

@@ -140,6 +140,7 @@ class Parser(object):
append((tok, self.start_pos)) append((tok, self.start_pos))
first_pos = self.start_pos first_pos = self.start_pos
while True: while True:
end_pos = self.end_pos
token_type, tok = self.next() token_type, tok = self.next()
if tok != '.': if tok != '.':
break break
@@ -148,8 +149,7 @@ class Parser(object):
break break
append((tok, self.start_pos)) append((tok, self.start_pos))
n = pr.Name(self.module, names, first_pos, self.end_pos) if names \ n = pr.Name(self.module, names, first_pos, end_pos) if names else None
else None
return n, token_type, tok return n, token_type, tok
def _parse_import_list(self): def _parse_import_list(self):

View File

@@ -26,8 +26,8 @@ class TestCallAndName():
call = self.get_call('1.0\n') call = self.get_call('1.0\n')
assert call.name == 1.0 assert call.name == 1.0
assert call.name.start_pos == call.start_pos == (1, 0) assert call.start_pos == (1, 0)
assert call.name.end_pos == call.end_pos == (1, 3) assert call.end_pos == (1, 3)
def test_call_type(self): def test_call_type(self):
call = self.get_call('hello') call = self.get_call('hello')