From 4a3e7137334601828f56a3ee614f01d84bada4ce Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 12 Jun 2020 15:55:19 +0200 Subject: implement -after/-before in terms of -time It makes sense to unify this implementation to avoid code duplication and bugs that might be hidden. -after and -before can stay for now, as shortcuts for -time < and -time >, the same way we have other shortcuts as well. --- src/fexpr/grammar.lalrpop | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/fexpr') diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index 700481c..092407e 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -52,8 +52,12 @@ LogPredicate: Box = { "-outcome" > => filters::log::outcome(<>), "-weekday" > => filters::log::weekday(<>), - "-before" => filters::log::before(<>), - "-after" => filters::log::after(<>), + "-before" => filters::values::comparison( + filters::values::time(), filters::values::CompOp::Less, filters::values::constant(<>) + ), + "-after" => filters::values::comparison( + filters::values::time(), filters::values::CompOp::Greater, filters::values::constant(<>) + ), "-log-before" => filters::log::log_before(<>), "-log-after" => filters::log::log_after(<>), -- cgit v1.2.3