Module Ocaml_parsing.Ast_helperSource

Helpers to produce Parsetree fragments

Warning This module is unstable and part of compiler-libs.

Sourcetype 'a with_loc = 'a Location.loc
Sourcetype loc = Location.t
Sourcetype str = string with_loc
Sourcetype str_opt = string option with_loc
Sourcetype attrs = Parsetree.attribute list
Sourceval const_string : string -> Parsetree.constant

Default locations

Sourceval default_loc : loc ref

Default value for all optional location arguments.

Sourceval with_default_loc : loc -> (unit -> 'a) -> 'a

Set the default_loc within the scope of the execution of the provided function.

Constants

Sourcemodule Const : sig ... end
Sourcemodule Attr : sig ... end

Core language

Sourcemodule Typ : sig ... end

Type expressions

Sourcemodule Pat : sig ... end

Patterns

Sourcemodule Exp : sig ... end

Expressions

Sourcemodule Val : sig ... end

Value declarations

Sourcemodule Type : sig ... end

Type declarations

Sourcemodule Te : sig ... end

Type extensions

Module language

Sourcemodule Mty : sig ... end

Module type expressions

Sourcemodule Mod : sig ... end

Module expressions

Sourcemodule Sig : sig ... end

Signature items

Sourcemodule Str : sig ... end

Structure items

Sourcemodule Md : sig ... end

Module declarations

Sourcemodule Ms : sig ... end

Module substitutions

Sourcemodule Mtd : sig ... end

Module type declarations

Sourcemodule Mb : sig ... end

Module bindings

Sourcemodule Opn : sig ... end

Opens

Sourcemodule Incl : sig ... end

Includes

Sourcemodule Vb : sig ... end

Value bindings

Class language

Sourcemodule Cty : sig ... end

Class type expressions

Sourcemodule Ctf : sig ... end

Class type fields

Sourcemodule Cl : sig ... end

Class expressions

Sourcemodule Cf : sig ... end

Class fields

Sourcemodule Ci : sig ... end

Classes

Sourcemodule Csig : sig ... end

Class signatures

Sourcemodule Cstr : sig ... end

Class structures

Sourcemodule Rf : sig ... end

Row fields

Sourcemodule Of : sig ... end

Object fields

merlin: refactored out of Parser

Sourcetype let_binding = {
  1. lb_pattern : Parsetree.pattern;
  2. lb_expression : Parsetree.expression;
  3. lb_constraint : Parsetree.value_constraint option;
  4. lb_is_pun : bool;
  5. lb_attributes : Parsetree.attributes;
  6. lb_docs : Docstrings.docs Lazy.t;
  7. lb_text : Docstrings.text Lazy.t;
  8. lb_loc : Location.t;
}
Sourcetype let_bindings = {
  1. lbs_bindings : let_binding list;
  2. lbs_rec : Asttypes.rec_flag;
  3. lbs_extension : string Asttypes.loc option;
}
Sourceval extract_str_payload : Parsetree.payload -> (string * Location.t) option
Sourceval hole_txt : string