Răsfoiți Sursa

allowed \r separators for hxml

Nicolas Cannasse 16 ani în urmă
părinte
comite
a1651b420f
2 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 1 0
      doc/CHANGES.txt
  2. 3 3
      main.ml

+ 1 - 0
doc/CHANGES.txt

@@ -28,6 +28,7 @@ TODO :
 	added neko.db.Manager.setLockMode
 	added neko.db.Manager.setLockMode
 	genAS3 : fixed Error classes issues
 	genAS3 : fixed Error classes issues
 	flash9 : fixed UInt default parameter verify error
 	flash9 : fixed UInt default parameter verify error
+	compiler : allowed \r line separators for HXML files
 
 
 2008-11-23: 2.02
 2008-11-23: 2.02
 	Std.is(MyInterface, Class) now returns true (haXe/PHP)
 	Std.is(MyInterface, Class) now returns true (haXe/PHP)

+ 3 - 3
main.ml

@@ -135,9 +135,9 @@ let expand_env path =
 	Str.global_substitute r (fun s -> try Sys.getenv (Str.matched_group 1 s) with Not_found -> "") path
 	Str.global_substitute r (fun s -> try Sys.getenv (Str.matched_group 1 s) with Not_found -> "") path
 
 
 let parse_hxml file =
 let parse_hxml file =
-	let ch = (try open_in file with _ -> failwith ("File not found " ^ file)) in
-	let lines = Std.input_list ch in
-	close_in ch;
+	let ch = IO.input_channel (try open_in_bin file with _ -> failwith ("File not found " ^ file)) in
+	let lines = Str.split (Str.regexp "[\r\n]+") (IO.read_all ch) in
+	IO.close_in ch;
 	List.concat (List.map (fun l ->
 	List.concat (List.map (fun l ->
 		let l = ExtString.String.strip l in
 		let l = ExtString.String.strip l in
 		(*// disabled - need additional str.cmxa linkage
 		(*// disabled - need additional str.cmxa linkage