diff options
author | João Valverde <j@v6e.pt> | 2022-04-03 22:49:16 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-04-05 12:04:37 +0100 |
commit | fb08c4b4a809411d0da8397a5de7ff2923e103db (patch) | |
tree | 691e470e5fb61f9d454f861eaf9a75c59a52b3a1 /epan/dfilter/grammar.lemon | |
parent | c98df5eef5e6ff23c165d19f3a2d325c0720c42a (diff) |
dfilter: Replace bitwise sttype with arithmetic
Most of the bitwise codepaths are just duplicating code for
the arithmetic type. Parse bitwise expressions as arithmetic
instead.
Diffstat (limited to 'epan/dfilter/grammar.lemon')
-rw-r--r-- | epan/dfilter/grammar.lemon | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dfilter/grammar.lemon b/epan/dfilter/grammar.lemon index 809914c135..78646f3dcc 100644 --- a/epan/dfilter/grammar.lemon +++ b/epan/dfilter/grammar.lemon @@ -127,7 +127,7 @@ logical_test(T) ::= entity(E). sttype_test_set1_args(T, E); } -logical_test(T) ::= bitwise_term(E). +logical_test(T) ::= arithmetic_term(E). { T = new_test(dfw, TEST_OP_NOTZERO, NULL); sttype_test_set1_args(T, E); @@ -179,9 +179,9 @@ entity(E) ::= REF_OPEN REFERENCE(F) REF_CLOSE. entity(E) ::= range(R). { E = R; } entity(E) ::= function(F). { E = F; } -bitwise_term(T) ::= entity(F) BITWISE_AND(B) entity(M). +arithmetic_term(T) ::= entity(F) BITWISE_AND(B) entity(M). { - T = stnode_new(STTYPE_BITWISE, NULL, df_lval_value(B)); + T = stnode_new(STTYPE_ARITHMETIC, NULL, df_lval_value(B)); sttype_test_set2(T, OP_BITWISE_AND, F, M); df_lval_free(B, FALSE); } @@ -233,7 +233,6 @@ arithmetic_term(T) ::= entity(E) PERCENT(M) entity(N). } term(T) ::= entity(E). { T = E; } -term(T) ::= bitwise_term(E). { T = E; } term(T) ::= arithmetic_term(E). { T = E; } |