Browse Source

fix syntax of generated php

genphp generate invalid php code such that

       new _hx_array(array())->toString();

corresponding to the haxe's code

       (cast [] : Array<Int>).toString();
Ryusei Yamaguchi 11 years ago
parent
commit
bfd0f45089
1 changed files with 2 additions and 2 deletions
  1. 2 2
      genphp.ml

+ 2 - 2
genphp.ml

@@ -1377,9 +1377,9 @@ and gen_expr ctx e =
 		| _ ->
 			gen_call ctx ec el);
 	| TArrayDecl el ->
-		spr ctx "new _hx_array(array(";
+		spr ctx "(new _hx_array(array(";
 		concat ctx ", " (gen_value ctx) el;
-		spr ctx "))";
+		spr ctx ")))";
 	| TThrow e ->
 		spr ctx "throw new HException(";
 		gen_value ctx e;