Jane_syntax.Labeled_tuplesThe ASTs for labeled tuples. When we merge this upstream, we'll replace existing P{typ,exp,pat}_tuple constructors with these.
type core_type = (string option * Ppxlib_ast.Parsetree.core_type) listtl represents a product type:
T1 * ... * Tn when tl is (None,T1);...;(None,Tn)L1:T1 * ... * Ln:Tn when tl is (Some L1,T1);...;(Some Ln,Tn)L1:T1,T2 when tl is (Some L1,T1);(None,T2)Invariant: n >= 2.
type expression = (string option * Ppxlib_ast.Parsetree.expression) listel represents
(E1, ..., En) when el is (None, E1);...;(None, En)(~L1:E1, ..., ~Ln:En) when el is (Some L1, E1);...;(Some Ln, En)(~L1:E1, E2) when el is (Some L1, E1); (None, E2)Invariant: n >= 2.
type pattern =
(string option * Ppxlib_ast.Parsetree.pattern) list
* Ppxlib_ast.Asttypes.closed_flag(pl, Closed) represents
(P1, ..., Pn) when pl is (None, P1);...;(None, Pn)(L1:P1, ..., Ln:Pn) when pl is (Some L1, P1);...;(Some Ln, Pn)(L1:P1, P2) when pl is (Some L1, P1);(None, P2)..Invariant:
n >= 2.n >= 1.val typ_of : loc:Location.t -> core_type -> Ppxlib_ast.Parsetree.core_typeEmbeds the core type in Jane Syntax only if there are any labels. Otherwise, returns a normal Ptyp_tuple.
val expr_of : loc:Location.t -> expression -> Ppxlib_ast.Parsetree.expressionEmbeds the expression in Jane Syntax only if there are any labels. Otherwise, returns a normal Pexp_tuple.
val pat_of : loc:Location.t -> pattern -> Ppxlib_ast.Parsetree.patternEmbeds the pattern in Jane Syntax only if there are any labels or if the pattern is open. Otherwise, returns a normal Ppat_tuple.