This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
34
unikernel/duniverse/ppxlib/ast/cinaps/ast_cinaps_helpers.ml
Normal file
34
unikernel/duniverse/ppxlib/ast/cinaps/ast_cinaps_helpers.ml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
(* -*- tuareg -*- *)
|
||||
|
||||
include StdLabels
|
||||
include Printf
|
||||
|
||||
let capitalize_ascii = Stdppx.String.capitalize_ascii
|
||||
|
||||
(* Reexports from [Astlib_cinaps_helpers] *)
|
||||
let nl = Astlib_cinaps_helpers.nl
|
||||
let qualified_types = Astlib_cinaps_helpers.qualified_types
|
||||
let foreach_module = Astlib_cinaps_helpers.foreach_module
|
||||
let foreach_type = Astlib_cinaps_helpers.foreach_type
|
||||
let all_types = List.concat (List.map ~f:snd qualified_types)
|
||||
|
||||
let foreach_version f =
|
||||
nl ();
|
||||
List.iter Supported_version.all ~f:(fun v ->
|
||||
f (Supported_version.to_int v) (Supported_version.to_string v))
|
||||
|
||||
let foreach_version_pair f =
|
||||
nl ();
|
||||
let rec aux = function
|
||||
| x :: (y :: _ as tail) ->
|
||||
f (Supported_version.to_int x) (Supported_version.to_int y);
|
||||
aux tail
|
||||
| [ _ ] | [] -> ()
|
||||
in
|
||||
aux Supported_version.all
|
||||
|
||||
let with_then_and () =
|
||||
let first = ref true in
|
||||
fun oc ->
|
||||
output_string oc (if !first then "with" else " and");
|
||||
first := false
|
||||
Loading…
Add table
Add a link
Reference in a new issue