Ver código fonte

Lua: Don't generate modules/classes for externs.

Externs shouldn't generate any code in the compiled result, but when I
wrote the "type forwarding" that generated modules, etc. at the top of
the script, I forgot to exclude them.
Justin Donaldson 10 anos atrás
pai
commit
2b6e97815a
1 arquivos alterados com 5 adições e 3 exclusões
  1. 5 3
      genlua.ml

+ 5 - 3
genlua.ml

@@ -1186,9 +1186,11 @@ let generate_type ctx = function
 
 let generate_type_forward ctx = function
 	| TClassDecl c ->
-		generate_package_create ctx c.cl_path;
-		let p = s_path ctx c.cl_path in
-		print ctx "%s = {} " p;
+		if not c.cl_extern then begin
+		    generate_package_create ctx c.cl_path;
+		    let p = s_path ctx c.cl_path in
+		    print ctx "%s = {} " p;
+		end
 	| TEnumDecl e when e.e_extern ->
 		()
 	| TEnumDecl e ->