this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor fixes

+78 -18
+2
dune-project
··· 1 1 (lang dune 2.9) 2 + (name js_top_worker) 3 + (version 0.0.1) 2 4
+13 -8
idl/dune
··· 5 5 (libraries rresult)) 6 6 7 7 (library 8 - (name js_top_worker_rpc_codegen) 8 + (name js_top_worker_rpc_def) 9 9 (modules toplevel_api) 10 - (enabled_if (>= %{ocaml_version} 4.12)) 11 - (package js_top_worker_codegen) 12 - (preprocess (pps ppx_deriving_rpc))) 10 + (enabled_if 11 + (>= %{ocaml_version} 4.12)) 12 + (package js_top_worker_rpc_def) 13 + (preprocess 14 + (pps ppx_deriving_rpc))) 13 15 14 16 (rule 15 17 (target toplevel_api_gen.ml.gen) 16 - (enabled_if (>= %{ocaml_version} 4.12)) 18 + (enabled_if 19 + (>= %{ocaml_version} 4.12)) 17 20 (action 18 - (with-stderr-to %{target} (run ocamlc -stop-after parsing -dsource %{dep:toplevel_api.pp.ml})))) 21 + (with-stderr-to 22 + %{target} 23 + (run ocamlc -stop-after parsing -dsource %{dep:toplevel_api.pp.ml})))) 19 24 20 25 (rule 21 26 (alias runtest) 22 - (enabled_if (>= %{ocaml_version} 4.12)) 27 + (enabled_if 28 + (>= %{ocaml_version} 4.12)) 23 29 (action 24 30 (diff toplevel_api_gen.ml toplevel_api_gen.ml.gen))) 25 -
+14 -2
idl/idl.ml
··· 1 + let logfn = ref (fun (_ : string) -> ()) 1 2 module Param = struct 2 3 type 'a t = 3 4 { name : string option ··· 283 284 fun call -> 284 285 let fn = 285 286 try Hashtbl.find impl call.Rpc.name with 286 - | Not_found -> raise (UnknownMethod call.Rpc.name) 287 + | Not_found -> 288 + !logfn "1"; 289 + Hashtbl.iter (fun key _ -> !logfn ("method: " ^ key ^ (Hashtbl.hash key |> string_of_int)); !logfn key) impl; 290 + let _h = Hashtbl.hash call.Rpc.name in 291 + 292 + !logfn (Printf.sprintf "Unknown method: %s %d" call.Rpc.name (Hashtbl.hash call.Rpc.name)); 293 + !logfn call.Rpc.name; 294 + raise (UnknownMethod call.Rpc.name) 287 295 in 288 296 fn call 289 297 ··· 572 580 fun call -> 573 581 let fn = 574 582 try Hashtbl.find impl call.Rpc.name with 575 - | Not_found -> raise (UnknownMethod call.Rpc.name) 583 + | Not_found -> 584 + !logfn "2"; 585 + Hashtbl.iter (fun key _ -> !logfn ("method: " ^ key)) impl; 586 + !logfn (Printf.sprintf "Unknown method: %s" call.Rpc.name); 587 + raise (UnknownMethod call.Rpc.name) 576 588 in 577 589 fn call 578 590
+1 -1
idl/toplevel_api_gen.ml
··· 13 13 transparent_modules = false; 14 14 unboxed_types = false; 15 15 unsafe_string = false; 16 - cookies = [("library-name", "js_top_worker_rpc_dummy")] 16 + cookies = [("library-name", "js_top_worker_rpc_def")] 17 17 }] 18 18 [@@@ocaml.text " IDL for talking to the toplevel webworker "] 19 19 open Rpc
+19
js_top_worker.opam
··· 1 + version: "0.0.1" 2 + opam-version: "2.0" 3 + maintainer: "jon@recoil.org" 4 + authors: "various" 5 + license: "ISC" 6 + depends: [ 7 + "ocaml" 8 + "js_of_ocaml" {>= "3.11.0"} 9 + "rresult" 10 + ] 11 + build : [ 12 + ["dune" "subst"] {pinned} 13 + ["dune" "build" "-p" name "-j" jobs] 14 + ] 15 + synopsis: "JS Toplevel worker" 16 + description: """ 17 + An OCaml toplevel designed to run as a web worker 18 + """ 19 +
js_top_worker_codegen.opam

This is a binary file and will not be displayed.

+19
js_top_worker_rpc_def.opam
··· 1 + version: "0.0.1" 2 + opam-version: "2.0" 3 + maintainer: "jon@recoil.org" 4 + authors: "various" 5 + license: "ISC" 6 + depends: [ 7 + "ocaml" 8 + "ppx_deriving_rpc" 9 + "rresult" 10 + ] 11 + build : [ 12 + ["dune" "subst"] {pinned} 13 + ["dune" "build" "-p" name "-j" jobs] 14 + ] 15 + synopsis: "JS Toplevel worker IDL generator" 16 + description: """ 17 + An OCaml toplevel designed to run as a web worker: IDL generator edition 18 + """ 19 +
+1 -1
lib/dune
··· 1 1 ; Worker library 2 2 3 3 (library 4 - (name worker) 4 + (public_name js_top_worker) 5 5 (modules worker uTop_complete uTop_lexer uTop_token uTop) 6 6 (libraries 7 7 js_top_worker_rpc
+3 -3
lib/uTop_complete.ml
··· 254 254 | Directive listing | 255 255 +-----------------------------------------------------------------+ *) 256 256 257 - let list_directives phrase_terminator = 257 + let[@alert "-deprecated"] list_directives phrase_terminator = 258 258 String_map.bindings 259 259 (Hashtbl.fold 260 260 (fun dir kind map -> ··· 1005 1005 (* Generic completion on directives. *) 1006 1006 | [(Symbol "#", _); ((Lident dir | Uident dir), _); (Blanks, { idx2 = stop })] -> 1007 1007 (stop, 1008 - match try Some (Hashtbl.find Toploop.directive_table dir) with Not_found -> None with 1008 + match[@alert "-deprecated"] try Some (Hashtbl.find Toploop.directive_table dir) with Not_found -> None with 1009 1009 | Some (Toploop.Directive_none _) -> [(phrase_terminator, "")] 1010 1010 | Some (Toploop.Directive_string _) -> [(" \"", "")] 1011 1011 | Some (Toploop.Directive_bool _) -> [(true_name, phrase_terminator); (false_name, phrase_terminator)] ··· 1013 1013 | Some (Toploop.Directive_ident _) -> List.map (fun w -> (w, "")) (String_set.elements (global_names ())) 1014 1014 | None -> []) 1015 1015 | (Symbol "#", _) :: ((Lident dir | Uident dir), _) :: tokens -> begin 1016 - match try Some (Hashtbl.find Toploop.directive_table dir) with Not_found -> None with 1016 + match[@alert "-deprecated"] try Some (Hashtbl.find Toploop.directive_table dir) with Not_found -> None with 1017 1017 | Some (Toploop.Directive_none _) -> 1018 1018 (0, []) 1019 1019 | Some (Toploop.Directive_string _) ->
+6 -3
lib/worker.ml
··· 164 164 IdlM.ErrM.return Toplevel_api_gen.{ n; completions } 165 165 166 166 let server process e = 167 - let call : Rpc.call = e in 168 - M.bind (process call) (fun response -> Js_of_ocaml.Worker.post_message (response : Rpc.response)); 167 + let call : Rpc.call = Marshal.from_bytes e 0 in 168 + M.bind (process call) (fun response -> Js_of_ocaml.Worker.post_message (Marshal.to_string response [])); 169 169 () 170 170 171 - let run () = 171 + let run files = 172 172 (* Here we bind the server stub functions to the implementations *) 173 + Js_top_worker_rpc.Idl.logfn := (fun s -> Js_of_ocaml.(Firebug.console##log ( s))); 174 + Clflags.no_check_prims := true; 173 175 Server.complete complete; 174 176 Server.exec execute; 175 177 Server.setup setup; 176 178 let rpc_fn = IdlM.server Server.implementation in 179 + Js_of_ocaml.Worker.import_scripts files; 177 180 Js_of_ocaml.Worker.set_onmessage (server rpc_fn)