1
0
forked from VimPlug/jedi

some parser end positions changed

This commit is contained in:
David Halter
2013-04-15 10:22:27 +04:30
parent bafb17001b
commit b08390c136
5 changed files with 14 additions and 5 deletions

View File

@@ -85,7 +85,7 @@ class NoErrorTokenizer(object):
if self.closed:
raise MultiLevelStopIteration()
try:
last_previous = self.previous
self.last_previous = self.previous
self.previous = self.current
self.current = next(self.gen)
except tokenize.TokenError:
@@ -112,7 +112,7 @@ class NoErrorTokenizer(object):
if c[0] == tokenize.ENDMARKER:
self.current = self.previous
self.previous = last_previous
self.previous = self.last_previous
raise MultiLevelStopIteration()
# this is exactly the same check as in fast_parser, but this time with
@@ -155,6 +155,9 @@ class NoErrorTokenizer(object):
if tok in FLOWS or tok in breaks:
self.in_flow = tok in FLOWS
if not self.is_decorator and not self.in_flow:
print tok, c
if 6230 < c[2][0] < 6290:
print tok, c
close()
self.is_decorator = '@' == tok
if not self.is_decorator: