mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-08 21:54:54 +08:00
Remove get_tos_nodes and get_tos_first_tokens, because they are not used (not even in Jedi)
This commit is contained in:
@@ -54,24 +54,7 @@ class InternalParseError(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class Stack(list):
|
class Stack(list):
|
||||||
def get_tos_nodes(self):
|
pass
|
||||||
tos = self[-1]
|
|
||||||
return tos[2][1]
|
|
||||||
|
|
||||||
def get_tos_first_tokens(self, grammar):
|
|
||||||
tos = self[-1]
|
|
||||||
inv_tokens = dict((v, k) for k, v in grammar.tokens.items())
|
|
||||||
inv_keywords = dict((v, k) for k, v in grammar.keywords.items())
|
|
||||||
dfa, state, nodes = tos
|
|
||||||
|
|
||||||
def check():
|
|
||||||
for first in dfa[1]:
|
|
||||||
try:
|
|
||||||
yield inv_keywords[first]
|
|
||||||
except KeyError:
|
|
||||||
yield tokenize.tok_name[inv_tokens[first]]
|
|
||||||
|
|
||||||
return sorted(check())
|
|
||||||
|
|
||||||
|
|
||||||
class StackNode(object):
|
class StackNode(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user