Sfoglia il codice sorgente

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

Dan Korostelev 11 anni fa
parent
commit
0f5fccfd51
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      genpy.ml

+ 4 - 1
genpy.ml

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