package ocamlformat
Module Ocamlformat.SugarSource
val or_pat :
?allow_attribute:Ocamlformat_stdlib.bool ->
Cmts.t ->
Extended_ast.pattern Ast.xt ->
Extended_ast.pattern Ast.xt Ocamlformat_stdlib.listor_pat allow_attribute cmts pat returns the list of patterns of a pattern disjunction. allow_attribute is set by default, otherwise patterns with not empty attributes are not processed (i.e. they are returned without modification).
val fun_ :
Cmts.t ->
?will_keep_first_ast_node:Ocamlformat_stdlib.bool ->
Extended_ast.expression Ast.xt ->
arg_kind Ocamlformat_stdlib.list * Extended_ast.expression Ast.xtfun_ cmts will_keep_first_ast_node exp returns the list of arguments and the body of the function exp. will_keep_first_ast_node is set by default, otherwise the exp is returned without modification.
val cl_fun :
?will_keep_first_ast_node:Ocamlformat_stdlib.bool ->
Cmts.t ->
Extended_ast.class_expr Ast.xt ->
arg_kind Ocamlformat_stdlib.list * Extended_ast.class_expr Ast.xtcl_fun will_keep_first_ast_node cmts exp returns the list of arguments and the body of the function exp. will_keep_first_ast_node is set by default, otherwise the exp is returned without modification.
val ite :
Cmts.t ->
Extended_ast.expression Ast.xt ->
(Extended_ast.expression Ast.xt Ocamlformat_stdlib.option
* Extended_ast.expression Ast.xt
* Extended_ast.attributes)
Ocamlformat_stdlib.listite cmts exp returns a list of conditional expressions from cascading if-then-else expressions, e.g.:
if c1 then e1 else if c2 then e2 else e3will return the following list: (Some c1, e1); (Some c2, e2); (None, e3).
val sequence :
Cmts.t ->
Extended_ast.expression Ast.xt ->
(Parser_extended.Asttypes.label Parser_extended.Asttypes.loc
Ocamlformat_stdlib.option
* Extended_ast.expression Ast.xt)
Ocamlformat_stdlib.listsequence cmts exp returns the list of expressions (with the optional extension) from a sequence of expressions exp.
type functor_arg = | Unit| Named of Parser_extended.Asttypes.label Ocamlformat_stdlib.option Parser_extended.Asttypes.loc * Extended_ast.module_type Ast.xt(*Equivalent of the
*)functor_parametertype with a contextualized module type.
val functor_type :
Cmts.t ->
for_functor_kw:Ocamlformat_stdlib.bool ->
source_is_long:(Extended_ast.module_type -> Ocamlformat_stdlib.bool) ->
Extended_ast.module_type Ast.xt ->
functor_arg Parser_extended.Asttypes.loc Ocamlformat_stdlib.list
* Extended_ast.module_type Ast.xtfunctor_type cmts for_functor_kw m returns the list of module types applied to the functor of module type m. for_functor_kw indicates if the keyword functor is used.
val functor_ :
Cmts.t ->
for_functor_kw:Ocamlformat_stdlib.bool ->
source_is_long:(Extended_ast.module_expr -> Ocamlformat_stdlib.bool) ->
Extended_ast.module_expr Ast.xt ->
functor_arg Parser_extended.Asttypes.loc Ocamlformat_stdlib.list
* Extended_ast.module_expr Ast.xtfunctor_ cmts for_functor_kw m returns the list of module types applied to the functor of module m. for_functor_kw indicates if the keyword functor is used.
val mod_with :
Extended_ast.module_type Ast.xt ->
(Extended_ast.with_constraint Ocamlformat_stdlib.list
* Ocaml_common.Warnings.loc
* Extended_ast.attributes)
Ocamlformat_stdlib.list
* Extended_ast.module_type Ast.xtmod_with m returns the list of with type constraints of module type m.