Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 59 lines (44 sloc) 1.992 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (** Used when ident is renamed for bind the newest ident and the
19 original ident. *)
20
21 (** {6 Defined types}*)
22 (** Type of renaming map *)
23 type t
24
25 (** {6 Construct map}*)
26 (** Empty renaming map. *)
27 val empty : t
28
29 (** [add t original_id new_id] Add a new binding. Consider
30 [original_id] has renamed on [new_id]. *)
31 val add : t -> QmlAst.ident -> QmlAst.ident -> t
32
33 (** the input map must be injective *)
34 val from_map : QmlAst.ident IdentMap.t -> t
35
36 (** [filter t f] Construct a new map from [t] where [f original_id
37 new_id] returns [true] *)
38 val filter : t -> (QmlAst.ident -> QmlAst.ident -> bool) -> t
39
40 (** {6 Getter}*)
41 (** Get the original ident from a given.
42 @throw [Not_found] if given ident has not added before.*)
43 val original_from_new : t -> QmlAst.ident -> QmlAst.ident
44
45 (** Like [original_from_new] but returns [None] instead of throw
46 [Not_found]. *)
47 val original_from_new_opt : t -> QmlAst.ident -> QmlAst.ident option
48
49 (** Get the new ident from a original ident.
50 @throw [Not_found] if given ident has not added before.*)
51 val new_from_original : t -> QmlAst.ident -> QmlAst.ident
52
53 (** Like [new_from_original] but returns [None] instead of throw
54 [Not_found]. *)
55 val new_from_original_opt : t -> QmlAst.ident -> QmlAst.ident option
56
57 (** pretty printer for renaming maps *)
58 val pp : Format.formatter -> t -> unit
Something went wrong with that request. Please try again.