Project

General

Profile

« Previous | Next » 

Revision 3826f8cb

Added by Pierre-Loïc Garoche over 9 years ago

Solved bug:
- loading lusi
- loading lib in lusi files: "in m" is now "lib m"

git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@247 041b043f-8d7c-46b2-b46e-ef0dd855326e

View differences:

src/main_lustre_compiler.ml
137 137
      try
138 138
	let basename = (if local then s else Version.prefix ^ "/include/lustrec/" ^ s ) ^ ".lusi" in 
139 139
	report ~level:1 (fun fmt -> fprintf fmt "@[<v 0>Library %s@," basename);
140
	let comp_dep, lusi_type_env, lusi_clock_env = check_lusi (load_lusi false basename) in 
140
	  let comp_dep, lusi_type_env, lusi_clock_env = check_lusi (load_lusi false basename) in 
141 141
	report ~level:1 (fun fmt -> fprintf fmt "@]@ ");
142
	(s, local, comp_dep)::compilation_dep,
143
	Env.overwrite type_env lusi_type_env,
144
	Env.overwrite clock_env lusi_clock_env      
142
	
143
	  (s, local, comp_dep)::compilation_dep,
144
	  Env.overwrite type_env lusi_type_env,
145
	  Env.overwrite clock_env lusi_clock_env      
145 146
      with Sys_error msg -> (
146 147
	Format.eprintf "Failure: impossible to load library %s.@.%s@." s msg;
147 148
	exit 1
......
149 150
    )  ([], Basic_library.type_env, Basic_library.clock_env) dependencies
150 151
  in
151 152
  report ~level:1 (fun fmt -> fprintf fmt "@]@ ");
152
  
153

  
153 154
  (* Unfold consts *)
154 155
  (*let prog = Corelang.prog_unfold_consts prog in*)
155 156

  
......
208 209
      let _ = open_in lusi_name in
209 210
      let header = load_lusi true lusi_name in
210 211
      let _, declared_types_env, declared_clocks_env = check_lusi header in
212

  
211 213
      (* checking type compatibility with computed types*)
212 214
      Typing.check_env_compat header declared_types_env computed_types_env;
213 215
      Typing.uneval_prog_generics prog;
216

  
214 217
      (* checking clocks compatibility with computed clocks*)
215 218
      Clock_calculus.check_env_compat header declared_clocks_env computed_clocks_env;
216 219
      Clock_calculus.uneval_prog_generics prog;
220

  
217 221
      (* checking stateless status compatibility *)
218 222
      Stateless.check_compat header
219 223
    with Sys_error _ -> ( 

Also available in: Unified diff