Commit adfee158 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Sucessfully built cduce.exe with dune.

parent 799d66b5
......@@ -13,7 +13,7 @@ let load_url s =
);
Curl.perform conn;
Buffer.contents buff
with Curl.CurlException (code, n, msg) ->
with Curl.CurlException (_code, n, msg) ->
Value.failwith' (Printf.sprintf "Curl error for url `%s' %i: %s" s n msg)
let use () = Url.url_loader := load_url
......
......@@ -22,7 +22,7 @@ let load_from_file p s =
let rec push p s =
Expat.set_external_entity_ref_handler p
(fun ctx base sys pub ->
(fun ctx _base sys _pub ->
let s = Url.local s sys in
let p = Expat.external_entity_parser_create p ctx None in
push p s);
......@@ -40,8 +40,8 @@ let rec push p s =
in
Value.failwith' msg
let rec load_expat se ee txt s =
let p = Expat.parser_create None in
let load_expat se ee txt s =
let p = Expat.parser_create ~encoding:None in
Expat.set_start_element_handler p se;
Expat.set_end_element_handler p ee;
Expat.set_character_data_handler p txt;
......
include (Cduce_netclient : sig end)
include (Cduce_curl: sig end)
include (Cduce_pxp: sig end)
include (Cduce_expat: sig end)
include (System: sig end)
\ No newline at end of file
open Pxp_yacc
open Pxp_lexer_types
open Pxp_types
open Pxp_ev_parser
open Pxp_reader
......
(library
(name cduce_native_backend)
(library_flags (-linkall))
(modules
(:standard
\
("cduce_pxp" cduce_netclient)))
(libraries
unix
cduce-types
cduce-core
cduce_config
(select
cduce_curl.ml
from
(curl -> cduce_curl.real.ml)
(-> cduce_curl.empty.ml))
(select
cduce_expat.ml
from
(expat -> cduce_expat.real.ml)
(-> cduce_expat.empty.ml))
;Trickery to only include threads library when netstring is present
(select
fake_cduce_netclient.ml
from
(cduce_netclient -> fake_cduce_netclient.empty.ml)
(-> fake_cduce_netclient.empty.ml))
(select
fake_cduce_pxp.ml
from
(cduce_pxp -> fake_cduce_pxp.empty.ml)
(-> fake_cduce_pxp.empty.ml))))
(library
(name cduce_pxp)
(optional)
(modules cduce_pxp)
(library_flags (-linkall))
(libraries threads pxp cduce-types cduce-core cduce_config))
(library
(name cduce_netclient)
(optional)
(modules cduce_netclient)
(library_flags (-linkall))
(libraries threads netclient cduce-types cduce-core cduce_config))
open Operators
open Cduce_types
open Builtin_defs
open Ident
......@@ -90,15 +91,13 @@ let () = register_fun "getenv" string_latin1 string_latin1
with Not_found -> raise exn_not_found)
in
let () = register_fun "argv" nil (Sequence.star string_latin1)
(fun e ->
(fun _e ->
Cduce_loc.protect_op "argv";
!Builtin.argv)
in ()
let () =
Cduce_config.register
"system"
"System calls"
use
val use : unit -> unit
let features = ref []
let init_all () = List.iter (fun (_, _, f) -> f ()) (List.rev !features)
let register n d f = features := (n, d, f) :: !features
let descrs () = List.rev_map (fun (n, d, _) -> (n, d)) !features
let inhibit n = features := List.filter (fun (n', _, _) -> n <> n') !features
val init_all: unit -> unit
val register: string -> string -> (unit -> unit) -> unit
val descrs: unit -> (string * string) list
val inhibit: string -> unit
val init_all : unit -> unit
val register : string -> string -> (unit -> unit) -> unit
val descrs : unit -> (string * string) list
val inhibit : string -> unit
(* Last registered features are initialized last (and thus take priority) *)
(library
(name cduce_config)
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment