Project

General

Profile

« Previous | Next » 

Revision 57c96fb7

Added by LĂ©lio Brun 11 months ago

setup tests for dune

View differences:

src/automata.ml
263 263
    (top_typedef :: top_types, top_decls'@top_nodes, locals'@locals, eqs'@eqs)
264 264

  
265 265
let expand_node_stmts nused used loc owner node =
266
  let (top_types', top_nodes', locals', eqs') =
266
  let top_types', top_nodes', locals', eqs' =
267 267
    List.fold_left (expand_node_stmt nused used owner node) ([], [], [], []) node.node_stmts in
268 268
  let node' = 
269 269
    { node with node_locals = locals'@node.node_locals; node_stmts = eqs' } in
......
277 277
    match top_decl.top_decl_desc with
278 278
    | Node nd ->
279 279
      let used name =
280
	   List.exists (fun v -> v.var_id = name) nd.node_inputs
281
	|| List.exists (fun v -> v.var_id = name) nd.node_outputs
282
	|| List.exists (fun v -> v.var_id = name) nd.node_locals in
283
      let (top_types', top_decl', top_nodes') = expand_node_stmts nused used top_decl.top_decl_loc top_decl.top_decl_owner nd in
280
        List.exists (fun v -> v.var_id = name) nd.node_inputs
281
        || List.exists (fun v -> v.var_id = name) nd.node_outputs
282
        || List.exists (fun v -> v.var_id = name) nd.node_locals in
283
      let top_types', top_decl', top_nodes' = expand_node_stmts nused used top_decl.top_decl_loc top_decl.top_decl_owner nd in
284 284
      top_types' @ (top_decl' :: expand_decls_rec nused (top_nodes'@q))
285 285
    | _       -> top_decl :: expand_decls_rec nused q
286 286

  
287 287
let expand_decls top_decls =
288 288
  let top_names = List.fold_left (fun names t -> match t.top_decl_desc with
289
    | Node nd         -> ISet.add nd.node_id names
290
    | ImportedNode nd -> ISet.add nd.nodei_id names
291
    | _               -> names) ISet.empty top_decls in
289
      | Node nd         -> ISet.add nd.node_id names
290
      | ImportedNode nd -> ISet.add nd.nodei_id names
291
      | _               -> names) ISet.empty top_decls in
292 292
  let nused name = ISet.mem name top_names in
293 293
  expand_decls_rec nused top_decls
294 294

  

Also available in: Unified diff