Преглед изворни кода

php: fixed issue with extern members generated

Franco Ponticelli пре 12 година
родитељ
комит
5ded6f6b7a
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      genphp.ml

+ 5 - 2
genphp.ml

@@ -1849,7 +1849,8 @@ let gen_assigned_value ctx eo =	match eo with
 		()
 		()
 
 
 let generate_field ctx static f =
 let generate_field ctx static f =
-	newline ctx;
+	if not (is_extern_field f) then
+		newline ctx;
 	ctx.locals <- PMap.empty;
 	ctx.locals <- PMap.empty;
 	ctx.inv_locals <- PMap.empty;
 	ctx.inv_locals <- PMap.empty;
 	ctx.in_instance_method <- not static;
 	ctx.in_instance_method <- not static;
@@ -1867,7 +1868,9 @@ let generate_field ctx static f =
 		else
 		else
 			gen_function ctx (s_ident f.cf_name) fd f.cf_params p
 			gen_function ctx (s_ident f.cf_name) fd f.cf_params p
 	| _ ->
 	| _ ->
-		if ctx.curclass.cl_interface then
+		if (is_extern_field f) then
+			()
+		else if ctx.curclass.cl_interface then
 			match follow f.cf_type, f.cf_kind with
 			match follow f.cf_type, f.cf_kind with
 			| TFun (args,r), Method _ ->
 			| TFun (args,r), Method _ ->
 				print ctx "function %s(" (s_ident f.cf_name);
 				print ctx "function %s(" (s_ident f.cf_name);