From 0bdc640331b903532fb345930e7078752ba54a2d Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 18 Mar 2025 21:49:55 +0100 Subject: Evaluate each predicate in a () block --- lib/analysers/filters.ml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/analysers/filters.ml b/lib/analysers/filters.ml index 7044798..6b1d843 100644 --- a/lib/analysers/filters.ml +++ b/lib/analysers/filters.ml @@ -5,15 +5,23 @@ module Expression = ImportExpression open StdLabels (** Add a list of expressions into the group *) -let rec add_filters : +let add_filters : conf:ImporterSyntax.t -> Chunk.t -> Path.t Expression.T.t list -> unit = fun ~conf group -> function | [] -> () - | hd :: [] -> Chunk.add_expression ~conf group hd - | hd :: tl -> - Chunk.add_expression ~conf group hd; - Chunk.add_string group "\nAND "; - add_filters ~conf group tl + | any -> + let rec f ~conf group = function + | [] -> () + | hd :: [] -> + Chunk.add_expression ~conf group hd; + Chunk.add_string group ")" + | hd :: tl -> + Chunk.add_expression ~conf group hd; + Chunk.add_string group ")\nAND ("; + f ~conf group tl + in + Chunk.add_string group "("; + f ~conf group any type 'a cte_acc = { n : int; -- cgit v1.2.3