Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions asllib/asllib-www/jaslref.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ let run_asl code version exec =
Js_of_ocaml.Sys_js.update_file ~name:"web-input.asl" ~content:_code
in

try
run_with argv;
if not _exec then Printf.printf "ASL: type-check completed.\n%!"
with
try run_with argv with
| Asllib.Error.ASLException e ->
Printf.eprintf "%s\n%!" (Asllib.Error.error_to_string e)
| Exit _ -> ()
| Exit code ->
if not _exec then Printf.printf "ASL: type-check completed.\n%!"
else
Printf.printf "ASL: interpretation completed (exit code %n).\n%!" code

(* Expose to JavaScript *)
let () = Js.Unsafe.global##.runAsl := Js.wrap_callback run_asl
Loading