···360360 let table =
361361 let env = Lex_env.read () in
362362 let add (name, body) =
363363- let super = Symbol.fresh () in
364363 Value.Method_table.add name Value.{body; self; super = None; env}
365364 in
366365 List.fold_right add methods Value.Method_table.empty
···7788open Forester_prelude
99open Forester_core
1010-open Bwd
11101211(* TODO: remove this in favor of https://github.com/ocaml/ocaml/pull/13760 *)
1312let edit_distance ~cutoff x y =
···34343535let immediate_dependencies = safe_pred
36363737-let add_edge_safe g v w = if mem_vertex g v && mem_vertex g w then add_edge g v w
3838-3937let dependencies graph vertex : t =
4038 let dep_graph = create () in
4139 let rec go v =
···6765 let default_vertex_attributes _ = []
6866 let vertex_attributes _ = []
6967 let default_edge_attributes _ = []
7070- let edge_attributes e = [`Label ""]
6868+ let edge_attributes _e = [`Label ""]
7169 let get_subgraph _ = None
7270end)
-9
lib/core/Forest_graphs.ml
···2626 let@ host = Option.iter @~ URI.host uri in
2727 let host_vtx = T.Content_vertex (T.Content [T.Text host]) in
2828 Dl.db_add_fact dl_db @@ Dl.mk_literal Builtin_relation.in_host [Dl.mk_const vtx; Dl.mk_const host_vtx]
2929-3030- let add_edge rel ~source ~target =
3131- Dl.db_add_fact dl_db @@
3232- Dl.mk_literal
3333- rel
3434- [
3535- Dl.mk_const source;
3636- Dl.mk_const target
3737- ]
3829end)
39304031module Make () : S = (val (init @@ Dl.db_create ()))
+1-5
lib/core/Reporter.ml
···44 * SPDX-License-Identifier: GPL-3.0-or-later
55 *)
6677-open Forester_prelude
88-open Base
99-107module R = Resolver
118module Sc = R.Scope
129···2320 let before = Unix.gettimeofday () in
2421 let result = body () in
2522 let after = Unix.gettimeofday () in
2626- emit (Profiling (after, before));
2727- (* "[%fs] %s" (after -. before) msg; *)
2323+ emit ~extra_remarks: [Asai.Diagnostic.loctextf "%s" msg] (Profiling (after, before));
2824 result
29253026module Tty = Asai.Tty.Make(Message)
···44 * SPDX-License-Identifier: GPL-3.0-or-later
55 *)
6677-open Base
88-97type t = Types.content Types.vertex
108include Set.OrderedType with type t := t
119val equal : t -> t -> bool
···55 *)
6677open Forester_core
88-open Forester_prelude
98open Spelll
1091110open struct module T = Forester_core.Types end
+3-4
lib/search/Search_engine.ml
···99open Forester_compiler
1010open Forester_search
1111open Forester_frontend
1212-open Cmdliner
1313-open Cmdliner.Term.Syntax
1212+14131514open struct module T = Types end
16151716let ranked_search
1817 : ?fuzz: int -> State.t -> string -> (URI.t * float) list
1919-= fun ?fuzz forest terms ->
1818+= fun ?fuzz: _ forest terms ->
2019 Tokenizer.tokenize terms |> function
2120 | tokens ->
2221 (* In order to rank documents, I search for the first token and then
···5150 List.iter
5251 (fun (uri, score) ->
5352 match State.get_article uri forest with
5454- | Some article ->
5353+ | Some _article ->
5554 Format.printf "%a, %f@." URI.pp uri score;
5655 | None -> assert false
5756 )
+1-1
lib/search/Tokenizer.ml
···167167 List.concat_map (tokenize_vertex path In_frontmatter) tags;
168168 List.concat @@
169169 List.mapi
170170- (fun i (s, c) ->
170170+ (fun _i (s, c) ->
171171 (List.mapi (fun i t -> i :: path, t) @@ tokenize s) @
172172 tokenize_content path In_frontmatter c
173173 )
+2-2
lib/search/test/Test_forester_search.ml
···8383 ]
8484 in
8585 let tokens = Tokenizer.tokenize_content [] In_mainmatter content in
8686- let locations = List.map (fun (x, y) -> List.rev x) tokens in
8686+ let locations = List.map (fun (x, _) -> List.rev x) tokens in
8787 let render path = Context.render_context_content path content in
8888 Alcotest.(check @@ list string)
8989 ""
···124124 ()
125125 in
126126 let tokens = Tokenizer.tokenize_frontmatter [] frontmatter in
127127- let locations = List.map (fun (x, y) -> List.rev x) tokens in
127127+ let locations = List.map (fun (x, _) -> List.rev x) tokens in
128128 let render path = Context.render_context_frontmatter path frontmatter in
129129 Alcotest.(check @@ list string)
130130 ""