浏览代码

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 年之前
父节点
当前提交
2b6e97815a
共有 1 个文件被更改,包括 5 次插入3 次删除
  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 ->