Module Melange_compiler_libs.Outcometree

type out_name = {
  1. mutable printed_name: string,
};

An out_name is a string representation of an identifier which can be rewritten on the fly to avoid name collisions

type out_ident =
  1. | Oide_apply(out_ident, out_ident)
  2. | Oide_dot(out_ident, string)
  3. | Oide_ident(out_name)
;
type out_string =
  1. | Ostr_string
  2. | Ostr_bytes
;
type out_attribute = {
  1. oattr_name: string,
};
type out_value =
  1. | Oval_array(list(out_value))
  2. | Oval_char(char)
  3. | Oval_constr(out_ident, list(out_value))
  4. | Oval_ellipsis
  5. | Oval_float(float)
  6. | Oval_int(int)
  7. | Oval_int32(int32)
  8. | Oval_int64(int64)
  9. | Oval_nativeint(nativeint)
  10. | Oval_list(list(out_value))
  11. | Oval_printer(Stdlib.Format.formatter => unit)
  12. | Oval_record(list((out_ident, out_value)))
  13. | Oval_string(string, int, out_string)
  14. | Oval_stuff(string)
  15. | Oval_tuple(list(out_value))
  16. | Oval_variant(string, option(out_value))
;
type out_type_param = (string, (Asttypes.variance, Asttypes.injectivity));
type out_type =
  1. | Otyp_abstract
  2. | Otyp_open
  3. | Otyp_alias of {
    1. non_gen: bool,
    2. aliased: out_type,
    3. alias: string,
    }
  4. | Otyp_arrow(string, out_type, out_type)
  5. | Otyp_class(out_ident, list(out_type))
  6. | Otyp_constr(out_ident, list(out_type))
  7. | Otyp_manifest(out_type, out_type)
  8. | Otyp_object of {
    1. fields: list((string, out_type)),
    2. open_row: bool,
    }
  9. | Otyp_record(list((string, bool, out_type)))
  10. | Otyp_stuff(string)
  11. | Otyp_sum(list(out_constructor))
  12. | Otyp_tuple(list(out_type))
  13. | Otyp_var(bool, string)
  14. | Otyp_variant(out_variant, bool, option(list(string)))
  15. | Otyp_poly(list(string), out_type)
  16. | Otyp_module(out_ident, list((string, out_type)))
  17. | Otyp_attribute(out_type, out_attribute)
;
and out_constructor = {
  1. ocstr_name: string,
  2. ocstr_args: list(out_type),
  3. ocstr_return_type: option(out_type),
};
and out_variant =
  1. | Ovar_fields(list((string, bool, list(out_type))))
  2. | Ovar_typ(out_type)
;
type out_class_type =
  1. | Octy_constr(out_ident, list(out_type))
  2. | Octy_arrow(string, out_type, out_class_type)
  3. | Octy_signature(option(out_type), list(out_class_sig_item))
;
and out_class_sig_item =
  1. | Ocsg_constraint(out_type, out_type)
  2. | Ocsg_method(string, bool, bool, out_type)
  3. | Ocsg_value(string, bool, bool, out_type)
;
type out_module_type =
  1. | Omty_abstract
  2. | Omty_functor(option((option(string), out_module_type)), out_module_type)
  3. | Omty_ident(out_ident)
  4. | Omty_signature(list(out_sig_item))
  5. | Omty_alias(out_ident)
;
and out_sig_item =
  1. | Osig_class(bool, string, list(out_type_param), out_class_type, out_rec_status)
  2. | Osig_class_type(bool, string, list(out_type_param), out_class_type, out_rec_status)
  3. | Osig_typext(out_extension_constructor, out_ext_status)
  4. | Osig_modtype(string, out_module_type)
  5. | Osig_module(string, out_module_type, out_rec_status)
  6. | Osig_type(out_type_decl, out_rec_status)
  7. | Osig_value(out_val_decl)
  8. | Osig_ellipsis
;
and out_type_decl = {
  1. otype_name: string,
  2. otype_params: list(out_type_param),
  3. otype_type: out_type,
  4. otype_private: Asttypes.private_flag,
  5. otype_immediate: Type_immediacy.t,
  6. otype_unboxed: bool,
  7. otype_cstrs: list((out_type, out_type)),
};
and out_extension_constructor = {
  1. oext_name: string,
  2. oext_type_name: string,
  3. oext_type_params: list(string),
  4. oext_args: list(out_type),
  5. oext_ret_type: option(out_type),
  6. oext_private: Asttypes.private_flag,
};
and out_type_extension = {
  1. otyext_name: string,
  2. otyext_params: list(string),
  3. otyext_constructors: list(out_constructor),
  4. otyext_private: Asttypes.private_flag,
};
and out_val_decl = {
  1. oval_name: string,
  2. oval_type: out_type,
  3. oval_prims: list(string),
  4. oval_attributes: list(out_attribute),
};
and out_rec_status =
  1. | Orec_not
  2. | Orec_first
  3. | Orec_next
;
and out_ext_status =
  1. | Oext_first
  2. | Oext_next
  3. | Oext_exception
;
type out_phrase =
  1. | Ophr_eval(out_value, out_type)
  2. | Ophr_signature(list((out_sig_item, option(out_value))))
  3. | Ophr_exception((exn, out_value))
;