From 363f5043a0ddf158244e26b0d76de7b76d696c1b Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sat, 10 Dec 2022 20:22:11 +0100 Subject: [PATCH] Add node call support in C --- src/ast_to_c.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ast_to_c.ml b/src/ast_to_c.ml index f9a1a62..ed853cb 100644 --- a/src/ast_to_c.ml +++ b/src/ast_to_c.ml @@ -65,9 +65,11 @@ let pp_expression = let rec pp_expression_list prefix fmt exprs = match exprs with | ETuple([], []) -> () + (* TODO: assignment (in addition to the current app call support) *) | ETuple (_ :: tt, expr :: exprs) -> - Format.fprintf fmt "%a%a" - (pp_expression_aux (prefix^" |> ")) expr + Format.fprintf fmt "%a%s%a" + (pp_expression_aux (prefix)) expr + (if (List.length tt > 0) then ", " else "") (pp_expression_list prefix) (ETuple (tt, exprs)) | _ -> raise (MyTypeError "This exception should not have been raised.") in @@ -142,7 +144,6 @@ let pp_expression = (pp_expression_aux prefix) arg' (pp_expression_aux prefix) arg'' end - (* TODO *) | EApp (_, f, args) -> Format.fprintf fmt "%s%s(%a)" prefix f.n_name @@ -153,7 +154,6 @@ let pp_expression = in pp_expression_aux "" -(* should add a prefix for indentation *) let rec pp_equations fmt: t_eqlist -> unit = function | [] -> () | (patt, expr) :: eqs ->