Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 129 lines (113 sloc) 6.339 kb
fccc685 Initial open-source release
MLstate authored
1 (*
b8e78a0 @BourgerieQuentin [enhance] compiler, utils: Added for convenience a set for binding_direc...
BourgerieQuentin authored
2 Copyright © 2011, 2012 MLstate
fccc685 Initial open-source release
MLstate authored
3
5bb0f1a @Aqua-Ye [cleanup] compiler: typo on Opa
Aqua-Ye authored
4 This file is part of Opa.
fccc685 Initial open-source release
MLstate authored
5
5bb0f1a @Aqua-Ye [cleanup] compiler: typo on Opa
Aqua-Ye authored
6 Opa is free software: you can redistribute it and/or modify it under the
fccc685 Initial open-source release
MLstate authored
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
5bb0f1a @Aqua-Ye [cleanup] compiler: typo on Opa
Aqua-Ye authored
10 Opa is distributed in the hope that it will be useful, but WITHOUT ANY
fccc685 Initial open-source release
MLstate authored
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
5bb0f1a @Aqua-Ye [cleanup] compiler: typo on Opa
Aqua-Ye authored
16 along with Opa. If not, see <http://www.gnu.org/licenses/>.
fccc685 Initial open-source release
MLstate authored
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
8edc001 [feature] adding: an @async directive on bindings to perform asynchronou...
Valentin Gatien-Baron authored
29 val async : ('a, [< all_directives > `async ]) through
b8e78a0 @BourgerieQuentin [enhance] compiler, utils: Added for convenience a set for binding_direc...
BourgerieQuentin authored
30 val binding_directive:('a, [> binding_directive ]) through
fccc685 Initial open-source release
MLstate authored
31 val coerce : ('a, [< all_directives > `coerce ]) through
32 val deprecated : ('a, [< all_directives > `deprecated ]) through
33 val directive : ('a, 'b) through
34 val doctype : ('a, [< all_directives > `doctype ]) through
35 val expand : ('a, [< all_directives > `expand ]) through
36 val magic_directive : ('a, [> magic_directive]) through
37 val lambda : ('a, 'b) through
38 val letin : ('a, 'b) through
39 val opacapi : ('a, [< all_directives > `opacapi ]) through
40 val opavalue_directive : ('a, [> opavalue_directive]) through
41 val open_ : ('a, [< all_directives > `open_ ]) through
42 val private_ : ('a, [< all_directives > `private_ ]) through
43 val slicer_directive:('a, [< all_directives > `side_annotation `visibility_annotation ]) through
44 val side_annotation :('a, [< all_directives > `side_annotation ]) through
45 val visibility_annotation:('a, [< all_directives > `visibility_annotation ]) through
46 end
47 val remove : through:('a, [< all_directives ] as 'b) through list -> ('a, 'b) expr -> ('a, 'b) expr
48 val coerce : ('a, [< all_directives > `coerce] as 'b) expr -> ('a, 'b) expr
49 end
50
51
52 module Look :
53 sig
54 type ('a,'b) through = ('a,'b) Remove.through
55 val apply : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
56 val lambda : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
57 val record : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
58 val module_ : ?through:('a, [< all_directives > `module_ ] as 'b) through list -> ('a, 'b) expr -> bool
59 val module_local :?through:('a, [< all_directives > `module_ `local ] as 'b) through list -> ('a, 'b) expr -> bool
60 val private_ : ?through:('a, [< all_directives > `private_ ] as 'b) through list -> ('a, 'b) expr -> bool
61
62 val at : ?through:('a,'b) through list -> at:('a,'b) through list -> ('a, 'b) expr -> bool
63 (** [at ~through:patterns ~at:patterns e] returns true when [e] matches one of the patterns of [at]
64 (while ignoring [through])
65 *)
66 end
67
68 (* should be renamed GetThrough *)
69 module FoldThrough :
70 sig
71 val dot : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> ('a, 'b) expr * (string * QmlLoc.annot) list
72 val arity : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> int option
73 val fields : ?through:('a, ([> `module_ ] as 'b)) Remove.through list -> ('a, 'b) expr -> ('a, 'b) record_node option
74 (** gets the fields of records or modules *)
75 end
76
77
78 module Context :
79 sig
80 type ('ident,'input,'output) through_with_context
81 module Basic :
82 sig
83 val coerce : ('a, [< all_directives > `coerce ], [< all_directives > `coerce ]) through_with_context
84 val directive : ('a,'b,'b) through_with_context
85 val letin : ('a,'b,'b) through_with_context
86 val opacapi : ('a,[< all_directives > `opacapi ] as 'b,'b) through_with_context
87 val opavalue_directive :
88 ('a, [> opavalue_directive ] as 'b, 'b) through_with_context
89 val open_ : ('a,[< all_directives > `open_ ] as 'b,'b) through_with_context
90 val doctype : ('a, [< all_directives > `doctype ] as 'b, 'b) through_with_context
91 val slicer_directive :
92 ('a, [< all_directives > `side_annotation `visibility_annotation] as 'b, 'b)
93 through_with_context
b8e78a0 @BourgerieQuentin [enhance] compiler, utils: Added for convenience a set for binding_direc...
BourgerieQuentin authored
94 val binding_directive: ('a, [> binding_directive] as 'b, 'b) through_with_context
fccc685 Initial open-source release
MLstate authored
95 val side_annotation :
96 ('a, [< all_directives > `side_annotation] as 'b, 'b)
97 through_with_context
98 val visibility_annotation :
99 ('a, [< all_directives > `visibility_annotation] as 'b, 'b)
100 through_with_context
101
102 end
103 val remove : through:('ident, 'input, 'output) through_with_context list ->
104 ('ident, 'input) expr ->
105 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
106 val filter : keep:('ident, 'input, 'output) through_with_context list ->
107 throw:('ident,'input) Remove.through list ->
108 ('ident, 'input) expr ->
109 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
110 val filter2 : keep1:('ident, 'input, 'output) through_with_context list ->
111 keep2:('ident, 'input, 'output2) through_with_context list ->
112 throw:('ident,'input) Remove.through list ->
113 ('ident, 'input) expr ->
114 ('ident, 'input) expr *
115 (('ident, 'output) expr -> ('ident, 'output) expr) *
116 (('ident, 'output2) expr -> ('ident, 'output2) expr)
117 val uncoerce : ('a,[< all_directives > `coerce] as 'b) expr ->
118 ('a, 'b) expr * (('a, [< all_directives > `coerce ] as 'c) expr -> ('a, 'c) expr)
119 val unletin : ('a,'b) expr ->
120 ('a,'b) expr * (('a,'b) expr -> ('a,'b) expr)
121 end
122
123
124 module FoldContext :
125 sig
126 val letin : ?through:('a,'b,'c) Context.through_with_context list ->
127 ('a, 'b) expr -> ('a, 'b) expr * ('a * ('a, 'b) expr) list * (('a,'c) expr -> ('a,'c) expr)
128 end
Something went wrong with that request. Please try again.