diff options
| author | Alasdair Armstrong | 2017-08-22 17:46:50 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-22 17:46:50 +0100 |
| commit | bf79e9ab65d913e09ef085d2ae9970e552777ed5 (patch) | |
| tree | f6a604db39d415b43bccb86815b84259737a19c2 /src | |
| parent | 0f9ca620299613caf186eabf1e8cb9a83c6e2d0e (diff) | |
Added debugging output for E_record and E_record_update in ast_util
Diffstat (limited to 'src')
| -rw-r--r-- | src/ast_util.ml | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
