forked from VimPlug/jedi
Including pgen2 tests from the cpython repo.
This commit is contained in:
@@ -208,7 +208,7 @@ class Parser(object):
|
||||
return new_node
|
||||
|
||||
def convert_leaf(self, grammar, type, value, prefix, start_pos):
|
||||
#print('leaf', repr(value), token.tok_ntype)
|
||||
#print('leaf', repr(value), token.tok_name[type])
|
||||
if type == tokenize.NAME:
|
||||
if value in grammar.keywords:
|
||||
if value in ('def', 'class', 'lambda'):
|
||||
|
||||
@@ -219,6 +219,10 @@ def generate_tokens(readline):
|
||||
if new_line and initial not in '\r\n#':
|
||||
new_line = False
|
||||
if paren_level == 0:
|
||||
i = 0
|
||||
while line[i] == '\f':
|
||||
i += 1
|
||||
start -= 1
|
||||
if start > indents[-1]:
|
||||
yield INDENT, '', spos, ''
|
||||
indents.append(start)
|
||||
|
||||
Reference in New Issue
Block a user