forked from VimPlug/jedi
Ellipsis comparisons are working now. Ellipsis was previously ignored.
This commit is contained in:
@@ -312,7 +312,8 @@ class Evaluator(object):
|
|||||||
self.eval_element(element.children[-1]))
|
self.eval_element(element.children[-1]))
|
||||||
elif element.type == 'operator':
|
elif element.type == 'operator':
|
||||||
# Must be an ellipsis, other operators are not evaluated.
|
# Must be an ellipsis, other operators are not evaluated.
|
||||||
types = set() # Ignore for now.
|
assert element.value == '...'
|
||||||
|
types = set([compiled.create(self, Ellipsis)])
|
||||||
elif element.type == 'dotted_name':
|
elif element.type == 'dotted_name':
|
||||||
types = self._eval_atom(element.children[0])
|
types = self._eval_atom(element.children[0])
|
||||||
for next_name in element.children[2::2]:
|
for next_name in element.children[2::2]:
|
||||||
|
|||||||
@@ -285,7 +285,13 @@ def generate_tokens(readline):
|
|||||||
paren_level += 1
|
paren_level += 1
|
||||||
elif token in ')]}':
|
elif token in ')]}':
|
||||||
paren_level -= 1
|
paren_level -= 1
|
||||||
yield OP, token, spos, prefix
|
if token == '...' and not is_py3:
|
||||||
|
# Ellipsis tokens were not syntax yet, in Python 2.7.
|
||||||
|
yield OP, '.', spos, prefix
|
||||||
|
yield OP, '.', (spos[0], spos[1] + 1), ''
|
||||||
|
yield OP, '.', (spos[0], spos[1] + 2), ''
|
||||||
|
else:
|
||||||
|
yield OP, token, spos, prefix
|
||||||
|
|
||||||
if new_line:
|
if new_line:
|
||||||
end_pos = lnum + 1, 0
|
end_pos = lnum + 1, 0
|
||||||
|
|||||||
Reference in New Issue
Block a user