Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

598 lines (525 sloc) 15.695 kb
(*
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/>.
*)
(**
Interface between the compiler and the standard library.
Contain identifier and bslkeys of all opa functions inserted by the compiler.
*)
(**
The hierachy of ocaml values follows the module hierarchy of opa values.
The hierarchy must be respected.
All ident content are opa pathes where dot has been replaced by '_'.
Define ONLY CONSTANT STRING
A check (cf checkopacapi.ml), called during mkinstall check that:
- there is a strict equality between bypasses marked as [[opacapi]]
in the bsl and bypass available there,
- there is a strict equality between identifiers marked as [\@opacapi]
in the stdlib and identifier available there.
*)
let table = Hashtbl.create 128
let (!!) s =
if Hashtbl.mem table s then (prerr_endline s; assert false);
Hashtbl.add table s s;
s
(* toplevel *)
let (==) = !! "=="
let (!=) = !! "!="
let identity = !! "identity"
let internal__add_css_entry = !! "__internal__add_css_entry"
let magicToString = !! "magicToString"
let magicToXml = !! "magicToXml"
let never_do_anything = !! "never_do_anything"
let none = !! "none"
let callFA = !! "callFA"
let some = !! "some"
let unary_minus = !! "unary_minus"
let unary_minus_dot = !! "unary_minus_dot"
module Client_code =
struct
let (!!) s = !! ("Client_code_" ^ s)
let register_css_declaration = !! "register_css_declaration"
let register_js_code = !! "register_js_code"
let register_js_code_elt = !! "register_js_code_elt"
end
module DbVirtual =
struct
let (!!) s = !! ("DbVirtual_" ^ s)
let hack_coerce_default = !! "hack_coerce_default"
let hack_coerce_option = !! "hack_coerce_option"
let hack_coerce_vvpath = !! "hack_coerce_vvpath"
let hack_coerce_vrpath = !! "hack_coerce_vrpath"
let make_ref = !! "make_ref"
let make_val = !! "make_val"
end
module Dom =
struct
let (!!) s = !! ("Dom_" ^ s)
let select_class = !! "select_class"
let select_id = !! "select_id"
end
module Core_server_code =
struct
let (!!) s = !! ("Core_server_code_" ^ s)
let register_server_code = !! "register_server_code"
end
module FiniteSingleThreadLazy =
struct
let (!!) s = !! ("FiniteSingleThreadLazy_" ^ s)
let force = !! "force"
end
module FunActionServer =
struct
let (!!) s = !! ("FunActionServer_" ^ s)
let serialize_argument = !! "serialize_argument"
let serialize_call = !! "serialize_call"
let serialize_ty_argument = !! "serialize_ty_argument"
end
module IntMap =
struct
let (!!) s = !! ("IntMap_" ^ s)
let add = !! "add"
let empty = !! "empty"
let fold = !! "fold"
end
module Mutable =
struct
let (!!) s = !! ("Mutable_" ^ s)
let make = !! "make"
let set = !! "set"
end
module Opa2Js =
struct
let (!!) s = !! ("Opa2Js_" ^ s)
let to_string = !! "to_string"
end
module OpaRPC =
struct
let (!!) s = !! ("OpaRPC_" ^ s)
let add_args_with_type = !! "add_args_with_type"
let add_var_types = !! "add_var_types"
let add_row_types = !! "add_row_types"
let add_col_types = !! "add_col_types"
let client_async_send_to_server = !! "Client_async_send_to_server"
let client_dispatcher_register = !! "Client_Dispatcher_register"
let client_send_to_server = !! "Client_send_to_server"
let client_try_cache = !! "Client_try_cache"
let empty_request = !! "empty_request"
let error_stub = !! "error_stub"
let extract_types = !! "extract_types"
let extract_values = !! "extract_values"
let fake_stub = !! "fake_stub"
let serialize = !! "serialize"
let server_async_execute_without_reply = !! "Server_async_execute_without_reply"
let server_dispatcher_register = !! "Server_Dispatcher_register"
let server_send_to_client = !! "Server_send_to_client"
let server_try_cache = !! "Server_try_cache"
let unserialize = !! "unserialize"
end
module OpaSerialize =
struct
let (!!) s = !! ("OpaSerialize_" ^ s)
let serialize = !! "serialize"
let serialize_for_js = !! "serialize_for_js"
let unserialize = !! "unserialize"
let unserialize_ty = !! "unserialize_ty"
let unserialize_unsafe = !! "unserialize_unsafe"
end
module OpaTsc =
struct
let (!!) s = !! ("OpaTsc_" ^ s)
let implementation = !! "implementation"
end
module OpaType =
struct
let (!!) s = !! ("OpaType_" ^ s)
let instantiate_row = !! "instantiate_row"
let instantiate_col = !! "instantiate_col"
end
module OpaValue =
struct
let (!!) s = !! ("OpaValue_" ^ s)
let add_compare = !! "add_compare"
let add_serializer = !! "add_serializer"
let add_to_string = !! "add_to_string"
let add_xmlizer = !! "add_xmlizer"
end
module Parser =
struct
let (!!) s = !! ("Parser_" ^ s)
let of_string = !! "of_string"
end
module Resource_private =
struct
let (!!) s = !! ("Resource_private_"^s)
let content_of_include = !!"content_of_include"
let make_include = !! "make_include"
let make_resource_include = !! "make_resource_include"
let raw_resource_factory = !! "raw_resource_factory"
end
module Server_private =
struct
let (!!) s = !! ("Server_private_" ^ s)
let add_service = !! "add_service"
let run_services = !! "run_services"
end
module StringMap =
struct
let (!!) s = !! ("StringMap_" ^ s)
let add = !! "add"
let empty = !! "empty"
let fold = !! "fold"
end
module Xml =
struct
(* FIXME: respect guidelines in opa_compiler_interface, Xml_ *)
let (!!) s = !! ("xml_" ^ s)
let find_attr = !! "find_attr"
let match_number = !! "match_number"
let match_plus = !! "match_plus"
let match_question = !! "match_question"
let match_range = !! "match_range"
let match_star = !! "match_star"
let split = !! "split"
let split_between = !! "split_between"
end
(**
Types definitions
*)
module Types =
struct
let bool = !! "bool"
let badop_engine_database_options = !! "badop_engine_database_options"
let badoplink_data_d = !! "badoplink_data_d"
let badoplink_database = !! "badoplink_database"
let badoplink_db_partial_key = !! "badoplink_db_partial_key"
let badoplink_db_path_key = !! "badoplink_db_path_key"
let badop_engine_t = !! "badop_engine_t"
let badoplink_node_config = !! "badoplink_node_config"
let badoplink_path = !! "badoplink_path"
let badoplink_transaction = !! "badoplink_transaction"
let binary = !! "binary"
let caml_list = !! "caml_list"
let char = !! "char"
let continuation = !! "continuation"
let dbgraph_diff = !! "dbgraph_diff"
let dbset = !! "dbset"
let dom = !! "dom"
let finite_single_thread_lazy = !! "finite_single_thread_lazy"
let float = !! "float"
let handle_assoc = !! "handle_assoc"
let event_handler = !! "event_handler"
let int = !! "int"
let ip = !! "ip"
let itextrator = !! "itextrator"
let list = !! "list"
let llarray = !! "llarray"
let map = !! "map"
let option = !! "option"
let path_embed_info = !! "path_embed_info"
let path_embedded_obj = !! "path_embedded_obj"
let path_ref_p = !! "path_ref_p"
let path_t = !! "path_t"
let path_val_p = !! "path_val_p"
let string = !! "string"
let stringmap = !! "stringmap"
let text = !! "text"
let transactions_t = !! "transactions_t"
let tuple_2 = !! "tuple_2"
let virtual_ref_path = !! "virtual_ref_path"
let virtual_val_path = !! "virtual_val_path"
let void = !! "void"
let xhtml = !! "xhtml"
let xhtml_event = !! "xhtml_event"
let xhtml_href = !! "xhtml_href"
let xml = !! "xml"
module Css =
struct
let (!!) s= !! ("Css." ^ s)
let background = !! "background"
let event = !! "event"
let length = !! "length"
let percentage = !! "percentage"
let prop_value_item = !! "prop_value_item"
let selector_item = !! "selector_item"
let size = !! "size"
let size_or_none = !! "size_or_none"
let size_or_normal = !! "size_or_normal"
end
module Cps =
struct
let (!!) s = !! ("Cps." ^ s)
let future = !! "future"
end
module Deprecated =
struct
let (!!) s = !! ("Deprecated." ^ s)
let argument = !! "argument"
end
module Dom =
struct
let (!!) s = !! ("Dom." ^ s)
let transformation = !! "transformation"
module Event =
struct
let (!!) s = !! ("event." ^ s)
let kind = !! "kind"
end
module Transformation =
struct
let (!!) s = !! ("Transformation." ^ s)
let subject = !! "subject"
end
end
module FunAction =
struct
let (!!) s = ("FunAction." ^ s)
let t = !! "t"
end
module OPA =
struct
let (!!) s = !! ("OPA." ^ s)
module Init =
struct
let (!!) s = !! ("Init." ^ s)
let value = !! "value"
end
end
module OpaRPC =
struct
let (!!) s = !! ("OpaRPC." ^s)
let request = !! "request"
end
module OpaSerialize =
struct
let (!!) s = !! ("OpaSerialize." ^s)
let options = !! "options"
end
module OpaTsc =
struct
let (!!) s = !! ("OpaTsc." ^s)
let t = !! "t"
end
module OpaType =
struct
let (!!) s = !! ("OpaType." ^s)
let col = !! "col"
let row = !! "row"
let ty = !! "ty"
let typevar = !! "typevar"
end
module Order =
struct
let (!!) s = !! ("Order." ^s)
let comparison = !! "comparison"
end
module Parser =
struct
let (!!) s = !! ("Parser." ^ s)
let general_parser = !! "general_parser"
end
module RPC =
struct
let (!!) s = !! ("RPC." ^s)
module Json =
struct
let (!!) s = !! ("Json." ^ s)
let json = !! "json"
end
end
module ThreadContext =
struct
let (!!) s = !! ("ThreadContext." ^ s)
let t = (!!) "t"
end
module Xml =
struct
let (!!) s = !! ("Xml." ^ s)
let attribute = !! "attribute"
end
end
(**
Bypass inserted by the compiler
*)
module Opabsl =
struct
let table = Hashtbl.create 128
let (!!) s =
let s = BslKey.normalize s in
if Hashtbl.mem table s then (prerr_endline (BslKey.to_string s); assert false);
Hashtbl.add table s s;
s
module Badoplink =
struct
let (!!) s = !! ("Badoplink." ^ s)
let add_hole = !! "add_hole"
let add_key = !! "add_key"
let clear = !! "clear"
let create_dbset = !! "create_dbset"
let data_binary = !! "data_binary"
let data_float = !! "data_float"
let data_int = !! "data_int"
let data_obj_binary = !! "data_obj_binary"
let data_obj_float = !! "data_obj_float"
let data_obj_int = !! "data_obj_int"
let data_obj_text = !! "data_obj_text"
let data_text = !! "data_text"
let data_unit = !! "data_unit"
let db_prefix = !! "db_prefix"
let dbpath_add = !! "dbpath_add"
let dbpath_root = !! "dbpath_root"
let empty_partial_key = !! "empty_partial_key"
let error = !! "error"
let exists = !! "exists"
let fatal_error = !! "fatal_error"
let fold_children = !! "fold_children"
let fold_int_keys = !! "fold_int_keys"
let fold_string_keys = !! "fold_string_keys"
let get_new_key = !! "get_new_key"
let get_opt = !! "get_opt"
let get_registered_db_ident = !! "get_registered_db_ident"
let get_registered_root_edge = !! "get_registered_root_edge"
let is_db_new = !! "is_db_new"
let jlog = !! "jlog"
let key_int = !! "key_int"
let key_list = !! "key_list"
let key_string = !! "key_string"
let key_value_int = !! "key_value_int"
let key_value_string = !! "key_value_string"
let node_config_construct = !! "node_config_construct"
let node_properties = !! "node_properties"
let open_db = !! "open_db"
let register_db_ident = !! "register_db_ident"
let register_root_edge = !! "register_root_edge"
let remove_children = !! "remove_children"
let set = !! "set"
let set_current_copy = !! "set_current_copy"
let set_dbset_keys = !! "set_dbset_keys"
let set_link = !! "set_link"
let shall_i_upgrade = !! "shall_i_upgrade"
let trans_abort = !! "trans_abort"
let trans_commit = !! "trans_commit"
let trans_start = !! "trans_start"
let uppath = !! "uppath"
end
module BadopEngine =
struct
let (!!) s = !! ("Badop_engine." ^ s)
let check_remaining_arguments = !! "check_remaining_arguments"
let local_options = !! "local_options"
let client_options = !! "client_options"
let get = !! "get"
end
module BslClientCode =
struct
let (!!) s = !! ("BslClientCode." ^ s)
let serialize_string_length = !! "serialize_string_length"
end
module BslClosure =
struct
let (!!) s = !! ("BslClosure." ^ s)
let create_and_register = !! "create_and_register"
let create_no_function_and_register = !! "create_no_function_and_register"
let define_function = !! "define_function"
end
module BslCps =
struct
let (!!) s = !! ("BslCps." ^ s)
module Notcps_compatibility =
struct
let (!!) s = !! ("Notcps_compatibility." ^ s)
let thread_context = !! "thread_context"
end
end
module BslInit =
struct
let (!!) s = !! ("BslInit." ^ s)
let set_executable_id = !! "set_executable_id"
end
module BslJsIdent =
struct
let (!!) s = !! ("BslJsIdent." ^ s)
let define_rename = !! "define_rename"
let set_cleaning_default_value = !! "set_cleaning_default_value"
end
module BslNativeLib =
struct
let (!!) s = !! ("BslNativeLib."^s)
let cons = !! "cons"
let empty_list = !! "empty_list"
end
module BslPervasives =
struct
let (!!) s = !! ("BslPervasives." ^ s)
let compare_raw = !! "compare_raw"
let fail = !! "fail"
let fail_cps = !! "fail_cps"
let return_exc = !! "return_exc"
module Magic =
struct
let (!!) s = !! ("Magic." ^ s)
let id = !! "id"
end
end
module BslReference =
struct
let (!!) s = !! ("BslReference." ^ s)
let create = !! "create"
end
module BslValue =
struct
let (!!) s = !! ("BslValue." ^ s)
module Tsc =
struct
let (!!) s = !! ("Tsc." ^ s)
let add = !! "add"
end
end
module Dbgraph =
struct
let (!!) s = !! ("Dbgraph." ^ s)
let diff = !! "diff"
let diff_message = !! "diff_message"
let diff_status = !! "diff_status"
let empty_diff = !! "empty_diff"
let get_diffed_schema = !! "get_diffed_schema"
let matching_edge = !! "matching_edge"
let print_tree = !! "print_tree"
end
module Path =
struct
let (!!) s = !! ("Path." ^ s)
let copy = !! "copy"
let embed_record_data = !! "embed_record_data"
let embedded_path = !! "embedded_path"
let get_lazy_info_opt = !! "get_lazy_info_opt"
let get_ref_path = !! "get_ref_path"
let get_val_path = !! "get_val_path"
let inject_record_data = !! "inject_record_data"
end
module Transactions =
struct
let (!!) s = !! ("Transactions." ^ s)
let commit = !! "commit"
let continue = !! "continue"
let fail = !! "fail"
let get_global_transaction_opt = !! "get_global_transaction_opt"
let set_global_transaction = !! "set_global_transaction"
let start = !! "start"
end
module BslAppSrcCode =
struct
let (!!) s = !! ("BslAppSrcCode." ^ s)
let register_src_code = !! "register_src_code"
let register_special_src_code = !! "register_special_src_code"
end
end
Jump to Line
Something went wrong with that request. Please try again.