lol bootstrap achieved... prob need to figure out how to use js_of_ocaml-ppx with it next

This commit is contained in:
cqc
2024-02-17 13:00:38 -06:00
parent faa945f65c
commit 2e6991f3dc
3 changed files with 30 additions and 118 deletions

View File

@ -377,7 +377,7 @@ module History = struct
textbox##.value := Js.string !data.(!idx))
end
let run ~output () =
let run ~init ~output () =
Firebug.console##log "run";
let container = by_id "toplevel-container" in
@ -511,6 +511,17 @@ let run ~output () =
History.setup ();
textbox##.value := Js.string "";
(* Run initial code if any *)
(try
textbox##.value := Js.string init;
Lwt.async (fun () ->
execute (Js.to_string textbox##.value##trim) ())
with
| Not_found -> ()
| exc ->
Firebug.console##log_3
(Js.string ".config/init.ml exception")
(Js.string (Printexc.to_string exc))
exc);
try
let code = List.assoc "code" (parse_hash ()) in
textbox##.value := Js.string (B64.decode code);