Browse Source

fix with untyped.

Nicolas Cannasse 18 years ago
parent
commit
a49f72053b
8 changed files with 13 additions and 13 deletions
  1. 2 3
      genneko.ml
  2. 2 2
      std/Date.hx
  3. 1 1
      std/flash/Boot.hx
  4. 1 1
      std/flash/Mouse.hx
  5. 1 1
      std/haxe/Log.hx
  6. 2 2
      std/js/Boot.hx
  7. 2 2
      std/neko/NekoString__.hx
  8. 2 1
      typer.ml

+ 2 - 3
genneko.ml

@@ -746,9 +746,8 @@ let generate file types hres libs =
 	let neko_file = (try Filename.chop_extension file with _ -> file) ^ ".neko" in
 	let w = Plugin.timer "neko ast write" in
 	let ch = IO.output_channel (open_out_bin neko_file) in
-	let source = Plugin.defined "neko_source" in
-	Binast.write ch e;
-	(*// Nxml.write ch (Nxml.to_xml e); *)
+	let source = Plugin.defined "neko_source" in	
+	if source then Nxml.write ch (Nxml.to_xml e) else Binast.write ch e;
 	IO.close_out ch;
 	let command cmd = try Sys.command cmd with _ -> -1 in
 	if source then begin

+ 2 - 2
std/Date.hx

@@ -146,12 +146,12 @@ extern class Date
 				return d;
 			case 10: // YYYY-MM-DD
 				var k = s.split("-");
-				return new Date(k[0],k[1] - 1,k[2],0,0,0);
+				return new Date(cast k[0],cast k[1] - 1,cast k[2],0,0,0);
 			case 19: // YYYY-MM-DD hh:mm:ss
 				var k = s.split(" ");
 				var y = k[0].split("-");
 				var t = k[1].split(":");
-				return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
+				return new Date(cast y[0],cast y[1] - 1,cast y[2],cast t[0],cast t[1],cast t[2]);
 			default:
 				throw "Invalid date format : " + s;
 			}

+ 1 - 1
std/flash/Boot.hx

@@ -122,7 +122,7 @@ class Boot {
 	}
 	#end
 
-	private static function __instanceof(o,cl) {
+	private static function __instanceof(o : Dynamic,cl) {
 		untyped {
 			if( !cl )
 				return false;

+ 1 - 1
std/flash/Mouse.hx

@@ -27,7 +27,7 @@ extern class Mouse
 
 	private static function __init__() : Void untyped {
 		flash.Mouse = _global["Mouse"];
-		flash.Mouse.addListener(flash.Mouse);
+		flash.Mouse.addListener(cast flash.Mouse);
 	}
 
 }

+ 1 - 1
std/haxe/Log.hx

@@ -47,7 +47,7 @@ class Log {
 		#else error
 		#end
 	}
-	
+
 	#if flash
 	public static f9dynamic function setColor( rgb : Int ) {
 		untyped flash.Boot.__set_trace_color(rgb);

+ 2 - 2
std/js/Boot.hx

@@ -30,7 +30,7 @@ class Boot {
 		return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
 	}
 
-	private static function __trace(v,i) {
+	private static function __trace(v,i : haxe.PosInfos) {
 		untyped {
 			var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else "";
 			msg += __unhtml(__string_rec(v,""))+"<br/>";
@@ -150,7 +150,7 @@ class Boot {
 		return __interfLoop(cc.__super__,cl);
 	}
 
-	private static function __instanceof(o,cl) {
+	private static function __instanceof(o : Dynamic,cl) {
 		untyped {
 			try {
 				if( __js__("o instanceof cl") ) {

+ 2 - 2
std/neko/NekoString__.hx

@@ -163,11 +163,11 @@ class NekoString__ implements String {
 	}
 
 	private function __add(s) {
-		return untyped new String(this.__s+__dollar__string(s));
+		return new String(untyped this.__s+__dollar__string(s));
 	}
 
 	private function __radd(s) {
-		return untyped new String(__dollar__string(s)+this.__s);
+		return new String(untyped __dollar__string(s)+this.__s);
 	}
 
 	static function fromCharCode( c : Int ) : String untyped {

+ 2 - 1
typer.ml

@@ -179,7 +179,8 @@ let unify_raise ctx t1 t2 p =
 		Type.unify t1 t2
 	with
 		Unify_error l ->
-			if not ctx.untyped then raise (Error (Unify l,p))
+			(* no untyped check *)
+			raise (Error (Unify l,p))
 
 let save_locals ctx =
 	let locals = ctx.locals in