Jane_syntax.Mode_exprMode_expr appears in several places:
global_ x : intNote that in the first two cases, axes other than locality are not specified; in the second case, other axes are defaulted to legacy. In the last case, we are specifying modalities.
In the future the three annotations will be quite different, but for now they are all lists of modes/modalities. Typemode has the three different interpretations of the annotation.
(TODO: in the future we will have mutable(...), which is similar to the second occurrence above and should be covered by this module)
module Const : sig ... endConstant modes
type t = Const.t list Location.locval empty : tThe empty mode expression.
val extract_attr :
Ppxlib_ast.Parsetree.attributes ->
Ppxlib_ast.Parsetree.attribute option * Ppxlib_ast.Parsetree.attributesExtract the mode attribute (if any) from a list of attributes; also returns the rest of the attributes; Raises if multiple relevant attributes are found
val attr_of : t -> Ppxlib_ast.Parsetree.attribute optionEncode a mode expression into a attribute. If the expression is safe to empty (and thus safe to ignore), returns None.
val maybe_of_attrs :
Ppxlib_ast.Parsetree.attributes ->
t option * Ppxlib_ast.Parsetree.attributesGiven a list of attributes, extracts the mode expression and returns the rest of attributes. Raises if multiple relevant attributes are found. Raises if attributes encodes empty mode expression
val of_attrs :
Ppxlib_ast.Parsetree.attributes ->
t * Ppxlib_ast.Parsetree.attributesval payload_of : t -> Ppxlib_ast.Parsetree.payload optionEncodes a mode expression into a payload. If the expression is safe to ignore (i.e. empty), returns None.
val of_payload : loc:Location.t -> Ppxlib_ast.Parsetree.payload -> tDecode a mode expression from a payload whose location is loc. Raises if the payload encodes an empty mode expression.