Skip to content
This repository
Newer
Older
100644 63 lines (53 sloc) 2.194 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
19 (**
20 Rewrite the directive `closure_create and `closure_apply
21
22 @author Sebastien Briais
23 @author Valentin Gatien-Baron
24 *)
25
26 val process_code:
27 typed:bool -> (* same remark as Pass_LambdaLifting *)
28 side:[`client|`server] ->
29 renaming_client:QmlRenamingMap.t ->
30 renaming_server:QmlRenamingMap.t ->
31 QmlTypes.bypass_typer ->
32 QmlTypes.gamma ->
33 QmlAst.annotmap ->
34 QmlAst.code ->
35 (QmlTypes.gamma * QmlAst.annotmap) * QmlAst.code
36
37 (** [args_apply ~typed (gamma, annotmap) clos args]
38 Apply the closure [clos] with [args], which must be its last arguments *)
39 val args_apply : typed:bool ->
40 QmlAstCons.TypedExpr.gamma * QmlAstCons.TypedExpr.annotmap ->
41 QmlAst.expr -> QmlAst.expr list ->
42 QmlAstCons.TypedExpr.annotmap * QmlAst.expr
43
44 val generate_applys_js : ?at_least:int -> unit -> (string * JsAst.statement) list
45 val generate_applys : ?at_least:int -> [`js|`caml] -> string
46 (**
47 To be called by backends after a call to [process_code]
48 to generate the definitions that are used in the code returned
49 by [process_code] (it contains the directive @backend_ident)
50 At least indicate the least number of clos_applyX functions to
51 be generated
52 *)
53
54 (** Return the closure name from an ident.
55 @raise Not_found when the identifier is not in the images of the renaming map
56 when safe is false (which is the default)
57 *)
58 val make_closure_name :
59 ?safe:bool ->
60 side:[`client|`server] ->
61 renaming_server:QmlRenamingMap.t ->
62 renaming_client:QmlRenamingMap.t ->
63 Ident.t -> string
Something went wrong with that request. Please try again.