Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=194614629528fc6351c343c1c105e454996998a3f24a89f9e90e4b36a97d8122
sha512=04123a9b73db8bc90b7f99c7dcdbe180f18a4cba2aba2b72f6528e428e3f8939086161a5c88c3c304d2d908c9fdb625ffcf5b922c3dc515d8aa5671c86a2ecc0
doc/ocamlformat-mlx-lib.parser_extended/Ocamlformat_parser_extended/Jsx_helper/index.html
Module Ocamlformat_parser_extended.Jsx_helperSource
val mkloc :
'a ->
Ocamlformat_ocaml_common.Location.t ->
'a Ocamlformat_ocaml_common.Location.locval mkexp :
loc:(Lexing.position * Lexing.position) ->
Parsetree.expression_desc ->
Parsetree.expressionval mkjsxexp :
loc:(Lexing.position * Lexing.position) ->
Parsetree.expression_desc ->
Parsetree.expressionval equal_longindent :
Ocamlformat_ocaml_common.Longident.t ->
Ocamlformat_ocaml_common.Longident.t ->
boolval make_jsx_element :
raise:(exn -> unit) ->
loc:'a ->
tag:
([ `Module | `Value ]
* (Lexing.position * Lexing.position)
* Ocamlformat_ocaml_common.Longident.t) ->
end_tag:
(([> `Module | `Value ]
* (Lexing.position * 'b)
* Ocamlformat_ocaml_common.Longident.t)
* ('c * Lexing.position))
option ->
props:
((Lexing.position * Lexing.position)
* [< `Prop of string Asttypes.loc * Parsetree.expression
| `Prop_opt of string Asttypes.loc * Parsetree.expression
| `Prop_opt_punned of string Asttypes.loc
| `Prop_punned of string Asttypes.loc ])
list ->
children:Parsetree.expression ->
unit ->
Parsetree.expression_descThe children of a JSX element: a list of children, or a single spread child (`<Foo> ...expr </Foo>`).
type element = {tag : string;tag_loc : Ocamlformat_ocaml_common.Location.t;unit_loc : Ocamlformat_ocaml_common.Location.t;props : (Asttypes.arg_label * Parsetree.expression) list;children_loc : Ocamlformat_ocaml_common.Location.t;children : jsx_children;loc : Ocamlformat_ocaml_common.Location.t;(*Location of the
*)@JSXattribute, which spans the whole element.extra_attrs : Parsetree.attributes;(*Attributes other than
*)@JSXcarried by the application, printed after the element (e.g.(<Foo />) [@mel.as "and"]).
}A @JSX application that can be printed with JSX syntax.
val classify_element :
attrs:Parsetree.attribute list ->
Parsetree.expression ->
(Asttypes.arg_label * Parsetree.expression) list ->
element optionClassify a @JSX application. JSX syntax can only express applications of the exact shape produced by make_jsx_element: an identifier tag applied to one unlabelled () argument, one ~children argument that is a list literal or any other expression (a children spread), and labelled or optional props. Hand-written @JSX applications may have any other shape (see ocaml-mlx/ocamlformat-mlx#12), in which case None is returned and the application must be printed as a regular application.