Skip to content
This repository
Newer
Older
100644 68 lines (54 sloc) 2.054 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 Compilation to Javascript, and reinsertion of the code in the qml.
20 @author Mathieu Barbin
21 @author Maxime Audoin
22 *)
23
24 (**
25
26 The client code is compiled to [JsAst], and then serialized, using the runtime JsAst
27 defined in the package [stdlib.js].
28 The serialized js supports a runtime alpha-renaming and dead code elimination.
29 This code is reinjected in the server code.
30
31 Compositionality:
32 + We should remember the list of extra libs and plugin already compiled and registred
33 to avoid to register them several time.
34 *)
35
36 (**
37 Process the code.
38
39 FIXME:
40
41 + passing options arround will probably become deprecated when we will be finished
42 with the refactoring of private options with local Arg modules directly in passes.
43
44 + the typing environment is probably needed as read-only.
45 The reinjected code can be not typed, nobody cares.
46
47 The returned value is the server with the client reinjected.
48 *)
49
50 (**
51 {[
52 a = register("key", b)
53 ]}
54 a -> b, "key"
55 *)
56
57 val process :
58 options:OpaEnv.opa_options ->
59 closure_map:Ident.t IdentMap.t ->
60 renaming_server:QmlRenamingMap.t ->
61 renaming_client:QmlRenamingMap.t ->
62 client_roots:IdentSet.t ->
63 typing:QmlTyper.env -> (* currently unused *)
64 bsl_pp:(string -> string) ->
65 bsl_client:BslLib.env_bsl ->
66 server: QmlBlender.qml_milkshake ->
67 client: QmlBlender.qml_milkshake ->
68 QmlBlender.qml_milkshake
Something went wrong with that request. Please try again.