Module C_sharp_strange_lib.Prettyprinter

Copyright 2026, Dmitrii Kuznetsov

SPDX-License-Identifier: LGPL-3.0-or-later

val pp_list : (Stdlib.Format.formatter -> 'a -> unit) -> string -> Stdlib.Format.formatter -> 'a list -> unit

pp_list pp sep fmt lst prints a list lst, using pp to print elements and sep as separator between them

val pp_option : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a option -> unit

pp_option pp fmt opt prints an optional value opt, using pp to print the value if it exists

val pp_ident : Stdlib.Format.formatter -> Ast.ident -> unit

pp_ident fmt id prints an identifier

val pp_base_type : Stdlib.Format.formatter -> Ast.base_type -> unit

pp_base_type fmt bt prints a base type (int, char, bool, string)

val pp_type : Stdlib.Format.formatter -> Ast._type -> unit

pp_type fmt t prints a type (base type or void)

val pp_var_type : Stdlib.Format.formatter -> Ast.var_type -> unit

pp_var_type fmt vt prints a variable type

val pp_modifier : Stdlib.Format.formatter -> Ast.modifier -> unit

pp_modifier fmt m prints a modifier (public, static, async)

val pp_var_decl : Stdlib.Format.formatter -> Ast.var_decl -> unit

pp_var_decl fmt vd prints a variable declaration

val pp_bin_op : Stdlib.Format.formatter -> Ast.bin_op -> unit

pp_bin_op fmt op prints a binary operator

val pp_un_op : Stdlib.Format.formatter -> Ast.un_op -> unit

pp_un_op fmt op prints a unary operator

val pp_val_type : Stdlib.Format.formatter -> Ast.val_type -> unit

pp_val_type fmt v prints a literal value (number, character, null, bool, string)

val pp_expr : Stdlib.Format.formatter -> Ast.expr -> unit

pp_expr fmt e prints an expression

val pp_stmt : Stdlib.Format.formatter -> Ast.stmt -> unit

pp_stmt fmt s prints a statement

val pp_sblock : Stdlib.Format.formatter -> Ast.stmt list -> unit

pp_sblock fmt stmts prints a block of statements

val pp_field : Stdlib.Format.formatter -> Ast.field -> unit

pp_field fmt f prints a class field (variable or method)

val pp_c_sharp_class : Stdlib.Format.formatter -> Ast.c_sharp_class -> unit

pp_c_sharp_class fmt cls prints a class definition

val pp_prog : Stdlib.Format.formatter -> Ast.program -> unit

pp_prog fmt prog prints a program (class)