Project

General

Profile

Revision 2196a0a6 src/typing.ml

View differences:

src/typing.ml
412 412
*)
413 413
and type_appl env in_main loc const f args =
414 414
  let tfun = type_ident env in_main loc const f in
415
  Format.eprintf "Typing function call %s: %a@.@?" f print_ty tfun ;
415
  (* Format.eprintf "Typing function call %s: %a@.@?" f print_ty tfun ; *)
416 416
  let tins, touts = split_arrow tfun in
417 417
  let tins = type_list_of_type tins in
418 418
  let args = expr_list_of_expr args in
......
422 422
(** [type_expr env in_main expr] types expression [expr] in environment
423 423
    [env], expecting it to be [const] or not. *)
424 424
and type_expr env in_main const expr =
425
  Format.eprintf "Typing expr: %a@.@?" Printers.pp_expr expr;
425
  (* Format.eprintf "Typing expr: %a@.@?" Printers.pp_expr expr; *)
426 426
  let res = 
427 427
  match expr.expr_desc with
428 428
  | Expr_const c ->
429
    Format.eprintf "const@.@?";
429
    (* Format.eprintf "const@.@?"; *)
430 430
    let ty = type_const expr.expr_loc c in
431 431
    let ty = Type_predef.type_static (Dimension.mkdim_var ()) ty in
432 432
    expr.expr_type <- ty;
433 433
    ty
434 434
  | Expr_ident v ->
435
    Format.eprintf "ident@.@?";
435
    (* Format.eprintf "ident@.@?"; *)
436 436
    let tyv =
437 437
      try
438 438
        Env.lookup_value (fst env) v
......
470 470
    expr.expr_type <- ty;
471 471
    ty
472 472
  | Expr_tuple elist ->
473
    Format.eprintf "const@.@?";
473
    (* Format.eprintf "const@.@?"; *)
474 474
    let ty = new_ty (Ttuple (List.map (type_expr env in_main const) elist)) in
475 475
    expr.expr_type <- ty;
476 476
    ty
......
480 480
    expr.expr_type <- ty;
481 481
    ty
482 482
  | Expr_appl (id, args, r) ->
483
    Format.eprintf "app %s@.@?" id;
483
    (* Format.eprintf "app %s@.@?" id; *)
484 484
    (* application of non internal function is not legal in a constant
485 485
       expression *)
486 486
    (match r with
......
682 682
    match nd.node_spec with
683 683
    | Some ns -> (
684 684
      try
685
	Format.eprintf "Typing specification: %a@.@?"
686
	  Printers.pp_spec ns;
687
	type_spec (delta_env, vd_env) ns;
688
	Format.eprintf "Typing ok@.@?";
685
	(* Format.eprintf "Typing specification: %a@.@?" *)
686
	(*   Printers.pp_spec ns; *)
687
	type_spec (delta_env, vd_env) ns
689 688
      with _ as exc -> (
690 689
	Format.eprintf "Error typing specification: %a@."
691 690
	  Printers.pp_spec ns;
......
720 719
  generalize ty_node;
721 720
  (* TODO ? Check that no node in the hierarchy remains polymorphic ? *)
722 721
  nd.node_type <- ty_node;
723
  Format.eprintf "Node %s type is %a@." nd.node_id Types.print_ty ty_node;
722
  (* Format.eprintf "Node %s type is %a@." nd.node_id Types.print_ty ty_node; *)
724 723
  Env.add_value env nd.node_id ty_node
725 724

  
726 725
let type_imported_node env nd loc =

Also available in: Unified diff