Skip to content
This repository
tag: v642
Fetching contributors…

Cannot retrieve contributors at this time

file 68 lines (54 sloc) 2.054 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(**
Compilation to Javascript, and reinsertion of the code in the qml.
@author Mathieu Barbin
@author Maxime Audoin
*)

(**

The client code is compiled to [JsAst], and then serialized, using the runtime JsAst
defined in the package [stdlib.js].
The serialized js supports a runtime alpha-renaming and dead code elimination.
This code is reinjected in the server code.

Compositionality:
+ We should remember the list of extra libs and plugin already compiled and registred
to avoid to register them several time.
*)

(**
Process the code.

FIXME:

+ passing options arround will probably become deprecated when we will be finished
with the refactoring of private options with local Arg modules directly in passes.

+ the typing environment is probably needed as read-only.
The reinjected code can be not typed, nobody cares.

The returned value is the server with the client reinjected.
*)

(**
{[
a = register("key", b)
]}
a -> b, "key"
*)

val process :
  options:OpaEnv.opa_options ->
  closure_map:Ident.t IdentMap.t ->
  renaming_server:QmlRenamingMap.t ->
  renaming_client:QmlRenamingMap.t ->
  client_roots:IdentSet.t ->
  typing:QmlTyper.env -> (* currently unused *)
  bsl_pp:(string -> string) ->
  bsl_client:BslLib.env_bsl ->
  server: QmlBlender.qml_milkshake ->
  client: QmlBlender.qml_milkshake ->
  QmlBlender.qml_milkshake
Something went wrong with that request. Please try again.