Browse Source

fixxed issues with previous commit

Franco Ponticelli 17 years ago
parent
commit
f8ac4d1512
5 changed files with 19 additions and 13 deletions
  1. 8 2
      genphp.ml
  2. 3 0
      main.ml
  3. 2 3
      std/Date.hx
  4. 3 4
      std/Math.hx
  5. 3 4
      std/Xml.hx

+ 8 - 2
genphp.ml

@@ -1168,13 +1168,19 @@ and gen_expr ctx e =
 						spr ctx (s_path ctx (t_path t) false e1.epos);
 						print ctx "%s\"" p
 					| _ -> gen_expr ctx e1) in
+				
 				spr ctx "isset(";
+				gen_field_access ctx true e1 s;
+				spr ctx ") ? ";
+				gen_field_access ctx true e1 s;
+				spr ctx ": array(";
+				ob e1.eexpr;
+				(*
 				ob e1.eexpr;
 				print ctx "->%s) ? " s;
 				ob e1.eexpr;
 				print ctx "->%s " s;
-				spr ctx ": array(";
-				ob e1.eexpr;
+				*)
 				print ctx ", %s\"%s%s\")" p s p;
 			end)
 		| TMono _ ->

+ 3 - 0
main.ml

@@ -260,6 +260,9 @@ try
 		),"<file> : add the SWF library to the compiled SWF");
 		("-neko",Arg.String (set_platform Neko "neko"),"<file> : compile code to Neko Binary");
 		("-php",Arg.String (fun dir ->
+			classes := (["php"],"PhpXml__") :: !classes;
+			classes := (["php"],"PhpDate__") :: !classes;
+			classes := (["php"],"PhpMath__") :: !classes;
 			set_platform Php "php" dir;
 		),"<directory> : generate PHP code into target directory");
 		("-x", Arg.String (fun file ->

+ 2 - 3
std/Date.hx

@@ -110,12 +110,11 @@ extern class Date
 	function getLocaleTime():String;
 	#end
 
+#if !php
 	private static function __init__() : Void untyped {
 	#if neko
 		Date = neko.NekoDate__;
 		neko.Boot.__classes.Date = Date;
-	#elseif php
-		Date = php.PhpDate__;
 	#else
 		Date.now = function() {
 			return __new__(Date);
@@ -182,5 +181,5 @@ extern class Date
 		#end
 	#end
 	}
-
+#end
 }

+ 3 - 4
std/Math.hx

@@ -55,12 +55,11 @@ extern class Math
 	static function isFinite( f : Float ) : Bool;
 	static function isNaN( f : Float ) : Bool;
 
+#if !php
 	private static function __init__() : Void untyped {
 	#if neko
 		Math = neko.NekoMath__;
 		neko.Boot.__classes.Math = Math;
-	#elseif php
-		Math = php.PhpMath__;
 	#else
 		#if flash9
 		NaN = __global__["Number"].NaN;
@@ -96,12 +95,12 @@ extern class Math
 			#end
 		};
 	#end
-	#if (flash9 || php)
+	#if flash9
 	#else
 		Math.__name__ = ["Math"];
 	#end
 	}
-
+#end
 }
 
 

+ 3 - 4
std/Xml.hx

@@ -220,7 +220,8 @@ extern class Xml {
 		Returns a String representation of the Xml node.
 	**/
 	function toString() : String;
-
+	
+#if !php
 	static function __init__() : Void untyped {
 		#if neko
 			Xml = neko.NekoXml__;
@@ -234,8 +235,6 @@ extern class Xml {
 			#if swf_mark
 			flash.Lib.current["Xml"] = Xml;
 			#end
-		#elseif php
-			Xml = php.PhpXml__;
 		#end
 		#if !flash9
 		Xml.__name__ = ["Xml"];
@@ -248,5 +247,5 @@ extern class Xml {
 		Xml.Prolog = "prolog";
 		Xml.Document = "document";
 	}
-
+#end
 }