Module Cpp.Printing

Pretty-printing of the C++ type

val trailing_space : 'a Fmt.t -> 'a0 Fmt.t
val pp_identifier : Stdlib.Format.formatter -> string -> unit
val pp_type_ : type_ Fmt.t
val pp_requires : default:bool -> Stdlib.Format.formatter -> ([< `Exact of string | `OneOf of string list ] * type_) list -> unit
val pp_template : default:bool -> Stdlib.Format.formatter -> template_parameter list -> unit

Pretty print a list of templates as template <parameter-list>.name This function pools together RequireAllCondition nodes into a require_all_t

val pp_operator : Stdlib.Format.formatter -> operator -> unit
val pp_expr : expr Fmt.t
val pp_variable_defn : Stdlib.Format.formatter -> variable_defn -> unit
val pp_stmt : stmt Fmt.t
val pp_with_block : ?indent:int -> unit Fmt.t -> Stdlib.Format.formatter -> stmt -> unit

When we know a block is here, we can do better pretty-printing

  • parameter indent:

    How much to indent the enclosing vbox. Usually 2, but set to zero for the else branch of an if-else to prevent over-indenting

val pp_cv : Stdlib.Format.formatter -> cv_qualifiers -> unit
val pp_fun_defn : Stdlib.Format.formatter -> fun_defn -> unit
val pp_destructor : Stdlib.Format.formatter -> (string * stmt list) -> unit
val pp_constructor : Stdlib.Format.formatter -> (string * constructor) -> unit
val pp_directive : Stdlib.Format.formatter -> directive -> unit
val pp_class_defn : Stdlib.Format.formatter -> class_defn -> unit
val pp_struct_defn : Stdlib.Format.formatter -> struct_defn -> unit
val pp_defn : defn Fmt.t
val pp_program : defn list Fmt.t