Ocamlformat_lib.AstSourceAbstract syntax tree terms
Initialize internal state
val doc_atrs :
?acc:
(Ocamlformat_stdlib.string Migrate_ast.Location.loc
* Ocamlformat_stdlib.bool)
Ocamlformat_stdlib.list ->
Extended_ast.attributes ->
(Ocamlformat_stdlib.string Migrate_ast.Location.loc * Ocamlformat_stdlib.bool)
Ocamlformat_stdlib.list
Ocamlformat_stdlib.option
* Extended_ast.attributestype cmt_checker = {cmts_before : Migrate_ast.Location.t -> Ocamlformat_stdlib.bool;cmts_within : Migrate_ast.Location.t -> Ocamlformat_stdlib.bool;cmts_after : Migrate_ast.Location.t -> Ocamlformat_stdlib.bool;}type toplevel_item = [ | `Item of Extended_ast.structure_item| `Directive of Extended_ast.toplevel_directive ]type t = | Pld of Extended_ast.payload| Typ of Extended_ast.core_type| Td of Extended_ast.type_declaration| Cty of Extended_ast.class_type| Pat of Extended_ast.pattern| Exp of Extended_ast.expression| Lb of Extended_ast.value_binding| Mb of Extended_ast.module_binding| Md of Extended_ast.module_declaration| Cl of Extended_ast.class_expr| Mty of Extended_ast.module_type| Mod of Extended_ast.module_expr| Sig of Extended_ast.signature_item| Str of Extended_ast.structure_item| Clf of Extended_ast.class_field| Ctf of Extended_ast.class_type_field| Tli of toplevel_item| Top| RepRepl phrase
*)Ast terms of various forms.
val break_between :
Source.t ->
cmt_checker ->
(t * Conf.t) ->
(t * Conf.t) ->
Ocamlformat_stdlib.boolDebug: Dump the representation of an Ast term.
Term-in-context {ctx; ast} records that ast is (considered to be) an immediate sub-term of ctx.
Construct a core_type-in-context.
Construct a type_declaration-in-context.
Construct a class_type-in-context.
Construct a pattern-in-context.
Construct a expression-in-context.
Construct a class_expr-in-context.
Construct a class_field-in-context.
Construct a class_type_field-in-context.
Construct a module_type-in-context.
Construct a module_expr-in-context.
Construct a module_declaration-in-context.
Construct a module_binding-in-context.
Construct a signature_item-in-context.
Construct a structure_item-in-context.
val is_simple :
Conf.t ->
(Extended_ast.expression xt -> Ocamlformat_stdlib.int) ->
Extended_ast.expression xt ->
Ocamlformat_stdlib.boolHolds of "simple" expressions: constants and constructor and function applications of other simple expressions.
'Classes' of expressions which are parenthesized differently.
exposed_right_exp cls exp holds if there is a right-most subexpression of exp which is of class cls and is not parenthesized.
prec_ast ast is the precedence of ast. Meaningful for binary operators, otherwise returns None.
parenze_typ xtyp holds when core_type-in-context xtyp should be parenthesized.
parenze_cty xcty holds when class_type-in-context xcty should be parenthesized.
parenze_cl xcl holds when class-in-context xcl should be parenthesized.
parenze_pat xpat holds when pattern-in-context xpat should be parenthesized.
parenze_exp xexp holds when expression-in-context xexp should be parenthesized.
parenze_nested_exp xexp holds when nested expression-in-context xexp should be parenthesized.
parenze_mty xmty holds when module_type-in-context xmty should be parenthesized.
parenze_mod xmod holds when module_expr-in-context xmod should be parenthesized.