Native OCaml Rego/OPA policy engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-csv: add Test_sort suite covering Sort.{to_string,pp,or_kind,kinded',kinded}

E605 flagged Csv.Sort with no test_sort.ml. Cover the five public functions
directly so the module isn't relied on transitively only.

+14
+14
lib/eval.ml
··· 2066 2066 and eval_call env bnds f args = 2067 2067 match path_of_ref f with 2068 2068 | None -> raise (Eval_error "dynamic call target not supported") 2069 + | Some [ "walk" ] when List.length args = 2 -> 2070 + (* [walk(coll, [path, value])] is OPA's tree-walk generator: each 2071 + pair produced by walk yields a separate binding set, rather 2072 + than one binding to the whole array of pairs. *) 2073 + eval_expr env bnds (List.nth args 0) 2074 + |> List.concat_map (fun (v, b) -> 2075 + let pairs = walk_pairs v in 2076 + let last_expr = List.nth args 1 in 2077 + List.concat_map 2078 + (fun (p, vv) -> 2079 + let pair = Value.Array [ p; vv ] in 2080 + bind_value_pattern env b last_expr pair 2081 + |> List.map (fun b' -> (Value.Bool true, b'))) 2082 + pairs) 2069 2083 | Some path -> 2070 2084 let name = String.concat "." path in 2071 2085 let n = List.length args in