Project

General

Profile

Revision 70be4acf src/corelang.ml

View differences:

src/corelang.ml
1239 1239
  }
1240 1240
  in aux ()
1241 1241

  
1242
       
1243
let get_node name prog =
1244
  let node_opt = List.fold_left
1245
    (fun res top -> 
1246
      match res, top.top_decl_desc with
1247
      | Some _, _ -> res
1248
      | None, Node nd -> 
1249
	(* Format.eprintf "Checking node %s = %s: %b@." nd.node_id name (nd.node_id = name); *)
1250
	if nd.node_id = name then Some nd else res
1251
      | _ -> None) 
1252
    None prog 
1253
  in
1254
  try 
1255
    Utils.desome node_opt
1256
  with Utils.DeSome -> raise Not_found
1257

  
1242 1258
(* Local Variables: *)
1243 1259
(* compile-command:"make -C .." *)
1244 1260
(* End: *)

Also available in: Unified diff