OCaml implementation of the Mozilla Public Suffix service
0
fork

Configure Feed

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

chore: apply dune fmt and use Alcotest.failf (E616)

Replace Alcotest.fail (Fmt.str ...) with Alcotest.failf in test_huri.
Apply dune fmt formatting across precommit, requests, qemu, and
publicsuffix packages.

+10 -7
+10 -7
gen/gen_psl.ml
··· 226 226 Printf.printf "let version = %S\n\n" version; 227 227 Printf.printf "let commit = %S\n" commit 228 228 229 - let generate_trie_nodes trie = 230 - let node_counter = ref 0 in 231 - let node_names = Hashtbl.create 1000 in 232 - let rec assign_names node = 229 + let assign_node_names node_counter node_names = 230 + let rec go node = 233 231 let name = Printf.sprintf "n%d" !node_counter in 234 232 incr node_counter; 235 233 Hashtbl.add node_names node.id name; 236 - List.iter (fun (_, child) -> assign_names child) node.children; 237 - Option.iter assign_names node.wildcard_child 234 + List.iter (fun (_, child) -> go child) node.children; 235 + Option.iter go node.wildcard_child 238 236 in 239 - assign_names trie; 237 + go 238 + 239 + let generate_trie_nodes trie = 240 + let node_counter = ref 0 in 241 + let node_names = Hashtbl.create 1000 in 242 + assign_node_names node_counter node_names trie; 240 243 let generated = Hashtbl.create 1000 in 241 244 let output_buffer = Buffer.create (1024 * 1024) in 242 245 let rec generate_node node =