summaryrefslogtreecommitdiff
path: root/compiler/Print.ml
diff options
context:
space:
mode:
authorSon Ho2022-12-01 22:06:49 +0100
committerSon HO2023-02-03 11:21:46 +0100
commita4743c7176b7d85aa2b414748dedb089fd361484 (patch)
tree812d9283a5c34fea90befdbddc34afb88bcbb30f /compiler/Print.ml
parent7447ec54b5f50360ecbc25fd3182ea2cda891e4a (diff)
Make some fixes
Diffstat (limited to 'compiler/Print.ml')
-rw-r--r--compiler/Print.ml20
1 files changed, 18 insertions, 2 deletions
diff --git a/compiler/Print.ml b/compiler/Print.ml
index 6c0c95ad..9da3da9d 100644
--- a/compiler/Print.ml
+++ b/compiler/Print.ml
@@ -486,7 +486,7 @@ module Contexts = struct
let frames = split_aux [] [] env in
frames
- let eval_ctx_to_string (ctx : C.eval_ctx) : string =
+ let eval_ctx_to_string_gen (filter : bool) (ctx : C.eval_ctx) : string =
let fmt = eval_ctx_to_ctx_formatter ctx in
let ended_regions = T.RegionId.Set.to_string None ctx.ended_regions in
let frames = split_env_according_to_frames ctx.env in
@@ -509,11 +509,17 @@ module Contexts = struct
^ string_of_int !num_bindings
^ "\n- dummy bindings: " ^ string_of_int !num_dummies
^ "\n- abstractions: " ^ string_of_int !num_abs ^ "\n"
- ^ env_to_string true fmt f ^ "\n")
+ ^ env_to_string filter fmt f ^ "\n")
frames
in
"# Ended regions: " ^ ended_regions ^ "\n" ^ "# " ^ string_of_int num_frames
^ " frame(s)\n" ^ String.concat "" frames
+
+ let eval_ctx_to_string (ctx : C.eval_ctx) : string =
+ eval_ctx_to_string_gen true ctx
+
+ let eval_ctx_to_string_no_filter (ctx : C.eval_ctx) : string =
+ eval_ctx_to_string_gen false ctx
end
module PC = Contexts (* local module *)
@@ -579,4 +585,14 @@ module EvalCtxLlbcAst = struct
(indent_incr : string) (e : A.statement) : string =
let fmt = PC.eval_ctx_to_ast_formatter ctx in
PA.statement_to_string fmt indent indent_incr e
+
+ let env_elem_to_string (ctx : C.eval_ctx) (indent : string)
+ (indent_incr : string) (ev : C.env_elem) : string =
+ let fmt = PC.eval_ctx_to_ctx_formatter ctx in
+ PC.env_elem_to_string fmt indent indent_incr ev
+
+ let abs_to_string (ctx : C.eval_ctx) (indent : string) (indent_incr : string)
+ (abs : V.abs) : string =
+ let fmt = PC.eval_ctx_to_ctx_formatter ctx in
+ PV.abs_to_string fmt indent indent_incr abs
end