Browse Source

[python] print «pass» on a new line for empty classes/interfaces

Dan Korostelev 11 năm trước cách đây
mục cha
commit
0f5fccfd51
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      genpy.ml

+ 4 - 1
genpy.ml

@@ -1999,7 +1999,10 @@ module Generator = struct
 				| [] -> c.cl_constructor = None
 				| _ -> c.cl_interface
 			in
-			if use_pass then spr ctx "\tpass";
+			if use_pass then begin
+				newline ctx;
+				spr ctx "\tpass";
+			end
 		end;
 		gen_class_init ctx c