summaryrefslogtreecommitdiff
path: root/compiler/Print.ml
diff options
context:
space:
mode:
authorSon Ho2023-09-17 06:58:17 +0200
committerSon Ho2023-09-17 06:58:17 +0200
commit353a9627cf39290f2fe841a45e52726aa9fe6512 (patch)
treed0b1562d6b611c7cf01a1561ad45e1fc6c67d732 /compiler/Print.ml
parent80728093c432ba15eace9d6ce1cc9e3c56a80ff7 (diff)
Normalize the function signatures before translation to pure
Diffstat (limited to 'compiler/Print.ml')
-rw-r--r--compiler/Print.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/Print.ml b/compiler/Print.ml
index 522d9fdd..5d5c16ee 100644
--- a/compiler/Print.ml
+++ b/compiler/Print.ml
@@ -478,6 +478,9 @@ module Contexts = struct
let ctx_to_rtype_formatter (fmt : ctx_formatter) : PT.rtype_formatter =
PV.value_to_rtype_formatter fmt
+ let ctx_to_stype_formatter (fmt : ctx_formatter) : PT.stype_formatter =
+ PV.value_to_stype_formatter fmt
+
let eval_ctx_to_ctx_formatter (ctx : C.eval_ctx) : ctx_formatter =
let rvar_to_string r =
(* In theory we shouldn't use rvar_to_string, but it can happen
@@ -651,6 +654,11 @@ module EvalCtxLlbcAst = struct
let fmt = PC.ctx_to_rtype_formatter fmt in
PT.rty_to_string fmt t
+ let sty_to_string (ctx : C.eval_ctx) (t : T.sty) : string =
+ let fmt = PC.eval_ctx_to_ctx_formatter ctx in
+ let fmt = PC.ctx_to_stype_formatter fmt in
+ PT.sty_to_string fmt t
+
let etrait_ref_to_string (ctx : C.eval_ctx) (x : T.etrait_ref) : string =
let fmt = PC.eval_ctx_to_ctx_formatter ctx in
let fmt = PC.ctx_to_etype_formatter fmt in
@@ -661,6 +669,11 @@ module EvalCtxLlbcAst = struct
let fmt = PC.ctx_to_rtype_formatter fmt in
PT.rtrait_ref_to_string fmt x
+ let strait_ref_to_string (ctx : C.eval_ctx) (x : T.strait_ref) : string =
+ let fmt = PC.eval_ctx_to_ctx_formatter ctx in
+ let fmt = PC.ctx_to_stype_formatter fmt in
+ PT.strait_ref_to_string fmt x
+
let etrait_instance_id_to_string (ctx : C.eval_ctx) (x : T.etrait_instance_id)
: string =
let fmt = PC.eval_ctx_to_ctx_formatter ctx in
@@ -673,6 +686,12 @@ module EvalCtxLlbcAst = struct
let fmt = PC.ctx_to_rtype_formatter fmt in
PT.rtrait_instance_id_to_string fmt x
+ let strait_instance_id_to_string (ctx : C.eval_ctx) (x : T.strait_instance_id)
+ : string =
+ let fmt = PC.eval_ctx_to_ctx_formatter ctx in
+ let fmt = PC.ctx_to_stype_formatter fmt in
+ PT.strait_instance_id_to_string fmt x
+
let egeneric_args_to_string (ctx : C.eval_ctx) (x : T.egeneric_args) : string
=
let fmt = PC.eval_ctx_to_ctx_formatter ctx in