Skip to content
This repository
Newer
Older
100644 91 lines (76 sloc) 3.452 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
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 open SurfaceAst
19
20 module Fresh :
21 sig
22 val id : unit -> int
23 val typevar : unit -> string
24 val old_name : ?name:string -> unit -> string
25 val name : string -> string
26 end
27
28 module Label :
29 sig
30 val label : 'a QmlLoc.label -> QmlLoc.annot
31 val undecorate : 'a QmlLoc.label -> 'a
32 val copy_label : QmlLoc.annot -> QmlLoc.annot
33 val builtin : unit -> QmlLoc.annot
34 end
35
36 module ExprIdent : SurfaceAstConsSig.IDENT with type ident = Ident.t
37 module StringIdent : SurfaceAstConsSig.IDENT with type ident = string
38
39 val encode_tuple : 'a list -> (string * 'a) list
40
41 val with_builtin_position : (unit -> 'a) -> 'a
42 val with_position : FilePos.pos -> (unit -> 'a) -> 'a
43 val with_label : QmlLoc.annot -> (unit -> 'a) -> 'a
44 val with_same_pos : _ * QmlLoc.annot -> (unit -> 'a) -> 'a
45
46 val with_builtin_position' : ('a -> 'b) -> 'a -> 'b
47 val with_position' : FilePos.pos -> ('a -> 'b) -> 'a -> 'b
48 val with_label' : QmlLoc.annot -> ('a -> 'b) -> 'a -> 'b
49 val with_same_pos' : _ * QmlLoc.annot -> ('a -> 'b) -> 'a -> 'b
50
51 module MakeCons : functor (Ident : SurfaceAstConsSig.IDENT) -> SurfaceAstConsSig.CONS with type ident = Ident.ident
52 (* these two modules are the main ones, see SurfaceAstConsSig for their signature *)
53 module ExprIdentCons : SurfaceAstConsSig.CONS with type ident = ExprIdent.ident
54 module StringCons : SurfaceAstConsSig.CONS with type ident = StringIdent.ident
55
56 module Fold :
57 sig
58 val dot : ('a, 'b) expr -> (string * QmlLoc.annot) list -> ('a, 'b) expr
59 end
60
61 (** Utils to duplicate a tree while regenerating all the annotations *)
62 module Refresh :
63 sig
64 (** expressions *)
65 val const_expr_node : const_expr_node -> const_expr_node
66 val const_expr : const_expr -> const_expr
67 val record_node : ('a, 'b) record_node -> ('a, 'b) record_node
68 val record : ('a, 'b) record -> ('a,'b) record
69 val expr : ('a, 'b) expr -> ('a,'b) expr
70 val expr_node : ('a, 'b) expr_node -> ('a,'b) expr_node
71
72 (** patterns *)
73 val pat : 'a pat -> 'a pat
74 val pat_node : 'a pat_node -> 'a pat_node
75 val pat_record_node : 'a pat_record_node -> 'a pat_record_node
76
77 (** types *)
78 val ty : 'a ty -> 'a ty
79 val ty_node : 'a ty_node -> 'a ty_node
80 val typeinstance : 'a typeinstance_t -> 'a typeinstance_t
81 val typeinstance_node : 'a typeinstance_t_node -> 'a typeinstance_t_node
82 val arrow : 'a arrow_t -> 'a arrow_t
83 val arrow_node : 'a arrow_t_node -> 'a arrow_t_node
84 val sum : 'a sum_t -> 'a sum_t
85 val sum_node : 'a sum_t_node -> 'a sum_t_node
86 val fields_t_node : 'a fields_t_node -> 'a fields_t_node
87 val row : 'a row_t -> 'a row_t
88 val row_node : 'a row_t_node -> 'a row_t_node
89 val typedef : 'a typedef -> 'a typedef
90 val typedef_node : 'a typedef_node -> 'a typedef_node
91 end
Something went wrong with that request. Please try again.