Jelajahi Sumber

fixed Vector statics

Nicolas Cannasse 14 tahun lalu
induk
melakukan
6d9f27ce50
1 mengubah file dengan 10 tambahan dan 7 penghapusan
  1. 10 7
      genas3.ml

+ 10 - 7
genas3.ml

@@ -385,13 +385,6 @@ let rec gen_call ctx e el r =
 		spr ctx ")"
 		spr ctx ")"
 	| TField ({ eexpr = TTypeExpr (TClassDecl { cl_path = (["flash"],"Lib") }) },f), args ->
 	| TField ({ eexpr = TTypeExpr (TClassDecl { cl_path = (["flash"],"Lib") }) },f), args ->
 		(match f, args with
 		(match f, args with
-		| "vectorOfArray", [e] | "vectorConvert", [e] ->
-			(match follow r with
-			| TInst ({ cl_path = (["flash"],"Vector") },[t]) ->
-				print ctx "Vector.<%s>(" (type_str ctx t e.epos);
-				gen_value ctx e;
-				print ctx ")";
-			| _ -> assert false)
 		| "as", [e1;e2] ->
 		| "as", [e1;e2] ->
 			gen_value ctx e1;
 			gen_value ctx e1;
 			spr ctx " as ";
 			spr ctx " as ";
@@ -401,6 +394,16 @@ let rec gen_call ctx e el r =
 			spr ctx "(";
 			spr ctx "(";
 			concat ctx "," (gen_value ctx) el;
 			concat ctx "," (gen_value ctx) el;
 			spr ctx ")")
 			spr ctx ")")
+	| TField ({ eexpr = TTypeExpr (TClassDecl { cl_path = (["flash"],"Vector") }) },f), args ->
+		(match f, args with
+		| "ofArray", [e] | "convert", [e] ->
+			(match follow r with
+			| TInst ({ cl_path = (["flash"],"Vector") },[t]) ->
+				print ctx "Vector.<%s>(" (type_str ctx t e.epos);
+				gen_value ctx e;
+				print ctx ")";
+			| _ -> assert false)
+		| _ -> assert false)
 	| _ ->
 	| _ ->
 		gen_value ctx e;
 		gen_value ctx e;
 		spr ctx "(";
 		spr ctx "(";