ifexpr -> if_expr (to track better AST camelcase)

This commit is contained in:
rocky
2019-05-05 08:19:44 -04:00
parent 6df65a87bc
commit 8c611476fe
2 changed files with 8 additions and 8 deletions

View File

@@ -117,10 +117,10 @@ class Python37Parser(Python36Parser):
and_not ::= expr jmp_false expr POP_JUMP_IF_TRUE and_not ::= expr jmp_false expr POP_JUMP_IF_TRUE
expr ::= ifexp_37a expr ::= if_exp_37a
expr ::= ifexp_37b expr ::= if_exp_37b
ifexp_37a ::= and_not expr JUMP_FORWARD COME_FROM expr COME_FROM if_exp_37a ::= and_not expr JUMP_FORWARD COME_FROM expr COME_FROM
ifexp_37b ::= expr jmp_false expr POP_JUMP_IF_FALSE jump_forward_else expr if_exp_37b ::= expr jmp_false expr POP_JUMP_IF_FALSE jump_forward_else expr
""" """
def customize_grammar_rules(self, tokens, customize): def customize_grammar_rules(self, tokens, customize):

View File

@@ -23,8 +23,8 @@ def customize_for_version37(self, version):
####################### #######################
PRECEDENCE['attribute37'] = 2 PRECEDENCE['attribute37'] = 2
PRECEDENCE['ifexp_37a'] = 28 PRECEDENCE['if_exp_37a'] = 28
PRECEDENCE['ifexp_37b'] = 28 PRECEDENCE['if_exp_37b'] = 28
TABLE_DIRECT.update({ TABLE_DIRECT.update({
'and_not': ( '%c and not %c', 'and_not': ( '%c and not %c',
@@ -59,7 +59,7 @@ def customize_for_version37(self, version):
(0, 19 ) ), (0, 19 ) ),
'compare_chained2c_37': ( 'compare_chained2c_37': (
'%[3]{pattr.replace("-", " ")} %p %p', (0, 19), (6, 19) ), '%[3]{pattr.replace("-", " ")} %p %p', (0, 19), (6, 19) ),
'ifexp_37a': ( '%p if %p else %p', (1, 'expr', 27), (0, 27), (4, 'expr', 27) ), 'if_exp_37a': ( '%p if %p else %p', (1, 'expr', 27), (0, 27), (4, 'expr', 27) ),
'ifexp_37b': ( '%p if %p else %p', (2, 'expr', 27), (0, 'expr', 27), (5, 'expr', 27) ), 'if_exp_37b': ( '%p if %p else %p', (2, 'expr', 27), (0, 'expr', 27), (5, 'expr', 27) ),
}) })