Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 126 lines (110 sloc) 6.104 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 open SurfaceAst
19
20 (**)
21
22 module Remove :
23 sig
24 type ('a,'b) through
25 module Basic :
26 sig
27 val access_directive:('a, [< all_directives > `private_ `package `public ]) through
28 val access_not_public:('a, [< all_directives > `private_ `package `public ]) through
29 val coerce : ('a, [< all_directives > `coerce ]) through
30 val deprecated : ('a, [< all_directives > `deprecated ]) through
31 val directive : ('a, 'b) through
32 val doctype : ('a, [< all_directives > `doctype ]) through
33 val expand : ('a, [< all_directives > `expand ]) through
34 val magic_directive : ('a, [> magic_directive]) through
35 val lambda : ('a, 'b) through
36 val letin : ('a, 'b) through
37 val opacapi : ('a, [< all_directives > `opacapi ]) through
38 val opavalue_directive : ('a, [> opavalue_directive]) through
39 val open_ : ('a, [< all_directives > `open_ ]) through
40 val private_ : ('a, [< all_directives > `private_ ]) through
41 val slicer_directive:('a, [< all_directives > `side_annotation `visibility_annotation ]) through
42 val side_annotation :('a, [< all_directives > `side_annotation ]) through
43 val visibility_annotation:('a, [< all_directives > `visibility_annotation ]) through
44 end
45 val remove : through:('a, [< all_directives ] as 'b) through list -> ('a, 'b) expr -> ('a, 'b) expr
46 val coerce : ('a, [< all_directives > `coerce] as 'b) expr -> ('a, 'b) expr
47 end
48
49
50 module Look :
51 sig
52 type ('a,'b) through = ('a,'b) Remove.through
53 val apply : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
54 val lambda : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
55 val record : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
56 val module_ : ?through:('a, [< all_directives > `module_ ] as 'b) through list -> ('a, 'b) expr -> bool
57 val module_local :?through:('a, [< all_directives > `module_ `local ] as 'b) through list -> ('a, 'b) expr -> bool
58 val private_ : ?through:('a, [< all_directives > `private_ ] as 'b) through list -> ('a, 'b) expr -> bool
59
60 val at : ?through:('a,'b) through list -> at:('a,'b) through list -> ('a, 'b) expr -> bool
61 (** [at ~through:patterns ~at:patterns e] returns true when [e] matches one of the patterns of [at]
62 (while ignoring [through])
63 *)
64 end
65
66 (* should be renamed GetThrough *)
67 module FoldThrough :
68 sig
69 val dot : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> ('a, 'b) expr * (string * QmlLoc.annot) list
70 val arity : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> int option
71 val fields : ?through:('a, ([> `module_ ] as 'b)) Remove.through list -> ('a, 'b) expr -> ('a, 'b) record_node option
72 (** gets the fields of records or modules *)
73 end
74
75
76 module Context :
77 sig
78 type ('ident,'input,'output) through_with_context
79 module Basic :
80 sig
81 val coerce : ('a, [< all_directives > `coerce ], [< all_directives > `coerce ]) through_with_context
82 val directive : ('a,'b,'b) through_with_context
83 val letin : ('a,'b,'b) through_with_context
84 val opacapi : ('a,[< all_directives > `opacapi ] as 'b,'b) through_with_context
85 val opavalue_directive :
86 ('a, [> opavalue_directive ] as 'b, 'b) through_with_context
87 val open_ : ('a,[< all_directives > `open_ ] as 'b,'b) through_with_context
88 val doctype : ('a, [< all_directives > `doctype ] as 'b, 'b) through_with_context
89 val slicer_directive :
90 ('a, [< all_directives > `side_annotation `visibility_annotation] as 'b, 'b)
91 through_with_context
92 val side_annotation :
93 ('a, [< all_directives > `side_annotation] as 'b, 'b)
94 through_with_context
95 val visibility_annotation :
96 ('a, [< all_directives > `visibility_annotation] as 'b, 'b)
97 through_with_context
98
99 end
100 val remove : through:('ident, 'input, 'output) through_with_context list ->
101 ('ident, 'input) expr ->
102 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
103 val filter : keep:('ident, 'input, 'output) through_with_context list ->
104 throw:('ident,'input) Remove.through list ->
105 ('ident, 'input) expr ->
106 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
107 val filter2 : keep1:('ident, 'input, 'output) through_with_context list ->
108 keep2:('ident, 'input, 'output2) through_with_context list ->
109 throw:('ident,'input) Remove.through list ->
110 ('ident, 'input) expr ->
111 ('ident, 'input) expr *
112 (('ident, 'output) expr -> ('ident, 'output) expr) *
113 (('ident, 'output2) expr -> ('ident, 'output2) expr)
114 val uncoerce : ('a,[< all_directives > `coerce] as 'b) expr ->
115 ('a, 'b) expr * (('a, [< all_directives > `coerce ] as 'c) expr -> ('a, 'c) expr)
116 val unletin : ('a,'b) expr ->
117 ('a,'b) expr * (('a,'b) expr -> ('a,'b) expr)
118 end
119
120
121 module FoldContext :
122 sig
123 val letin : ?through:('a,'b,'c) Context.through_with_context list ->
124 ('a, 'b) expr -> ('a, 'b) expr * ('a * ('a, 'b) expr) list * (('a,'c) expr -> ('a,'c) expr)
125 end
Something went wrong with that request. Please try again.