Commit 943020b3 authored by Yann Régis-Gianas's avatar Yann Régis-Gianas

Keyword: Simplify the definition of KeywordSet.

Action: Use [Set.of_list].
parent 01055854
...@@ -14,7 +14,7 @@ let from_stretch s = ...@@ -14,7 +14,7 @@ let from_stretch s =
{ {
expr = IL.ETextual s; expr = IL.ETextual s;
filenames = [ s.Stretch.stretch_filename ]; filenames = [ s.Stretch.stretch_filename ];
keywords = Keyword.KeywordSet.from_list (List.map Positions.value s.Stretch.stretch_keywords); keywords = Keyword.KeywordSet.of_list (List.map Positions.value s.Stretch.stretch_keywords);
pkeywords = s.Stretch.stretch_keywords; pkeywords = s.Stretch.stretch_keywords;
} }
......
...@@ -66,16 +66,9 @@ let posvar s w f = ...@@ -66,16 +66,9 @@ let posvar s w f =
(* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *)
(* Sets of keywords. *) (* Sets of keywords. *)
module KeywordSet = module KeywordSet =
struct Set.Make (struct
include Set.Make (struct type t = keyword
type t = keyword let compare = compare
let compare = compare end)
end)
(* This converts a list of keywords with positions into a set of keywords. *)
let from_list keywords =
List.fold_right add keywords empty
end
...@@ -39,12 +39,5 @@ type keyword = ...@@ -39,12 +39,5 @@ type keyword =
val posvar: subject -> where -> flavor -> string val posvar: subject -> where -> flavor -> string
(* Sets of keywords. *) (* Sets of keywords. *)
module KeywordSet : module KeywordSet : Set.S with type elt = keyword
sig
include Set.S
(* This converts a list of keywords with positions into a set of keywords. *)
val from_list: elt list -> t
end with type elt = keyword
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment