ocaml / ocamlbuild / tags.ml

(***********************************************************************)
(*                                                                     *)
(*                             ocamlbuild                              *)
(*                                                                     *)
(*  Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
(*                                                                     *)
(*  Copyright 2007 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)


(* Original author: Nicolas Pouillard *)
include Set.Make(String)

(**
  does_match {foo, bar, baz} {foo} => ok
  does_match {foo, bar, baz} {foo, boo} => ko
  does_match {foo, bar, baz} {} => ok
  does_match {foo, bar, baz} {foo, bar, baz} => ok
*)
let does_match x y = subset y x

let of_list l = List.fold_right add l empty

open Format

let print f s =
  let () = fprintf f "@[<0>" in
  let _ =
    fold begin fun elt first ->
      if not first then fprintf f ",@ ";
      pp_print_string f elt;
      false
    end s true in
  fprintf f "@]"

module Operators = struct
  let ( ++ ) x y = add y x
  let ( -- ) x y = remove y x
  let ( +++ ) x = function Some y -> add y x | None -> x
  let ( --- ) x = function Some y -> remove y x | None -> x
end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.