summaryrefslogtreecommitdiff
path: root/src/main.ml
diff options
context:
space:
mode:
authorSon Ho2021-11-17 15:33:10 +0100
committerSon Ho2021-11-17 15:33:10 +0100
commit2903cd956575624313d29e1a3ecd1abcbaab4dc3 (patch)
treefd8b430643c60d188cab94447faad449933784f2 /src/main.ml
parent49b15dbc29deb712a551af321ce18ef8d3e446d0 (diff)
Also generate to_yojson functions
Diffstat (limited to 'src/main.ml')
-rw-r--r--src/main.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.ml b/src/main.ml
index fc9e4efd..ce0a9269 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -18,7 +18,13 @@ type rust_module = {
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 json2 = Yojson.Safe.from_file "../charon/charon/tests/test4.cfim" in
+ let st1 = Return in
+ let json1 = statement_to_yojson st1 in
+ print_endline (Yojson.Safe.to_string json1);
+ let e1 = Statement Return in
+ let e1_json = expression_to_yojson e1 in
+ print_endline (Yojson.Safe.to_string e1_json);
+ 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"