summaryrefslogtreecommitdiff
path: root/py/grammar.h
diff options
context:
space:
mode:
authorKrzysztof Blazewicz <blazewicz.krzysztof@gmail.com>2017-04-27 21:32:50 +0200
committerDamien George <damien.p.george@gmail.com>2017-07-05 15:49:00 +1000
commita040fb89e7b8507aa775b0620de1770642b0f5ee (patch)
tree4833a9fbf0e4009801be0f50ee02864abff879e5 /py/grammar.h
parentf110dbd795395d84790696b8e22b7272a5375388 (diff)
py/compile: Combine arith and bit-shift ops into 1 compile routine.
This refactoring saves code space.
Diffstat (limited to 'py/grammar.h')
-rw-r--r--py/grammar.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/grammar.h b/py/grammar.h
index 930d96dc1..0b70538d4 100644
--- a/py/grammar.h
+++ b/py/grammar.h
@@ -244,9 +244,9 @@ 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(shift_expr, c(shift_expr), list, rule(arith_expr), rule(shift_op))
+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(arith_expr), list, rule(term), rule(arith_op))
+DEF_RULE(arith_expr, c(term), list, rule(term), rule(arith_op))
DEF_RULE_NC(arith_op, or(2), tok(OP_PLUS), tok(OP_MINUS))
DEF_RULE(term, c(term), list, rule(factor), rule(term_op))
DEF_RULE_NC(term_op, or(4), tok(OP_STAR), tok(OP_SLASH), tok(OP_PERCENT), tok(OP_DBL_SLASH))