aboutsummaryrefslogtreecommitdiffstats
path: root/luatablegen.py
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-07-14 10:44:56 +0000
committerbloodstalker <thabogre@gmail.com>2018-07-14 10:44:56 +0000
commit2cae0e54f7bec588fbceb1e91c6023923abc1d1c (patch)
tree471f824bed5af2347c7b0a6378344c127bf11efc /luatablegen.py
parentfirst commit (diff)
downloadluatablegen-2cae0e54f7bec588fbceb1e91c6023923abc1d1c.tar.gz
luatablegen-2cae0e54f7bec588fbceb1e91c6023923abc1d1c.zip
update
Diffstat (limited to '')
-rwxr-xr-xluatablegen.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/luatablegen.py b/luatablegen.py
index aca41d3..3fc39b3 100755
--- a/luatablegen.py
+++ b/luatablegen.py
@@ -7,6 +7,7 @@ import os
import readline
import signal
import sys
+import datetime
C_STRUCT = ['typedef struct XXX {', '}XXX;']
HEADER_GUARD = ['\n#ifndef _XXX_H\n#define _XXX_H\n', '#endif //end of inclusion guard\n\n']
@@ -97,10 +98,13 @@ class TbgParser(object):
def __init__(self, argparser):
self.tbg_file = json.load(open(argparser.args.tbg))
self.argparser = argparser
+ self.time = datetime.datetime.now().isoformat()
+ print(self.time)
def begin(self, c_source, struct_name, h_filename, is_source):
c_source.write("\n")
c_source.write("// automatically generated by luatablegen\n")
+ c_source.write("// " + self.time + "\n")
for header in HEADER_LIST:
if self.argparser.args.luaheader:
c_source.write(header.replace("HHH", self.argparser.args.luaheader+"/"))
@@ -282,6 +286,7 @@ class TbgParser(object):
def luagen(self):
l_source = open(self.argparser.args.lualibpath, "w")
l_source.write("-- automatically generated by luatablegen\n")
+ l_source.write("-- " + self.time + "\n")
l_source.write(LUA_LIB[0])
for k, v in self.tbg_file.items():
struct_name = k
@@ -366,6 +371,8 @@ class TbgParser(object):
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.write("// " + self.time + "\n")
+ aggr_header_h.write("// " + self.time + "\n")
aggr_header_h.write(HEADER_GUARD[0].replace("XXX", "WASM_TABLES_AGGR"))
aggr_header_h.write(EXTERN_C[0])
aggr_header.write("\n")
@@ -392,6 +399,7 @@ class TbgParser(object):
self.luagen()
if self.argparser.args.docpath:
d_source.write("_automatically generated by luatablegen._<br/>\n")
+ d_source.write("_" + self.time + "_")
# write code here
def premain(argparser):