diff options
author | bloodstalker <thabogre@gmail.com> | 2018-06-10 03:17:39 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-06-10 03:17:39 +0000 |
commit | 394262751bd166606a11c9db1e16a08b177ad807 (patch) | |
tree | 99a090bff851b97103e458f3ea1048d3a31187b7 /extra-tools | |
parent | added the autogen files, should also fix travis (diff) | |
download | mutator-394262751bd166606a11c9db1e16a08b177ad807.tar.gz mutator-394262751bd166606a11c9db1e16a08b177ad807.zip |
fix
Diffstat (limited to '')
-rwxr-xr-x | extra-tools/luatablegen.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/extra-tools/luatablegen.py b/extra-tools/luatablegen.py index 7443c39..c66b94c 100755 --- a/extra-tools/luatablegen.py +++ b/extra-tools/luatablegen.py @@ -328,21 +328,30 @@ class TbgParser(object): table_reg_list.append(struct_name + "_register(__ls);\n") h_source.write(TABLE_REGISTER[0].replace("XXX", struct_name).replace(" {\n", ";\n")) self.end(h_source) + # header aggregate if self.argparser.args.headeraggr: - aggr_header = open(self.argparser.args.headeraggr, "w") - aggr_header.write(HEADER_GUARD[0].replace("XXX", "WASM_TABLES_AGGR")) - aggr_header.write(EXTERN_C[0]) + name = self.argparser.args.headeraggr + dummy = name[name.rfind("/"):] + aggr_header = open(self.argparser.args.headeraggr.replace(".h", ".c"), "w") + aggr_header_h = open(self.argparser.args.headeraggr, "w") + aggr_header.write("// automatically generated by luatablegen\n") + aggr_header_h.write("// automatically generated by luatablegen\n") + aggr_header_h.write(HEADER_GUARD[0].replace("XXX", "WASM_TABLES_AGGR")) + aggr_header_h.write(EXTERN_C[0]) aggr_header.write("\n") for item in header_aggr_list: aggr_header.write("#include " + '"' + item + '"\n') + aggr_header_h.write("#include " + '"' + item + '"\n') + aggr_header.write("#include " + '".' + dummy + '"\n') aggr_header.write("\n") aggr_header.write("void reg_tablegen_tables(lua_State* __ls) {\n") + aggr_header_h.write("void reg_tablegen_tables(lua_State* __ls);\n") for func_sig in table_reg_list: aggr_header.write("\t" + func_sig) aggr_header.write("\t" + "lua_pop(__ls, 1);\n") aggr_header.write("}\n") - aggr_header.write(EXTERN_C[1]) - aggr_header.write(HEADER_GUARD[1]) + aggr_header_h.write(EXTERN_C[1]) + aggr_header_h.write(HEADER_GUARD[1]) aggr_header.write("\n") if self.argparser.args.makemacro: if self.argparser.args.out[-1] == "/": |