summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CfimOfJson.ml15
-rw-r--r--src/Modules.ml21
-rw-r--r--src/main.ml4
3 files changed, 26 insertions, 14 deletions
diff --git a/src/CfimOfJson.ml b/src/CfimOfJson.ml
index b693a4db..55362bda 100644
--- a/src/CfimOfJson.ml
+++ b/src/CfimOfJson.ml
@@ -13,6 +13,7 @@ open Identifiers
open Types
open OfJsonBasic
open Scalars
+open Modules
let name_of_json (js : json) : (name, string) result =
combine_error_msgs js "name_of_json" (list_of_json string_of_json js)
@@ -579,20 +580,6 @@ let fun_def_of_json (js : json) : (fun_def, string) result =
Ok { def_id; name; signature; divergent; arg_count; locals; body }
| _ -> Error "")
-(** Module declaration *)
-type declaration =
- | Type of TypeDefId.id
- | Fun of FunDefId.id
- | RecTypes of TypeDefId.id list
- | RecFuns of FunDefId.id list
-
-type cfim_module = {
- declarations : declaration list;
- types : type_def TypeDefId.vector;
- functions : fun_def FunDefId.vector;
-}
-(** CFIM module *)
-
let declaration_of_json (js : json) : (declaration, string) result =
combine_error_msgs js "declaration_of_json"
(match js with
diff --git a/src/Modules.ml b/src/Modules.ml
new file mode 100644
index 00000000..a2b1d3bf
--- /dev/null
+++ b/src/Modules.ml
@@ -0,0 +1,21 @@
+open Yojson.Basic
+open Identifiers
+open Types
+open OfJsonBasic
+open Scalars
+open Values
+open CfimAst
+
+(** Module declaration *)
+type declaration =
+ | Type of TypeDefId.id
+ | Fun of FunDefId.id
+ | RecTypes of TypeDefId.id list
+ | RecFuns of FunDefId.id list
+
+type cfim_module = {
+ declarations : declaration list;
+ types : type_def TypeDefId.vector;
+ functions : fun_def FunDefId.vector;
+}
+(** CFIM module *)
diff --git a/src/main.ml b/src/main.ml
index 8c05c33b..dfa4025c 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -1,6 +1,10 @@
open CfimOfJson
open Logging
open Print
+module T = Types
+module A = CfimAst
+
+(*let print_type_definition =*)
(* This is necessary to have a backtrace when raising exceptions - for some
* reason, the -g option doesn't work *)