123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038openBrowse_rawopenStdtypesyntax_info=Query_protocol.Syntax_doc_result.toptionmoduleDoc_website_base=structtypet=Ocaml|Oxcamlendletsyntax_doc_url(doc_website_base:Doc_website_base.t)endpoint=letbase_url=matchdoc_website_basewith|Ocaml->"https://ocaml.org/manual/5.2/"|Oxcaml->"https://oxcaml.org/documentation/"inSome(base_url^endpoint)(** Drop elements from the head of [list] until [f] returns [true]. *)letrecdrop_untillist~f=matchlistwith|[]->[]|hd::rest->(matchfhdwith|true->list|false->drop_untilrest~f)moduleLoc_comparison_result=structtypet=Before|Inside|After|Ghostletis_inside=function|Before|After|Ghost->false|Inside->trueendletget_jkind_abbrev_doc(abbrev:Longident.t)=letopenOption.Infixinletopenstructtypedocpage=Kind_syntax|Unboxed_typesendinlet*description,docpage=matchabbrevwith|Lident"any"->Some("The top of the kind lattice; all types have this kind.",Kind_syntax)|Lident"any_non_null"->Some("A synonym for `any mod non_null`.",Kind_syntax)|Lident"value_or_null"->Some("The kind of ordinary OCaml types, but with the possibility that the \
type contains `null`.",Kind_syntax)|Lident"value"->Some("The kind of ordinary OCaml types",Kind_syntax)|Lident"void"->Some("The layout of types that are represented by 0 bits at runtime; \
these types can contain only 1 value.",Kind_syntax)|Lident"immediate64"->Some("On 64-bit platforms, the kind of types inhabited only by tagged \
integers.",Kind_syntax)|Lident"immediate"->Some("The kind of types inhabited only by tagged integers.",Kind_syntax)|Lident"immediate_or_null"->Some("The kind of types inhabited by tagged integers and the bit pattern \
containing all 0s.",Kind_syntax)|Lident"float64"->Some("The layout of types represented by a 64-bit machine float.",Unboxed_types)|Lident"float32"->Some("The layout of types represented by a 32-bit machine float.",Unboxed_types)|Lident"word"->Some("The layout of types represented by a native-width machine word.",Unboxed_types)|Lident"bits8"->Some("The layout of types represented by an 8-bit machine word.",Unboxed_types)|Lident"bits16"->Some("The layout of types represented by a 16-bit machine word.",Unboxed_types)|Lident"bits32"->Some("The layout of types represented by a 32-bit machine word.",Unboxed_types)|Lident"bits64"->Some("The layout of types represented by a 64-bit machine word.",Unboxed_types)|Lident"vec128"->Some("The layout of types represented by a 128-bit machine vector.",Unboxed_types)|Lident"vec256"->Some("The layout of types represented by a 256-bit machine vector.",Unboxed_types)|Lident"vec512"->Some("The layout of types represented by a 512-bit machine vector.",Unboxed_types)|Lident"immutable_data"->Some("The kind of types that contain no mutable parts and no functions.",Kind_syntax)|Lident"sync_data"->Some("The kind of types that contain no mutable parts (except possibly \
for atomic fields) and no functions.",Kind_syntax)|Lident"mutable_data"->Some("The kind of types that may have mutable parts but contain no \
functions.",Kind_syntax)|_->Noneinletdocpage_str=matchdocpagewith|Kind_syntax->"kinds/syntax/"|Unboxed_types->"unboxed-types/intro/"in(Some{name="Kind abbreviation";description;documentation=syntax_doc_urlOxcamldocpage_str;level=Advanced}:syntax_info)letget_mod_bound_docmod_bound=letopenOption.Infixinletopenstructtypeparse_result=|Axis_pair:'aJkind_axis.Axis.t*'a->parse_result|Everythingendinlet*parsed=matchTypemode.Modifier_axis_pair.of_stringmod_boundwith|exceptionNot_found->(matchmod_boundwith|"everything"->SomeEverything|__->None)|P(axis,bound)->Some(Axis_pair(axis,bound))inlet*description=matchparsedwith|Axis_pair(Modal(Comonadic_),_)->Some(Format.asprintf"Values of types of this kind can cross to `%s` from weaker modes."mod_bound)|Axis_pair(Modal(Monadic_),_)->Some(Format.asprintf"Values of types of this kind can cross from `%s` to stronger modes"mod_bound)|Axis_pair(NonmodalExternality,Internal)->Some"Values of types of this kind might be pointers to the OCaml heap"|Axis_pair(NonmodalExternality,External64)->Some"On 64-bit systems, values of types of this kind are never pointers to \
the OCaml heap"|Axis_pair(NonmodalExternality,External)->Some"Values of types of this kind are never pointers to the OCaml heap"|Everything->Some"Synonym for \"global aliased many contended portable unyielding \
immutable stateless external_\", convenient for describing \
immediates."in(Some{name="Mod-bound";description;documentation=syntax_doc_urlOxcaml"kinds/intro/";level=Advanced}:syntax_info)letget_mode_doc(Atom(axis,mode):Mode.Alloc.atom)=letopenOption.Infixinlet*description=match(axis,mode)with|ComonadicAreality,Local->Some"Values with this mode cannot escape the current region"|ComonadicAreality,Global->Some"Values with this mode can escape any region"|MonadicContention,Contended->Some"The mutable parts of values with this mode cannot be accessed (unless \
they are atomic)"|MonadicContention,Shared->Some"The mutable parts of values with this mode can be read, but not \
written (unless they are atomic)"|MonadicContention,Corrupted->Some"The mutable parts of values with this mode can be written, but not \
read (unless they are atomic)"|MonadicContention,Uncontended->Some"The mutable parts of values with this mode can be fully accessed"|ComonadicPortability,Corruptible->Some"Values with this mode can be written to (but not read from) by other \
threads without causing data races"|ComonadicPortability,Nonportable->Some"Values with this mode cannot be sent to or shared with other threads, \
in order to avoid data races."|ComonadicPortability,Shareable->Some"Values with this mode can be shared with (but not sent to) other \
threads without causing data races"|ComonadicPortability,Portable->Some"Values with this mode can be sent to other threads without causing \
data races"|MonadicUniqueness,Aliased->Some"There may be multiple pointers to values with this mode"|MonadicUniqueness,Unique->Some"It is guaranteed that there is only one pointer to values with this \
mode"|ComonadicLinearity,Once->Some"Functions with this mode can only be called once"|ComonadicLinearity,Many->Some"Functions with this mode can be called any number of times"|ComonadicYielding,Yielding->Some"Functions with this mode can jump to effect handlers"|ComonadicYielding,Unyielding->Some"Functions within this value will never jump to an effect handler"|MonadicVisibility,Immutable->Some"The mutable parts of values with this mode cannot be accessed"|MonadicVisibility,Read->Some"The mutable parts of values with this mode can be read, but not \
written"|MonadicVisibility,Write->Some"The mutable parts of values with this mode can be written, but not \
read"|MonadicVisibility,Read_write->Some"The mutable parts of values with this mode can be fully accessed"|ComonadicStatefulness,Stateful->Some"Functions with this mode can read and write mutable data"|ComonadicStatefulness,Reading->Some"Functions with this mode can read but not write mutable data"|ComonadicStatefulness,Stateless->Some"Functions with this mode cannot access mutable data"|ComonadicStatefulness,Writing->Some"Functions with this mode can write but not read mutable data"|ComonadicForkable,Forkable->Some"Functions with this mode may be executed concurrently."|ComonadicForkable,Unforkable->Some"Functions with this mode cannot be executed concurrently."|MonadicStaticity,Static->Some"The value is known at compile-time."|MonadicStaticity,Dynamic->Some"The value is not known at compile-time."inletdoc_url=letsubpage=matchaxiswith|ComonadicAreality->"stack-allocation/intro/"|MonadicContention->"parallelism/01-intro/"|ComonadicPortability->"parallelism/01-intro/"|MonadicUniqueness->"uniqueness/intro/"|ComonadicLinearity->"uniqueness/intro/"|ComonadicYielding->"modes/intro/"|MonadicVisibility->"modes/intro/"|ComonadicStatefulness->"modes/intro/"|ComonadicForkable->"modes/intro/"|MonadicStaticity->"modes/intro/"insyntax_doc_urlOxcamlsubpagein(Some{name="Mode";description;documentation=doc_url;level=Advanced}:syntax_info)letget_modality_doc(Atom(axis,modality):Mode.Modality.atom)=letdescription=(* CR-someday: Detect the context that the modality is within to make this message
more detailed. Ex: "This field is always stronger than _, even if the record has a
weaker mode." *)matchaxiswith|Comonadic_->Format_doc.asprintf"The annotated value's mode is always at least as strong as `%a`, even \
if its container's mode is weaker."(Mode.Modality.Per_axis.printaxis)modality|Monadic_->Format_doc.asprintf"The annotated value's mode is always at least as weak as `%a`, even \
if its container's mode is a stronger."(Mode.Modality.Per_axis.printaxis)modalityin(Some{name="Modality";description;documentation=syntax_doc_urlOxcaml"modes/syntax/";level=Advanced}:syntax_info)letget_scannable_axis_annotation_docannot=letopenOption.Infixinlet*description=matchannotwith|"non_pointer"->Some"Values of types of this kind are never pointers."|"non_pointer64"->Some"Values of types of this kind are never pointers on 64-bit platforms."|"non_float"->Some"Values of types of this kind are never pointers to floats."|"separable"->Some"No type of this kind includes both pointers to a float and other \
values."|"maybe_separable"->Some"Types of this kind may mix pointers to floats with other values."|"non_null"->Some"Values of types of this kind are never the bit pattern containing all \
0s."|"maybe_null"->Some"Values of types of this kind might be the bit pattern containing all \
0s."|_->Nonein(Some{name="Kind Modifier";description;documentation=syntax_doc_urlOxcaml"kinds/syntax/";level=Advanced}:syntax_info)letget_oxcaml_syntax_doccursor_locnodes:syntax_info=(* Merlin-jst specific: This function gets documentation for oxcaml language
extensions. *)letcompare_cursor_to_loc(loc:Location.t):Loc_comparison_result.t=matchloc.loc_ghostwith|true->Ghost|false->(matchLocation_aux.compare_poscursor_loclocwith|nwhenn<0->Before|nwhenn>0->After|_->Inside)inletnodes=List.mapnodes~f:sndinletnodes=(* Sometimes the bottom node of [nodes] doesn't include the location of the cursor.
This seems to be because Merlin will find the bottom-most node that contains the
cursor, but then select a child of that node via some heuristics. This is in order
to try to find a node with the environment the user most likely wanted if they,
say, have their cursor on a keyword that isn't represented by a node type in
[Browse_raw.t] (see docstring on [Mtyper.node_at] for more info). But here we
actually want the cursor to be included within all the nodes in [nodes] so that we
can more easily reason about [nodes]. So we drop nodes from the head of [nodes]
until we reach one that includes the cursor. *)drop_untilnodes~f:(funnode->letloc=Browse_raw.node_merlin_locLocation.nonenodeinLoc_comparison_result.is_inside(compare_cursor_to_locloc))inletstack_allocation_url=syntax_doc_urlOxcaml"stack-allocation/reference/"inletget_doc_for_attribute(attribute:Parsetree.attribute):syntax_info=letbuiltin_attrs_doc_url=syntax_doc_urlOcaml"attributes.html#ss:builtin-attributes"in(* See below usage of this function for explanation of why this isn't part of the
other big match statement. *)matchattributewith(* Zero-alloc annotations *)|{attr_name={txt="zero_alloc";_};attr_payload;_}->(letdoc_url=syntax_doc_urlOxcaml"miscellaneous-extensions/zero_alloc_check/"inmatchattr_payloadwith|PStr[]->Some{name="Zero-alloc annotation";description="This function does not allocate on the OCaml heap on executions \
that return normally. The function may allocate if it raises an \
exception.";documentation=doc_url;level=Advanced}|PStr[{pstr_desc=Pstr_eval({pexp_desc=(Pexp_ident{txt=Lidentzero_alloc_flag_name;_}|Pexp_apply({pexp_desc=Pexp_ident{txt=Lidentzero_alloc_flag_name;_};_},_));_},_);_}]->(matchzero_alloc_flag_namewith|"opt"->Some{name="Zero-alloc opt annotation";description="Same as [@zero_alloc], but checks during optimized builds \
only.";documentation=doc_url;level=Advanced}|"assume"->Some{name="Zero-alloc assume annotation";description="This function is assumed to be zero-alloc, but the compiler \
does not guarantee it.";documentation=doc_url;level=Advanced}|"assume_unless_opt"->Some{name="Zero-alloc assume_unless_opt annotation";description="Same as [@zero_alloc opt] in optimized builds. Same as \
[@zero_alloc assume] in non-optimized builds.";documentation=doc_url;level=Advanced}|"strict"->Some{name="Zero-alloc strict annotation";description="This function does not allocate on the OCaml heap (both \
normal and exceptional returns).";documentation=doc_url;level=Advanced}|"arity"->Some{name="Zero-alloc arity annotation";description="The function does not allocate when applied to [n] arguments. \
This can be used to override the arity inferred based on the \
number of arrows in the type.";documentation=doc_url;level=Advanced}|_->None)|_->Some{name="Unrecognized zero-alloc annotation";description="This is an unrecognized zero-alloc annotation.";documentation=doc_url;level=Advanced})|{attr_name={txt="noalloc";_};_}->Some{name="Noalloc annotation";description="This external does not allocate, does not raise exceptions, and \
does not release the domain lock. The compiler will optimize uses \
to a direct C call.";documentation=syntax_doc_urlOcaml"intfc.html#ss:c-direct-call";level=Advanced}(* Inlining annotations *)|{attr_name={txt="inline";_};attr_payload;_}->(letinline_always_annot:syntax_info=Some{name="Inline always annotation";description="On a function declaration, causes the function to be inlined at \
all known call sites (can be overridden by [@inlined]). In \
addition it will be made available for inlining in other source \
files (with appropriate build settings permitting .cmx file \
visibility)";documentation=builtin_attrs_doc_url;level=Advanced}inmatchattr_payloadwith|PStr[]->inline_always_annot|PStr[{pstr_desc=Pstr_eval({pexp_desc=Pexp_ident{txt=Lidentinline_flag_name;_};_},_);_}]->(matchinline_flag_namewith|"always"->inline_always_annot|"never"->Some{name="Inline never annotation";description="This function will not be inlined. In this file (only), this \
can be overridden at call sites with [@inlined].";documentation=builtin_attrs_doc_url;level=Advanced}|"available"->Some{name="Inline available annotation";description="Causes the function to be available for inlining in other \
source files, but does not affect actual inlining decisions. \
Can be used to ensure cross-source-file inlining even in \
cases where it would normally be unavailable e.g. a very \
large function";documentation=None;level=Advanced}|_->None)|_->Some{name="Unrecognized inline annotation";description="Unrecognized inline annoation";documentation=builtin_attrs_doc_url;level=Advanced})|{attr_name={txt="inlined";_};attr_payload;_}->(letinlined_always_annot:syntax_info=Some{name="Inlined always annotation";description="If possible, this function call will be inlined. The function \
must be known to the optimizer (i.e. not an indirect call; and \
if in another source file, the .cmx for that file must be \
available and the function available for inlining e.g. by \
[@inline always] or [@inline available] or the decision of the \
optimizer). This attribute can override [@inline never] but \
only within the same source file.";documentation=builtin_attrs_doc_url;level=Advanced}inmatchattr_payloadwith|PStr[]->inlined_always_annot|PStr[{pstr_desc=Pstr_eval({pexp_desc=Pexp_ident{txt=Lidentinline_flag_name;_};_},_);_}]->(matchinline_flag_namewith|"always"->inlined_always_annot|"never"->Some{name="Inlined never annotation";description="This function call will not be inlined, overriding any \
attribute on the function's declaration.";documentation=builtin_attrs_doc_url;level=Advanced}|"hint"->Some{name="Inlined hint annotation";description="If possible, this function call will be inlined, like \
[@inlined always]. However, no warning is emitted when \
inlining is not possible.";documentation=None;level=Advanced}|_->None)|_->Some{name="Unrecognized inlined annotation";description="Unrecognized inlined annotation";documentation=builtin_attrs_doc_url;level=Advanced})|{attr_name={txt="loop";_};attr_payload;_}->(letloop_always_desc:syntax_info=Some{name="Loop always annotation";description="Forces the self-tail-recursive call sites, if any, in the given \
function to be converted into a loop. If those are the only \
uses of the recursively-defined function variable, no closure \
will be generated, and the function can then be inlined as a \
loop. This transformation is not yet supported for \
mutually-recursive functions.";documentation=None;level=Advanced}inmatchattr_payloadwith|PStr[]->loop_always_desc|PStr[{pstr_desc=Pstr_eval({pexp_desc=Pexp_ident{txt=Lidentloop_flag_name;_};_},_);_}]->(matchloop_flag_namewith|"always"->loop_always_desc|"never"->Some{name="Loop never annotation";description="Prevents the given function from being turned into a loop.";documentation=None;level=Advanced}|_->None)|_->Some{name="Unrecognized loop annotation";description="Unrecognized loop annotation";documentation=None;level=Advanced})|{attr_name={txt="unrolled";_};_}->Some{name="unrolled annotation";description="On a recursive function's call site, causes the function body to \
be unrolled this many times. At present this is not supported if \
the function was loopified (use [@loop never] to disable). If in \
another source file, the function must be available for inlining \
e.g. by [@inline available] with the .cmx file available.";documentation=builtin_attrs_doc_url;level=Advanced}(* Misc *)|{attr_name={txt="nontail";_};_}->Some{name="nontail annotation";description="This function call will be called normally (with a fresh stack \
frame), despite appearing in tail position";documentation=stack_allocation_url;level=Advanced}|_->Noneinmatchnodeswith(* Modes and modalities *)|Mode{txt=mode;_}::_->get_mode_docmode|Modality{txt=modality;_}::ancestors->(matchancestorswith|Jkind_annotation_::_->(* CR-someday: Provide separate documatation for modalities within a jkind *)get_modality_docmodality|_->get_modality_docmodality)(* Jkinds *)|Mod_bound{txt=Modemod_bound;_}::_->get_mod_bound_docmod_bound|Scannable_axis_annotation{txt=annot;_}::_->get_scannable_axis_annotation_docannot|Jkind_annotation{pjka_desc=Pjk_abbreviation(abbrev,_);_}::_->(* CR-someday: It isn't ideal that this is based on the parsetree, as this will result
in an incorrect hint in the presence of shadowing. To properly fix, the compiler
should introduce a typed jkind into the typedtree. Internal ticket 6600. *)get_jkind_abbrev_docabbrev.txt|Jkind_annotation{pjka_desc=Pjk_mod_;_}::_->Some{name="`mod` keyword (in a kind)";description="Types of this kind will cross the following modes";documentation=syntax_doc_urlOxcaml"kinds/intro/";level=Advanced}|Jkind_annotation{pjka_desc=Pjk_with(_,with_type,_);_}::_->(matchcompare_cursor_to_locwith_type.ptyp_locwith|Before->Some{name="`with` keyword (in a kind)";description="Mark a type as structurally included within another; if the \
with-type does not cross a certain mode, neither does its \
containing type";documentation=syntax_doc_urlOxcaml"kinds/intro/";level=Advanced}|Inside->Some{name="with-type";description="Mark a type as structurally included within another; if the \
with-type does not cross a certain mode, neither does its \
containing type";documentation=syntax_doc_urlOxcaml"kinds/intro/";level=Advanced}|After->Some{name="`@@` keyword (in a kind)";description="Mark a type as included under a modality";documentation=syntax_doc_urlOxcaml"kinds/intro/";level=Advanced}|Ghost->None)(* Module Strengthening *)|Module_type{mty_desc=Tmty_strengthen(_,_,mod_ident);_}::_->((* Due to a current bug, there is no node for the module name after the `with`, so
it's possible the cursor is on that instead of the `with`. *)matchcompare_cursor_to_locmod_ident.locwith|Before->Some{name="Module strengthening";description="Mark each type in this module type as equal to the corresponding \
type in the given module";documentation=syntax_doc_urlOxcaml"miscellaneous-extensions/module-strengthening/";level=Advanced}|Inside|After|Ghost->None)(* Local allocations *)|Expression{exp_desc=Texp_exclave_;_}::_->Some{name="exclave_";description="End the current region; the following code allocates in the outer \
region";documentation=stack_allocation_url;level=Advanced}|Expression{exp_extra;exp_loc;_}::_whenList.existsexp_extra~f:(fun(extra,_,_)->matchextrawith|Typedtree.Texp_stack->true|_->false)&&(* In this case, [exp_loc] differs from the location returned by
[Browse_raw.node_merlin_loc] (which is whats used to determine [nodes]).
The [Browse_raw.node_merlin_loc] one includes the stack_, whereas [exp_loc]
doesn't. Since we already know that the cursor is in the
[Browse_raw.node_merlin_loc] location (see the usage of [drop_until]
above), we just need to check whether its in [exp_loc] to know whether it's
on the [stack_] keyword. *)not(Loc_comparison_result.is_inside(compare_cursor_to_locexp_loc))->Some{name="stack_";description="Force the following allocation to be on stack.";documentation=stack_allocation_url;level=Advanced}(* Include functor *)|(Include_description{incl_kind=Tincl_functor_|Tincl_gen_functor_;_}|Include_declaration{incl_kind=Tincl_functor_|Tincl_gen_functor_;_})::_->Some{name="include functor";description="Apply the functor to the current structure up to this point, and \
include the result in the current structure";documentation=syntax_doc_urlOxcaml"miscellaneous-extensions/include-functor/";level=Advanced}|nodes->(* The locations of attributes nodes only include the attribute name, not the payload.
Additionally, the attribute node is not a parent of the payload node. But the
attribute node will be a sibling of the payload. (Note that the bottom node might
not be the payload but a node within the payload). So here we walk up the list of
ancestors until we find one with an attribute as a child whose location includes
the cursor position, at which point we can conclude the cursor is in the payload. *)List.find_map_optnodes~f:(funancestor->letchildren=Browse_raw.fold_node(fun_childacc->child::acc)Env.emptyancestor[]inList.find_map_optchildren~f:(funchild->matchchildwith|Attributeattribute->(matchcompare_cursor_to_locattribute.attr_locwith|Inside->get_doc_for_attributeattribute|Before|After|Ghost->None)|_->None))letget_syntax_doccursor_locnode:syntax_info=letsyntax_doc_url=syntax_doc_urlOcamlinmatchnodewith|(_,Type_kind_)::(_,Type_declaration_)::(_,With_constraint(Twith_typesubst_))::_->Some{name="Destructive substitution";description="Behaves like normal signature constraints but removes the redefined \
type or module from the signature.";documentation=syntax_doc_url"signaturesubstitution.html#ss:destructive-substitution";level=Simple}|(_,Type_kind_)::(_,Type_declaration_)::(_,Signature_item({sig_desc=Tsig_typesubst_;_},_))::_->Some{name="Local substitution";description="Behaves like destructive substitution but is introduced during the \
specification of the signature, and will apply to all the items \
that follow.";documentation=syntax_doc_url"signaturesubstitution.html#ss:local-substitution";level=Simple}|(_,Module_type_)::(_,Module_type_)::(_,Module_type_constraint(Tmodtype_explicit({mty_desc=Tmty_with(_,[(_,_,Twith_modtype_)]);_},_)))::_->Some{name="Module substitution";description="Behaves like type substitutions but are useful to refine an \
abstract module type in a signature into a concrete module type,";documentation=syntax_doc_url"signaturesubstitution.html#ss:module-type-substitution";level=Simple}|(_,Type_kindTtype_open)::(_,Type_declaration{typ_private;_})::_->lete_name="Extensible Variant Type"inlete_description="Can be extended with new variant constructors using `+=`."inlete_url="extensiblevariants.html"inletname,description,url=matchtyp_privatewith|Public->(e_name,e_description,e_url)|Private->(Format.sprintf"Private %s"e_name,Format.sprintf"%s. Prevents new constructors from being declared directly, but \
allows extension constructors to be referred to in interfaces."e_description,"extensiblevariants.html#ss:private-extensible")inSome{name;description;documentation=syntax_doc_urlurl;level=Advanced}|(_,Constructor_declaration_)::(_,Type_kind(Ttype_variant_))::(_,Type_declaration{typ_private;_})::_|_::(_,Constructor_declaration_)::(_,Type_kind(Ttype_variant_))::(_,Type_declaration{typ_private;_})::_->letv_name="Variant Type"inletv_description="Represent's data that may take on multiple different forms."inletv_url="typedecl.html#ss:typedefs"inletname,description,url=matchtyp_privatewith|Public->(v_name,v_description,v_url)|Private->(Format.sprintf"Private %s"v_name,Format.sprintf"%s This type is private, values cannot be constructed directly \
but can be de-structured as usual."v_description,"privatetypes.html#ss:private-types-variant")inSome{name;description;documentation=syntax_doc_urlurl;level=Simple}|(_,Core_type_)::(_,Core_type_)::(_,Label_declaration_)::(_,Type_kind(Ttype_record_))::(_,Type_declaration{typ_private;_})::_->letr_name="Record Type"inletr_description="Defines variants with a fixed set of fields"inletr_url="typedecl.html#ss:typedefs"inletname,description,url=matchtyp_privatewith|Public->(r_name,r_description,r_url)|Private->(Format.sprintf"Private %s"r_name,Format.sprintf"%s This type is private, values cannot be constructed directly \
but can be de-structured as usual."r_description,"privatetypes.html#ss:private-types-variant")inSome{name;description;documentation=syntax_doc_urlurl;level=Simple}|(_,Type_kind(Ttype_variant_))::(_,Type_declaration{typ_private=Public;_})::_->Some{name="Empty Variant Type";description="An empty variant type.";documentation=syntax_doc_url"emptyvariants.html";level=Advanced}|(_,Type_kindTtype_abstract)::(_,Type_declaration{typ_private=Public;typ_manifest=None;_})::_->Some{name="Abstract Type";description="Define variants with arbitrary data structures, including other \
variants, records, and functions";documentation=syntax_doc_url"typedecl.html#ss:typedefs";level=Simple}|(_,Type_kindTtype_abstract)::(_,Type_declaration{typ_private=Private;_})::_->Some{name="Private Type Abbreviation";description="Declares a type that is distinct from its implementation type \
`typexpr`.";documentation=syntax_doc_url"privatetypes.html#ss:private-types-abbrev";level=Simple}|(_,Expression_)::(_,Expression_)::(_,Value_binding_)::(_,Structure_item({str_desc=Tstr_value(Recursive,_);_},_))::_->Some{name="Recursive value definition";description="Supports a certain class of recursive definitions of non-functional \
values.";documentation=syntax_doc_url"letrecvalues.html";level=Simple}|(_,Module_expr_)::(_,Module_type{mty_desc=Tmty_typeof_;_})::_->Some{name="Recovering module type";description="Expands to the module type (signature or functor type) inferred for \
the module expression `module-expr`. ";documentation=syntax_doc_url"moduletypeof.html";level=Simple}|(_,Module_expr_)::(_,Module_expr_)::(_,Module_binding_)::(_,Structure_item({str_desc=Tstr_recmodule_;_},_))::_->Some{name="Recursive module";description="A simultaneous definition of modules that can refer recursively to \
each others.";documentation=syntax_doc_url"recursivemodules.html";level=Simple}|(_,Expression_)::(_,Expression_)::(_,Expression_)::(_,Value_binding{vb_expr={exp_extra=[(Texp_newtype(_,loc,_,_),_,_)];exp_loc;_};_})::_->(letin_range=cursor_loc.Lexing.pos_cnum-1>exp_loc.loc_start.pos_cnum&&cursor_loc.Lexing.pos_cnum<=loc.loc.loc_end.pos_cnum+1inmatchin_rangewith|true->Some{name="Locally Abstract Type";description="Type constructor which is considered abstract in the scope of the \
sub-expression and replaced by a fresh type variable.";documentation=syntax_doc_url"locallyabstract.html";level=Simple}|false->None)|(_,Module_expr_)::(_,Module_expr_)::(_,Expression{exp_desc=Texp_pack_;_})::_->Some{name="First class module";description="Converts a module (structure or functor) to a value of the core \
language that encapsulates the module.";documentation=syntax_doc_url"firstclassmodules.html";level=Simple}|_->get_oxcaml_syntax_doccursor_locnode