forked from VimPlug/jedi
Fix an issue with strings that can be chained in the parser.
This commit is contained in:
@@ -321,8 +321,15 @@ class Evaluator(object):
|
|||||||
return set([compiled.create(self, atom.eval())])
|
return set([compiled.create(self, atom.eval())])
|
||||||
else:
|
else:
|
||||||
c = atom.children
|
c = atom.children
|
||||||
|
if c[0].type == 'string':
|
||||||
|
# Will be one string.
|
||||||
|
types = self._eval_atom(c[0])
|
||||||
|
for string in c[1:]:
|
||||||
|
right = self._eval_atom(string)
|
||||||
|
types = precedence.calculate(self, types, '+', right)
|
||||||
|
return types
|
||||||
# Parentheses without commas are not tuples.
|
# Parentheses without commas are not tuples.
|
||||||
if c[0] == '(' and not len(c) == 2 \
|
elif c[0] == '(' and not len(c) == 2 \
|
||||||
and not(tree.is_node(c[1], 'testlist_comp')
|
and not(tree.is_node(c[1], 'testlist_comp')
|
||||||
and len(c[1].children) > 1):
|
and len(c[1].children) > 1):
|
||||||
return self.eval_element(c[1])
|
return self.eval_element(c[1])
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ dic2['asdf']
|
|||||||
dic2[r'asdf']
|
dic2[r'asdf']
|
||||||
#? int()
|
#? int()
|
||||||
dic2[r'asdf']
|
dic2[r'asdf']
|
||||||
|
#? int()
|
||||||
|
dic2[r'as' 'd' u'f']
|
||||||
#? int() str()
|
#? int() str()
|
||||||
dic2['just_something']
|
dic2['just_something']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user