MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / Python33Parser

Class Python33Parser

uncompyle6/parsers/parse33.py:10–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class Python33Parser(Python32Parser):
11 def p_33on(self, args):
12 """
13 # Python 3.3+ adds yield from.
14 expr ::= yield_from
15 yield_from ::= expr expr YIELD_FROM
16 stmt ::= genexpr_func
17 """
18
19 def customize_grammar_rules(self, tokens, customize):
20 self.remove_rules(
21 """
22 # 3.3+ adds POP_BLOCKS
23 whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP COME_FROM_LOOP
24 whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
25 """
26 )
27 super(Python33Parser, self).customize_grammar_rules(tokens, customize)
28
29 # FIXME: move 3.3 stuff out of parse3.py and put it here.
30 # for i, token in enumerate(tokens):
31 # opname = token.kind
32 # opname_base = opname[: opname.rfind("_")]
33
34 return
35
36
37class Python33ParserSingle(Python33Parser, PythonParserSingle):

Callers 1

infoFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected