package ocaml-webworker

  1. Overview
  2. Docs
module T = Typedtree
type mapper = {
  1. attribute : mapper -> T.attribute -> Parsetree.attribute;
  2. attributes : mapper -> T.attribute list -> Parsetree.attribute list;
  3. case : mapper -> T.case -> Parsetree.case;
  4. cases : mapper -> T.case list -> Parsetree.case list;
  5. class_declaration : mapper -> T.class_declaration -> Parsetree.class_declaration;
  6. class_description : mapper -> T.class_description -> Parsetree.class_description;
  7. class_expr : mapper -> T.class_expr -> Parsetree.class_expr;
  8. class_field : mapper -> T.class_field -> Parsetree.class_field;
  9. class_signature : mapper -> T.class_signature -> Parsetree.class_signature;
  10. class_structure : mapper -> T.class_structure -> Parsetree.class_structure;
  11. class_type : mapper -> T.class_type -> Parsetree.class_type;
  12. class_type_declaration : mapper -> T.class_type_declaration -> Parsetree.class_type_declaration;
  13. class_type_field : mapper -> T.class_type_field -> Parsetree.class_type_field;
  14. constructor_declaration : mapper -> T.constructor_declaration -> Parsetree.constructor_declaration;
  15. expr : mapper -> T.expression -> Parsetree.expression;
  16. extension_constructor : mapper -> T.extension_constructor -> Parsetree.extension_constructor;
  17. include_declaration : mapper -> T.include_declaration -> Parsetree.include_declaration;
  18. include_description : mapper -> T.include_description -> Parsetree.include_description;
  19. label_declaration : mapper -> T.label_declaration -> Parsetree.label_declaration;
  20. location : mapper -> Location.t -> Location.t;
  21. module_binding : mapper -> T.module_binding -> Parsetree.module_binding;
  22. module_declaration : mapper -> T.module_declaration -> Parsetree.module_declaration;
  23. module_expr : mapper -> T.module_expr -> Parsetree.module_expr;
  24. module_type : mapper -> T.module_type -> Parsetree.module_type;
  25. module_type_declaration : mapper -> T.module_type_declaration -> Parsetree.module_type_declaration;
  26. package_type : mapper -> T.package_type -> Parsetree.package_type;
  27. open_description : mapper -> T.open_description -> Parsetree.open_description;
  28. pat : mapper -> T.pattern -> Parsetree.pattern;
  29. row_field : mapper -> T.row_field -> Parsetree.row_field;
  30. signature : mapper -> T.signature -> Parsetree.signature;
  31. signature_item : mapper -> T.signature_item -> Parsetree.signature_item;
  32. structure : mapper -> T.structure -> Parsetree.structure;
  33. structure_item : mapper -> T.structure_item -> Parsetree.structure_item;
  34. typ : mapper -> T.core_type -> Parsetree.core_type;
  35. type_declaration : mapper -> T.type_declaration -> Parsetree.type_declaration;
  36. type_extension : mapper -> T.type_extension -> Parsetree.type_extension;
  37. type_kind : mapper -> T.type_kind -> Parsetree.type_kind;
  38. value_binding : mapper -> T.value_binding -> Parsetree.value_binding;
  39. value_description : mapper -> T.value_description -> Parsetree.value_description;
  40. with_constraint : mapper -> (Path.t * Longident.t Location.loc * T.with_constraint) -> Parsetree.with_constraint;
}

Utility functions.

val string_is_prefix : string -> string -> bool
val map_opt : ('a -> 'b) -> 'a option -> 'b option
val lident_of_path : Path.t -> Longident.t
val map_loc : mapper -> 'a Asttypes.loc -> 'a Asttypes.loc
val fresh_name : string -> Env.t -> string

Try a name $name$0, check if it's free, if not, increment and repeat.

Mapping functions.

val attribute : mapper -> ('a Asttypes.loc * 'b) -> 'a Asttypes.loc * 'b
val attributes : mapper -> T.attribute list -> Parsetree.attribute list
val structure : mapper -> T.structure -> Parsetree.structure_item list
val type_parameter : mapper -> (T.core_type * 'a) -> Parsetree.core_type * 'a
val type_kind : mapper -> T.type_kind -> Parsetree.type_kind
val pattern : mapper -> T.pattern -> Parsetree.pattern
val cases : mapper -> T.case list -> Parsetree.case list
val case : mapper -> T.case -> Parsetree.case
val signature : mapper -> T.signature -> Parsetree.signature_item list
val include_infos : (mapper -> 'a -> 'b) -> mapper -> 'a T.include_infos -> 'b Parsetree.include_infos
val class_infos : (mapper -> 'a -> 'b) -> mapper -> 'a T.class_infos -> 'b Parsetree.class_infos
val core_type : mapper -> T.core_type -> Parsetree.core_type
val row_field : mapper -> T.row_field -> Parsetree.row_field
val is_self_pat : T.pattern -> bool
val location : 'a -> 'b -> 'b
val default_mapper : mapper
val untype_structure : ?mapper:mapper -> T.structure -> Parsetree.structure
val untype_signature : ?mapper:mapper -> T.signature -> Parsetree.signature
val untype_pattern : T.pattern -> Parsetree.pattern
val untype_expression : T.expression -> Parsetree.expression