From bf79e9ab65d913e09ef085d2ae9970e552777ed5 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Tue, 22 Aug 2017 17:46:50 +0100 Subject: Added debugging output for E_record and E_record_update in ast_util --- src/ast_util.ml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ast_util.ml b/src/ast_util.ml index 96823b25..d9977d93 100644 --- a/src/ast_util.ml +++ b/src/ast_util.ml @@ -312,6 +312,10 @@ let rec string_of_exp (E_aux (exp, _)) = | E_throw exp -> "throw " ^ string_of_exp exp | E_cons (x, xs) -> string_of_exp x ^ " :: " ^ string_of_exp xs | E_list xs -> "[||" ^ string_of_list ", " string_of_exp xs ^ "||]" + | E_record_update (exp, FES_aux (FES_Fexps (fexps, _), _)) -> + "{ " ^ string_of_exp exp ^ " with " ^ string_of_list "; " string_of_fexp fexps ^ " }" + | E_record (FES_aux (FES_Fexps (fexps, _), _)) -> + "{ " ^ string_of_list "; " string_of_fexp fexps ^ " }" | E_internal_cast _ -> "INTERNAL CAST" | E_internal_exp _ -> "INTERNAL EXP" | E_sizeof_internal _ -> "INTERNAL SIZEOF" @@ -320,6 +324,8 @@ let rec string_of_exp (E_aux (exp, _)) = | E_comment_struc _ -> "INTERNAL COMMENT STRUC" | E_internal_let _ -> "INTERNAL LET" | _ -> "INTERNAL" +and string_of_fexp (FE_aux (FE_Fexp (field, exp), _)) = + string_of_id field ^ " = " ^ string_of_exp exp and string_of_pexp (Pat_aux (pexp, _)) = match pexp with | Pat_exp (pat, exp) -> string_of_pat pat ^ " -> " ^ string_of_exp exp -- cgit v1.2.3