diff options
Diffstat (limited to '')
-rw-r--r-- | src/main.ml | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main.ml b/src/main.ml index 7f130949..d32d9d42 100644 --- a/src/main.ml +++ b/src/main.ml @@ -17,8 +17,22 @@ type rust_module = { [@@deriving of_yojson] let () = - (* let json = Yojson.Basic.from_file "../charon/charon/tests/test1.cfim" in *) - let _json1 = Yojson.Safe.from_file "../charon/charon/tests/test1.cfim" in + (* let json = Yojson.Basic.from_string "{\"Return\"}" in + print_endline (Yojson.Basic.show json)*) + let json = Yojson.Basic.from_file "../charon/charon/tests/test1.cfim" in + match cfim_module_of_json json with + | Error s -> Printf.printf "error: %s\n" s + | Ok _ast -> print_endline "Ok" +(* let json = Yojson.Basic.from_string "{\"Statement\":\"Return\"}" in + print_endline (Yojson.Basic.show json)*) + +(* let json = Yojson.Safe.from_file "../charon/charon/tests/test1.cfim" in + match cfim_module_of_json json with + | Error s -> Printf.printf "error: %s\n" s + | Ok _ast -> print_endline "Ok"*) + +(* let json = Yojson.Basic.from_file "../charon/charon/tests/test1.cfim" in *) +(* let _json1 = Yojson.Safe.from_file "../charon/charon/tests/test1.cfim" in let st1 = Return in let json1 = statement_to_yojson st1 in print_endline (Yojson.Safe.to_string json1); @@ -31,7 +45,7 @@ let () = let json2 = Yojson.Safe.from_string "[\"Return\"]" in match statement_of_yojson json2 with | Error s -> Printf.printf "error: %s\n" s - | Ok _ast -> print_endline "ast" + | Ok _ast -> print_endline "ast"*) (* match rust_module_of_yojson json with | Error s -> Printf.printf "error: %s\n" s | Ok _ast -> print_endline "ast"*) |