Skip to content
This repository
tree: cd0c3f8c85
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 66 lines (49 sloc) 2.271 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
(*
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/>.
*)
(**
This pass checks if one or several 'server' values are defined at the
toplevel. If so, it updates the options and insert a \@server_entry_point
directive for each 'server' value, on user code. If a 'server' value is
found in strandard library code, it raise an exception and stop the
compilation.


Assumptions: no alpha renaming

Directives removed : [\[\]]

Directives added : [\[ `server_entry_point \]]

*)
val pass_check_server_entry_point :
  options:OpaEnv.opa_options ->
  (SurfaceAst.nonuid, [< SurfaceAst.all_directives > `server_entry_point ] as 'a) SurfaceAstPassesTypes.env_both_lcodes ->
    (OpaEnv.opa_options * (string, 'a) SurfaceAstPassesTypes.env_both_lcodes)

(**
This pass replaces \@server_entry_point with call to a Bsl function which will
store [service] produced by server maker.

Directives removed : [\[ `server_entry_point \]]

Directives added : [\[\]]
*)
val pass_resolve_server_entry_point :
  options:OpaEnv.opa_options ->
  (Ident.t, [< SurfaceAst.all_directives > `server_entry_point] as 'a) SurfaceAst.code ->
    (Ident.t, 'a) SurfaceAst.code


(**
This pass add a toplevel declaration, which will launch the retrieve all
services stored, combine them and launch the server.
If retrieved services haven't same options (port, encryption, see [Server]), a
runtime error will be produced.

Directives removed : [\[ `server_entry_point \]]

Directives added : [\[\]]
*)
val pass_adding_server :
  options:OpaEnv.opa_options ->
  (Ident.t, [< SurfaceAst.all_directives > `coerce ] as 'a) SurfaceAst.code ->
    (Ident.t, 'a) SurfaceAst.code
Something went wrong with that request. Please try again.