package ocamlformat-mlx-lib

  1. Overview
  2. Docs
OCaml .mlx Code Formatter

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocamlformat-mlx-0.28.1.3.tbz
sha256=fb3af0d7a0b6ced6c9cbd84858e7aa86fe2a4b9f4b8f46080a04bc465b0e6eff
sha512=c0dc6c33aea286fbc007fdf02b09c37b72caf76d12ccf92576a04823cdcacf3044b6deba3372f40a87a0ae6f602da20d5840ebf0f116f4ca346b85c4d540b2f0

doc/ocamlformat-mlx-lib.parser_extended/Ocamlformat_parser_extended/Jsx_helper/index.html

Module Ocamlformat_parser_extended.Jsx_helperSource

Sourceval 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_desc
Sourcetype element = {
  1. tag : string;
  2. tag_loc : Ocamlformat_ocaml_common.Location.t;
  3. props : (Asttypes.arg_label * Parsetree.expression) list;
  4. children_loc : Ocamlformat_ocaml_common.Location.t;
  5. children : Parsetree.expression list;
}

A @JSX application that can be printed with JSX syntax.

Sourceval classify_element : attrs:Parsetree.attribute list -> Parsetree.expression -> (Asttypes.arg_label * Parsetree.expression) list -> element option

Classify 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, 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.