Ocaml_parsing.Language_extensionLanguage extensions provided by the Jane Street version of the OCaml compiler.
A setting for extensions that track multiple maturity levels
module Maturity : sig ... endtype 'a t = 'a Ocaml_utils.Language_extension_kernel.t = | Comprehensions : unit t| Mode : maturity t| Unique : maturity t| Overwriting : unit t| Include_functor : unit t| Polymorphic_parameters : unit t| Immutable_arrays : unit t| Module_strengthening : unit t| Layouts : maturity t| SIMD : maturity t| Labeled_tuples : unit t| Small_numbers : maturity t| Instances : unit t| Separability : unit t| Let_mutable : unit t| Layout_poly : maturity t| Runtime_metaprogramming : unit tThe type of language extensions. An 'a t is an extension that can either be off or be set to have any value in 'a, so a unit t can be either on or off, while a maturity t can have different maturity settings.
val assert_enabled : loc:Location.t -> 'a t -> 'a -> unitRequire that an extension is enabled for at least the provided level, or else throw an exception at the provided location saying otherwise.
val maturity_of_unique_for_drf : maturityval maturity_of_unique_for_destruction : maturitymodule Exist : sig ... endExistentially packed language extension
module Universe : sig ... endThe type of language extension universes. Each universe allows a set of extensions, and every successive universe includes the previous one.
val is_erasable : 'a t -> boolCheck if a language extension is "erasable", i.e. whether it can be harmlessly translated to attributes and compiled with the upstream compiler.
val to_string : 'a t -> stringPrint and parse language extensions; parsing is case-insensitive
val to_command_line_string : 'a t -> 'a -> stringval of_string : string -> Exist.t optionval maturity_to_string : maturity -> stringval get_command_line_string_if_enabled : 'a t -> string optionGet the command line string enabling the given extension, if it's enabled; otherwise None
Enable and disable according to command-line strings; these raise an exception if the input string is invalid.
val set : unit t -> enabled:bool -> unitEnable and disable language extensions; these operations are idempotent
val enable : 'a t -> 'a -> unitval disable : 'a t -> unitval is_enabled : 'a t -> boolCheck if a language extension is currently enabled (at any maturity level)
val is_at_least : 'a t -> 'a -> boolCheck if a language extension is enabled at least at the given level
val with_set : unit t -> enabled:bool -> (unit -> unit) -> unitTooling support: Temporarily enable and disable language extensions; these operations are idempotent. Calls to set, enable, disable inside the body of the function argument will also be rolled back when the function finishes, but this behavior may change; nest multiple with_* functions instead.
val with_enabled : 'a t -> 'a -> (unit -> unit) -> unitval with_disabled : 'a t -> (unit -> unit) -> unitCheck if the allowable extensions are restricted to only those that are "erasable". This is true when the universe is set to No_extensions or Upstream_compatible.
val set_universe_and_enable_all : Universe.t -> unitSet the extension universe and enable all allowed extensions.