From cea737028f7d34e6415c0de5d34587245624db2b Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 7 Mar 2018 16:30:21 -0800 Subject: Added google/protobuf/descriptor.upb.* to core. This is in preparation for making upb_def capable of parsing binary descriptors directly. We leave upb/descriptor/descriptor.upbdefs.* in place for now, because upb/descriptor/reader.* still depends on it. Also removed a bit of cruft from the codegen. --- tools/upbc.lua | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'tools/upbc.lua') diff --git a/tools/upbc.lua b/tools/upbc.lua index a538b1c..8ac4f73 100644 --- a/tools/upbc.lua +++ b/tools/upbc.lua @@ -77,28 +77,28 @@ for _, file in ipairs(files) do hfile:close() cfile:close() - end - - -- Write C API. - hfilename = outbase .. ".upb.h" - cfilename = outbase .. ".upb.c" - - if os.getenv("UPBC_VERBOSE") then - print("upbc:") - print(string.format(" source file=%s", src)) - print(string.format(" output file base=%s", outbase)) - print(string.format(" hfilename=%s", hfilename)) - print(string.format(" cfilename=%s", cfilename)) - end + else + -- Write C API. + hfilename = outbase .. ".upb.h" + cfilename = outbase .. ".upb.c" + + if os.getenv("UPBC_VERBOSE") then + print("upbc:") + print(string.format(" source file=%s", src)) + print(string.format(" output file base=%s", outbase)) + print(string.format(" hfilename=%s", hfilename)) + print(string.format(" cfilename=%s", cfilename)) + end - local hfile = assert(io.open(hfilename, "w"), "couldn't open " .. hfilename) - local cfile = assert(io.open(cfilename, "w"), "couldn't open " .. cfilename) + local hfile = assert(io.open(hfilename, "w"), "couldn't open " .. hfilename) + local cfile = assert(io.open(cfilename, "w"), "couldn't open " .. cfilename) - local happend = dump_cinit.file_appender(hfile) - local cappend = dump_cinit.file_appender(cfile) + local happend = dump_cinit.file_appender(hfile) + local cappend = dump_cinit.file_appender(cfile) - make_c_api.write_gencode(file, hfilename, happend, cappend) + make_c_api.write_gencode(file, hfilename, happend, cappend) - hfile:close() - cfile:close() + hfile:close() + cfile:close() + end end -- cgit v1.2.3