1
0
forked from VimPlug/jedi

Removed tree.is_node.

It's not needed anymore, because we have Node/Leaf.type now.
This commit is contained in:
Dave Halter
2017-01-23 20:34:30 +01:00
parent 64abe401ed
commit 7623b1e350
7 changed files with 38 additions and 49 deletions
+4 -4
View File
@@ -427,9 +427,9 @@ class SequenceLiteralContext(ArrayMixin, AbstractSequence):
if array_node in (']', '}', ')'):
return [] # Direct closing bracket, doesn't contain items.
if tree.is_node(array_node, 'testlist_comp'):
if array_node.type == 'testlist_comp':
return array_node.children[::2]
elif tree.is_node(array_node, 'dictorsetmaker'):
elif array_node.type == 'dictorsetmaker':
kv = []
iterator = iter(array_node.children)
for key in iterator:
@@ -889,14 +889,14 @@ def create_index_types(evaluator, context, index):
if index == ':':
# Like array[:]
return set([Slice(context, None, None, None)])
elif tree.is_node(index, 'subscript'): # subscript is a slice operation.
elif index.type == 'subscript': # subscript is a slice operation.
# Like array[:3]
result = []
for el in index.children:
if el == ':':
if not result:
result.append(None)
elif tree.is_node(el, 'sliceop'):
elif el.type == 'sliceop':
if len(el.children) == 2:
result.append(el.children[1])
else: