Project

General

Profile

Revision 0bca9d53 src/compiler_common.ml

View differences:

src/compiler_common.ml
232 232
  | _ -> false
233 233

  
234 234

  
235
let import_dependencies prog =
235
let rec import_dependencies prog =
236 236
  Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 4>.. extracting dependencies");
237 237
  let dependencies = Corelang.get_dependencies prog in
238 238
  let deps =
......
240 240
    (fun (compilation_dep, type_env, clock_env) dep ->
241 241
      let (local, s) = Corelang.dependency_of_top dep in
242 242
      let basename = Options_management.name_dependency (local, s) in
243
      Log.report ~level:1 (fun fmt -> Format.fprintf fmt "@ Library %s" basename);
243
      Log.report ~level:1 (fun fmt -> Format.fprintf fmt "@ Library %s@ " basename);
244 244
      let lusic = Modules.import_dependency dep.top_decl_loc (local, s) in
245 245
      (*Log.report ~level:1 (fun fmt -> Format.fprintf fmt "");*)
246
      let lusic_deps, type_env', clock_env' = import_dependencies lusic.Lusic.contents in
247
      let type_env = Env.overwrite type_env type_env' in
248
      let clock_env = Env.overwrite clock_env clock_env' in
246 249
      let (lusi_type_env, lusi_clock_env) = get_envs_from_top_decls lusic.Lusic.contents in
247 250
      let is_stateful = List.exists is_stateful lusic.Lusic.contents in
248 251
      let new_dep = Dep (local, s, lusic.Lusic.contents, is_stateful ) in
249
      new_dep::compilation_dep,
252
      new_dep::lusic_deps@compilation_dep,
250 253
      Env.overwrite type_env lusi_type_env,
251 254
      Env.overwrite clock_env lusi_clock_env)
252 255
    ([], Basic_library.type_env, Basic_library.clock_env)

Also available in: Unified diff