For example when using a malformed JSON file, Aeneas displays the raw exception with a stack trace:
$ echo '{' > /tmp/invalid.llbc
$ aeneas -backend lean /tmp/invalid.llbc
Uncaught exception:
Yojson__Common.Json_error("Line 2, bytes -1-0:\nUnexpected end of input")
Raised at Yojson__Common.json_error in file "lib/common.ml", line 5, characters 19-39
Called from Yojson__Basic.__ocaml_lex_read_json_rec in file "lib/read.mll", line 215, characters 38-57
Called from Yojson__Basic.read_json in file "lib/read.ml" (inlined), line 980, characters 3-39
Called from Yojson__Basic.from_lexbuf in file "lib/read.mll", line 875, characters 8-26
Called from Yojson__Basic.from_channel in file "lib/read.mll", line 896, characters 6-26
Called from Yojson__Basic.from_file in file "lib/read.mll", line 903, characters 14-47
Re-raised at Yojson__Basic.from_file in file "lib/read.mll", line 908, characters 6-13
Called from Charon__OfJson.crate_of_json_file in file "charon/charon-ml/src/OfJson.ml", line 59, characters 17-44
Called from Dune__exe__Main in file "Main.ml", line 557, characters 8-35
Are you interested in this kind of inconsistencies in the OCaml API? There are other occurences of similar patterns, for example when char_of_json calls String.get_utf_8_uchar.
Hello,
Function
crate_of_json_fileis declared to return aresultbut may also throw some exceptions, incharon/charon-ml/src/OfJson.ml
Lines 55 to 60 in 8547b06
For example when using a malformed JSON file, Aeneas displays the raw exception with a stack trace:
Are you interested in this kind of inconsistencies in the OCaml API? There are other occurences of similar patterns, for example when
char_of_jsoncallsString.get_utf_8_uchar.