(** The modules field evaluator interprets the module sources into proper
    modules in a directory in the context of a stanza from a dune file. *)

open Import

module Virtual : sig
  type t = { virtual_modules : Ordered_set_lang.Unexpanded.t }
end

module Implementation : sig
  type t =
    { existing_virtual_modules : Module_name.Path.Set.t
    ; allow_new_public_modules : bool
    }
end

type kind =
  | Virtual of Virtual.t
  | Implementation of Implementation.t
  | Exe_or_normal_lib
  | Parameter

val expand_all_unchecked
  :  expander:Expander.t
  -> Ordered_set_lang.Unexpanded.t
  -> (Loc.t * (Module_name.Unchecked.t * string)) Module_trie.Unchecked.t Memo.t

val eval
  :  expander:Expander.t
  -> modules:Module.Source.t Module_trie.Unchecked.t
  -> stanza_loc:Loc.t
  -> private_modules:Ordered_set_lang.Unexpanded.t
  -> kind:kind
  -> for_:Compilation_mode.t
  -> src_dir:Path.Build.t
  -> version:Dune_lang.Syntax.Version.t
  -> Modules_settings.t
  -> ((Loc.t * Module.Source.t) Module_trie.t * Module.t Module_trie.t) Memo.t
