mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 04:00:28 +01:00
py/compile: Combine expr, xor_expr and and_expr into one function.
This and the previous 4 commits combined have change in code size of:
bare-arm: -92
minimal x86: -544
unix x64: -544
unix nanbox: -712
stm32: -116
cc3200: -128
esp8266: -348
esp32: -232
This commit is contained in:
@@ -241,9 +241,9 @@ DEF_RULE_NC(comp_op_not_in, and(2), tok(KW_NOT), tok(KW_IN))
|
||||
DEF_RULE_NC(comp_op_is, and(2), tok(KW_IS), opt_rule(comp_op_is_not))
|
||||
DEF_RULE_NC(comp_op_is_not, and(1), tok(KW_NOT))
|
||||
DEF_RULE(star_expr, c(star_expr), and(2), tok(OP_STAR), rule(expr))
|
||||
DEF_RULE(expr, c(expr), list, rule(xor_expr), tok(OP_PIPE))
|
||||
DEF_RULE(xor_expr, c(xor_expr), list, rule(and_expr), tok(OP_CARET))
|
||||
DEF_RULE(and_expr, c(and_expr), list, rule(shift_expr), tok(OP_AMPERSAND))
|
||||
DEF_RULE(expr, c(binary_op), list, rule(xor_expr), tok(OP_PIPE))
|
||||
DEF_RULE(xor_expr, c(binary_op), list, rule(and_expr), tok(OP_CARET))
|
||||
DEF_RULE(and_expr, c(binary_op), list, rule(shift_expr), tok(OP_AMPERSAND))
|
||||
DEF_RULE(shift_expr, c(term), list, rule(arith_expr), rule(shift_op))
|
||||
DEF_RULE_NC(shift_op, or(2), tok(OP_DBL_LESS), tok(OP_DBL_MORE))
|
||||
DEF_RULE(arith_expr, c(term), list, rule(term), rule(arith_op))
|
||||
|
||||
Reference in New Issue
Block a user