-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pretty printer for better readability for testing (wip)
- Loading branch information
1 parent
7de3431
commit ea0e5c2
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
open Typedtree | ||
module Fmt = Format | ||
|
||
module type PPConfig = sig end | ||
|
||
module MakePP (Config : PPConfig) = struct | ||
let rec pp_expr (fmt : Format.formatter) (e : expr) = | ||
match e with | ||
| EConst (CBool b, _) -> Fmt.pp_print_bool fmt b | ||
| EConst (CInt i, _) -> Fmt.pp_print_int fmt i | ||
| EConst (CString s, _) -> | ||
Fmt.pp_print_string fmt (Printf.sprintf "\"%s\"" s) | ||
| EVar (_, _) -> _ | ||
| ELet (_, _, _, _) -> _ | ||
| ELetrec (_, _, _) -> _ | ||
| ELam _ -> _ | ||
| EIf (_, _, _, _) -> _ | ||
| ECase (_, _, _) -> _ | ||
| EApp (_, _, _) -> _ | ||
| EAnn (_, _) -> _ | ||
| ETuple (_, _) -> _ | ||
| EField (_, _, _) -> _ | ||
| ECons (_, _) -> _ | ||
| EFieldCons (_, _, _) -> _ | ||
end |