summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Print.ml12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Print.ml b/src/Print.ml
index 0a340e69..22774c2a 100644
--- a/src/Print.ml
+++ b/src/Print.ml
@@ -821,7 +821,6 @@ end
module PA = CfimAst (* local module *)
(** Pretty-printing for ASTs (functions based on a definition context) *)
-
module DefCtxCfimAst = struct
(** This function pretty-prints a type definition by using a definition
context *)
@@ -885,5 +884,12 @@ module DefCtxCfimAst = struct
end
(** Pretty-printing for ASTs (functions based on an evaluation context) *)
-
-module EvalCtxCfimAst = struct end
+module EvalCtxCfimAst = struct
+ let statement_to_string (ctx : C.eval_ctx) (s : A.statement) : string =
+ let fmt = PA.eval_ctx_to_ast_formatter ctx in
+ PA.statement_to_string fmt s
+
+ let expression_to_string (ctx : C.eval_ctx) (e : A.expression) : string =
+ let fmt = PA.eval_ctx_to_ast_formatter ctx in
+ PA.expression_to_string fmt "" " " e
+end