Commit d804bb76 authored by Heinz N. Gies's avatar Heinz N. Gies

Fix minor bugs in event selectors

parent 90bf8c07
......@@ -101,7 +101,7 @@ op_re -> '~=' : '~='.
event_condition -> kw_not event_condition : {'not', '$2'}.
event_condition -> event_path op event_value : {'$2', '$1', '$3'}.
event_condition -> event_path op_ne event_value : {'not', [{'==', '$1', '$3'}]}.
event_condition -> event_path op_re part_or_name : {'~=', '$1', unwrap('$3')}.
event_condition -> event_path op_re part_or_name : {'~=', '$1', '$3'}.
event_condition -> '(' event_logic ')' : '$2'.
event_value -> integer : unwrap('$1').
......
......@@ -180,11 +180,19 @@ unparse_filter(L) when is_list(L) ->
S = combine(L1, <<" AND ">>),
<<"(", S/binary, ")">>;
unparse_filter({'or', L, R}) ->
LS = unparse_filter(L),
RS = unparse_filter(R),
<<"(", LS/binary, " OR ", RS/binary, ")">>;
unparse_filter({'not', [{'==', Path, Val}]}) ->
unparse_filter({'!=', Path, Val});
unparse_filter({'not', Ops}) ->
OpsS = unparse_filter(Ops),
<<"not (", OpsS/binary, ")">>;
unparse_filter({Op, Path, Val}) ->
OpS = atom_to_binary(Op, utf8),
ValS = unparse_val(Val),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment