Hi,
I am using the Typedtree
type from https://github.com/ocaml/ocaml/blob/trunk/typing/typedtree.mli to access to the OCaml AST generated by the compiler. I would like to inspect the environment (type Env.t
), for example search for elements using the Env.find_modtype
function. I am getting the AST from compiled .cmt
files.
The problem: the environment extracted from the .cmt
only contains a summary
, thus lookup functions always return “not found”. By applying Envaux.env_of_only_summary
I was expecting to retrieve the full environment, but it fails saying that Pervasives
(or Stdlib
) is not found.
I made a minimal example: https://github.com/clarus/ocaml-minimal-example-env-typedtree
Do you have an idea of how to get an Env.t
from a .cmt
? Is this possible? Thanks!