Commit Graph

7 Commits (master)

Author SHA1 Message Date
Leo White 9e61a063c3 Avoid warning 58 in flambda ocamlnat 2020-06-25 14:45:45 +01:00
Gabriel Scherer e070c267e5 Merge pull request #9219 from kit-ty-kate/extra-space-error
Fix the "Wrong file naming" error message

(cherry picked from commit ebe078ab8958762a5c668c5753bec45a7ad5933e)
2020-01-01 18:42:44 +01:00
Gabriel Scherer c76edb9677 [refactoring] use named fields for Consistbl.Inconsistency exception 2019-11-07 15:07:46 +01:00
Mark Shinwell d47ba6ec18
Functorize Consistbl (with some background info on Compilation_unit.t) (#2286) 2019-03-07 16:19:51 +00:00
Gabriel Scherer 96518644f5 fix dune build
(dune seems to choke on some 4.08 features that were used in the Env
codebase already. It's not a bad idea to ensure that the compiler
codebase works well with 4.07.)
2019-02-20 22:40:58 +01:00
Gabriel Scherer e82a28af60 env refactoring: use a custom ADT for missing pers_struct entries
The hope is that a tailor-made algebraic datatype is more readable /
less confusing than using ('a option) directly -- one may confuse
getting None when looking in a table with the Not_found case.

(Suggested by Jérémie Dimino)
2019-02-18 17:03:16 +01:00
Gabriel Scherer 93f0ce31bb env refactoring: separate the cmi/crc handling into a persistent_env module
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).

Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
2019-02-18 17:02:47 +01:00