Explorar o código

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

Dan Korostelev %!s(int64=11) %!d(string=hai) anos
pai
achega
0f5fccfd51
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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