Nicolas Cannasse 14 年之前
父節點
當前提交
61db3014ad
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 3 2
      main.ml
  2. 1 1
      typer.ml

+ 3 - 2
main.ml

@@ -710,7 +710,8 @@ if !measure_times then begin
 	Hashtbl.iter (fun _ t -> tot := !tot +. t.total) Common.htimers;
 	Printf.eprintf "Total time : %.3fs\n" !tot;
 	Printf.eprintf "------------------------------------\n";
-	Hashtbl.iter (fun _ t ->
+	let timers = List.sort (fun t1 t2 -> compare t2.total t1.total) (Hashtbl.fold (fun _ t acc -> t :: acc) Common.htimers []) in
+	List.iter (fun t ->
 		Printf.eprintf "  %s : %.3fs, %.0f%%\n" t.name t.total (t.total *. 100. /. !tot);
-	) Common.htimers;
+	) timers;
 end;

+ 1 - 1
typer.ml

@@ -369,7 +369,7 @@ let field_access ctx mode f t e p =
 		if mode = MSet && m <> MethDynamic && not ctx.untyped then error "Cannot rebind this method : please use 'dynamic' before method declaration" p;
 		(match m, mode with
 		| MethInline, _ -> AKInline (e,f,t)
-		| MethMacro, MGet -> error "Macro functions must be called immediatly" p
+		| MethMacro, MGet -> display_error ctx "Macro functions must be called immediatly" p; normal()
 		| MethMacro, MCall -> AKMacro (e,f)
 		| _ , MGet -> AKExpr (mk (TClosure (e,f.cf_name)) t p)
 		| _ -> normal())