From 0207d1f88f5cb529b9d12d25225d4f3df8b743e9 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 4 Oct 2019 15:33:50 -0700 Subject: [PATCH] Add .mli for SAST pretty printer with minimal comments --- src/stages/ast_simplified/PP.mli | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/stages/ast_simplified/PP.mli diff --git a/src/stages/ast_simplified/PP.mli b/src/stages/ast_simplified/PP.mli new file mode 100644 index 000000000..798fe18fa --- /dev/null +++ b/src/stages/ast_simplified/PP.mli @@ -0,0 +1,33 @@ +(** Pretty printer for the Simplified Abstract Syntax Tree *) + +open Types + +val type_expression : Format.formatter -> type_expression -> unit + +val literal : Format.formatter -> literal -> unit + +val expression : Format.formatter -> expression -> unit + +val option_type_name : Format.formatter -> string * type_expression option -> unit + +val assoc_expression : Format.formatter -> (expr * expr) -> unit + +val access : Format.formatter -> access -> unit + +val access_path : Format.formatter -> access_path -> unit + +val type_annotation : Format.formatter -> type_expression option -> unit + +val single_record_patch : Format.formatter -> string * expr -> unit + +val single_tuple_patch : Format.formatter -> int * expr -> unit + +(* Shows the type expected for the matched value *) +val matching_type : Format.formatter -> 'a matching -> unit + +val matching_variant_case_type : Format.formatter -> (string * string) * 'a -> unit + +val declaration : Format.formatter -> declaration -> unit + +(** Pretty print a full program AST *) +val program : Format.formatter -> program -> unit