Pārlūkot izejas kodu

fixed __vector__ for as3

Nicolas Cannasse 17 gadi atpakaļ
vecāks
revīzija
3ceec02df2
2 mainītis faili ar 9 papildinājumiem un 3 dzēšanām
  1. 1 0
      doc/CHANGES.txt
  2. 8 3
      genas3.ml

+ 1 - 0
doc/CHANGES.txt

@@ -15,6 +15,7 @@ TODO :
 	StringBuf now uses an array for JS implementation (around same on FF, faster on IE)
 	fixed assignament of field length in anonym objects (haXe/PHP)
 	fixed addEventListener typing for flash9
+	fixed __vector__ generation for AS3 target
 
 2008-11-23: 2.02
 	Std.is(MyInterface, Class) now returns true (haXe/PHP)

+ 8 - 3
genas3.ml

@@ -292,7 +292,7 @@ let gen_function_header ctx name f params p =
 		ctx.local_types <- old_t;
 	)
 
-let rec gen_call ctx e el =
+let rec gen_call ctx e el r =
 	match e.eexpr , el with
 	| TCall (x,_) , el ->
 		spr ctx "(";
@@ -355,6 +355,11 @@ let rec gen_call ctx e el =
 		spr ctx ")";
 	| TLocal "__unprotect__", [e] ->
 		gen_value ctx e
+	| TLocal "__vector__", [e] ->
+		spr ctx (type_str ctx r e.epos);
+		spr ctx "(";
+		gen_value ctx e;
+		spr ctx ")"
 	| _ ->
 		gen_value ctx e;
 		spr ctx "(";
@@ -482,8 +487,8 @@ and gen_expr ctx e =
 		gen_expr ctx (mk_block f.tf_expr);
 		ctx.in_static <- old;
 		h();
-	| TCall (e,el) ->
-		gen_call ctx e el
+	| TCall (v,el) ->
+		gen_call ctx v el e.etype
 	| TArrayDecl el ->
 		spr ctx "[";
 		concat ctx "," (gen_value ctx) el;