Revision 217837e2
Added by Pierre-Loïc Garoche over 6 years ago
src/utils/utils.ml | ||
---|---|---|
253 | 253 |
let pp_newline_if_non_empty l = |
254 | 254 |
(fun fmt -> match l with [] -> () | _ -> Format.fprintf fmt "@,") |
255 | 255 |
|
256 |
let rec fprintf_list ~sep:sep f fmt = function |
|
256 |
let fprintf_list ?(eol:('a, formatter, unit) Pervasives.format = "") ~sep:sep f fmt l = |
|
257 |
let rec aux fmt = function |
|
257 | 258 |
| [] -> () |
258 | 259 |
| [e] -> f fmt e |
259 |
| x::r -> Format.fprintf fmt "%a%(%)%a" f x sep (fprintf_list ~sep f) r |
|
260 |
|
|
260 |
| x::r -> Format.fprintf fmt "%a%(%)%a" f x sep aux r |
|
261 |
in |
|
262 |
match l with |
|
263 |
| [] -> () |
|
264 |
| _ -> ( |
|
265 |
aux fmt l; |
|
266 |
Format.fprintf fmt "%(%)" eol |
|
267 |
) |
|
268 |
|
|
261 | 269 |
let pp_list l pp_fun beg_str end_str sep_str = |
262 | 270 |
if (beg_str="\n") then |
263 | 271 |
print_newline () |
Also available in: Unified diff
Unified compilation of lusi and lus files
Different parsers yet but shared process.
In case of lusi input the C backend is bypassed since the .h is generated from the lusic and no C code should be generated since it may overwrite existing manually written code
But