mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
dictionary parsing didn't work
This commit is contained in:
@@ -800,7 +800,6 @@ class Array(Call):
|
|||||||
one array.
|
one array.
|
||||||
"""
|
"""
|
||||||
self.values.append([])
|
self.values.append([])
|
||||||
self.keys.append(None)
|
|
||||||
|
|
||||||
def add_to_current_field(self, tok):
|
def add_to_current_field(self, tok):
|
||||||
""" Adds a token to the latest field (in content). """
|
""" Adds a token to the latest field (in content). """
|
||||||
@@ -813,12 +812,10 @@ class Array(Call):
|
|||||||
def add_dictionary_key(self):
|
def add_dictionary_key(self):
|
||||||
"""
|
"""
|
||||||
Only used for dictionaries, automatically adds the tokens added by now
|
Only used for dictionaries, automatically adds the tokens added by now
|
||||||
from the values to keys.
|
from the values to keys, because the parser works this way.
|
||||||
"""
|
"""
|
||||||
self.type = Array.DICT
|
self.type = Array.DICT
|
||||||
c = self._counter
|
self.keys.append(self.values.pop())
|
||||||
self.keys[c] = self.values[c]
|
|
||||||
self.values[c] = []
|
|
||||||
|
|
||||||
def get_only_subelement(self):
|
def get_only_subelement(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ list().app
|
|||||||
#? ['append']
|
#? ['append']
|
||||||
[].append
|
[].append
|
||||||
|
|
||||||
|
arr2 = [1,2,3]
|
||||||
|
#? ['append']
|
||||||
|
arr2.app
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# dicts
|
# dicts
|
||||||
@@ -47,6 +50,12 @@ dic2.p
|
|||||||
#? ['popitem']
|
#? ['popitem']
|
||||||
{}.popitem
|
{}.popitem
|
||||||
|
|
||||||
|
dic2 = {'asdf': 3}
|
||||||
|
#? ['popitem']
|
||||||
|
dic2.popitem
|
||||||
|
|
||||||
|
#? ['real']
|
||||||
|
dic2['asdf'].real
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# set
|
# set
|
||||||
|
|||||||
Reference in New Issue
Block a user