Nicolas Cannasse преди 14 години
родител
ревизия
585b1f74af
променени са 2 файла, в които са добавени 16 реда и са изтрити 6 реда
  1. 11 1
      interp.ml
  2. 5 5
      typer.ml

+ 11 - 1
interp.ml

@@ -1599,10 +1599,20 @@ let macro_lib =
 		);
 		"signature", Fun1 (fun v ->
 			let cache = ref [] in
+			let hfiles = Hashtbl.create 0 in
+			let get_file f =
+				try 
+					Hashtbl.find hfiles f
+				with Not_found ->
+					let ff = (try Common.get_full_path f with _ -> f) in
+					Hashtbl.add hfiles f ff;
+					ff
+			in
 			let rec loop v =
 				match v with
 				| VNull | VBool _ | VInt _ | VFloat _ | VString _ -> v
-				| VAbstract (AInt32 _ | APos _) -> v
+				| VAbstract (AInt32 _) -> v
+				| VAbstract (APos p) -> VAbstract (APos { p with Ast.pfile = get_file p.Ast.pfile })
 				| _ ->
 					try
 						List.assq v !cache

+ 5 - 5
typer.ml

@@ -2067,11 +2067,11 @@ let load_macro ctx cpath f p =
 			List.iter (fun p -> com2.defines <- PMap.remove (platform_name p) com2.defines) platforms;
 			com2.class_path <- List.filter (fun s -> not (ExtString.String.exists s "/_std/")) com2.class_path;
 			com2.class_path <- List.map (fun p -> p ^ "neko" ^ "/_std/") com2.std_path @ com2.class_path;
-			com2.defines <- PMap.foldi (fun k _ acc -> 
-				if List.exists (fun (_,d) -> "flash" ^ d = k) Common.flash_versions then
-					acc
-				else
-					PMap.add k () acc
+			com2.defines <- PMap.foldi (fun k _ acc ->
+				match k with
+				| "no_traces" -> acc
+				| _ when List.exists (fun (_,d) -> "flash" ^ d = k) Common.flash_versions -> acc
+				| _ -> PMap.add k () acc
 			) com2.defines PMap.empty;
 			Common.define com2 "macro";
 			Common.init_platform com2 Neko;