From 3e807ae071204ba4904795389a4d861c1b67b81f Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Fri, 26 Jan 2024 17:53:49 +0100 Subject: [PATCH] Remove warnings --- compiler/plugins/explain.ml | 1 + compiler/scalc/to_c.ml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/plugins/explain.ml b/compiler/plugins/explain.ml index 36b9f31a..4ba39acd 100644 --- a/compiler/plugins/explain.ml +++ b/compiler/plugins/explain.ml @@ -1057,6 +1057,7 @@ let expr_to_dot_label0 : | Or -> xlang () ~en:"or" ~fr:"ou" | Xor -> xlang () ~en:"xor" ~fr:"ou bien" | Map -> xlang () ~en:"on_every" ~fr:"pour_chaque" + | Map2 -> xlang () ~en:"on_every_2" ~fr:"pour_chaque_2" | Reduce -> xlang () ~en:"reduce" ~fr:"réunion" | Filter -> xlang () ~en:"filter" ~fr:"filtre" | Fold -> xlang () ~en:"fold" ~fr:"pliage" diff --git a/compiler/scalc/to_c.ml b/compiler/scalc/to_c.ml index a4cdbc28..87f104f1 100644 --- a/compiler/scalc/to_c.ml +++ b/compiler/scalc/to_c.ml @@ -314,7 +314,8 @@ let format_op (fmt : Format.formatter) (op : operator Mark.pos) : unit = | Filter -> Format.pp_print_string fmt "catala_list_filter" | Fold -> Format.pp_print_string fmt "catala_list_fold_left" | HandleDefault -> Format.pp_print_string fmt "catala_handle_default" - | HandleDefaultOpt | FromClosureEnv | ToClosureEnv -> failwith "unimplemented" + | HandleDefaultOpt | FromClosureEnv | ToClosureEnv | Map2 -> + failwith "unimplemented" let _format_string_list (fmt : Format.formatter) (uids : string list) : unit = let sanitize_quotes = Re.compile (Re.char '"') in @@ -407,7 +408,7 @@ let rec format_statement (format_typ ctx (fun fmt -> format_var fmt (Mark.remove v))) ty (* Below we detect array initializations which have special treatment. *) - | SLocalInit { name = v; expr = EStruct { fields; name }, _; typ } + | SLocalInit { name = v; expr = EStruct { fields = _; name }, _; typ } when typ_is_array ctx typ -> Format.fprintf fmt "@[%a;@]@\n@[%a.content_field = malloc(sizeof(%a));@]"