File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,14 @@ let rec format_expression
328328 ~pp_sep: (fun fmt () -> Format. fprintf fmt " ,@ " )
329329 format_expression)
330330 args
331+ | EAppOp { op = ((And | Or ) as op ), _ ; args; _ } ->
332+ Format. fprintf fmt " catala_new_bool(@[<hov 0>%a)@]"
333+ (Format. pp_print_list
334+ ~pp_sep: (fun fmt () ->
335+ Format. fprintf fmt " %s@ "
336+ (match op with And -> " &&" | Or -> " ||" | _ -> assert false ))
337+ (fun fmt e -> Format. fprintf fmt " *(%a)" format_expression e))
338+ args
331339 | EAppOp { op; args; _ } ->
332340 Format. fprintf fmt " %a(@[<hov 0>%a)@]" format_op op
333341 (Format. pp_print_list
Original file line number Diff line number Diff line change @@ -155,6 +155,11 @@ static mpz_t zconst_100;
155155 mpq_ptr X = catala_malloc(sizeof(__mpq_struct)); \
156156 mpq_init(X)
157157
158+ CATALA_BOOL catala_new_bool (const int x )
159+ {
160+ return CATALA_NEW_BOOL (x );
161+ }
162+
158163CATALA_INT catala_new_int (const signed long int val )
159164{
160165 CATALA_NEW_MPZ (ret );
Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ CATALA_BOOL catala_isnone (const CATALA_OPTION() opt);
126126
127127/* --- Constructors --- */
128128
129+ CATALA_BOOL catala_new_bool (const int );
130+
129131CATALA_INT catala_new_int (const signed long int val );
130132
131133/* Arg is a null-terminated string */
You can’t perform that action at this time.
0 commit comments