From 604a8e5e53cdc7391a502fcabf07e8f1cc2a778c Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 21 Jan 2026 10:05:19 +0800 Subject: Update. --- src/3rdParty/gencode.yue | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 src/3rdParty/gencode.yue (limited to 'src/3rdParty/gencode.yue') diff --git a/src/3rdParty/gencode.yue b/src/3rdParty/gencode.yue new file mode 100755 index 0000000..e0dbcb9 --- /dev/null +++ b/src/3rdParty/gencode.yue @@ -0,0 +1,26 @@ +#!yue -e + +for file in *["luaminify.lua",] + text = "" + with io.open file + text = \read "*a" + \close! + + indent = "\t" + count = 0 + text = text\gsub "#!", "--#!" + bytes = indent .. string.gsub text, "(.)", (ch)-> + sep = "" + count += 1 + if count == 15 + count = 0 + sep = "\n" .. indent + string.format "%3u,%s", string.byte(ch), sep + + name = file\gsub "%.", "_" + output = "#{name}.h" + with io.open output, "w" + \write "const char #{name}[] = {\n#{bytes}\n};" + \close! + + print "file \"#{output}\"generated." -- cgit v1.2.3-55-g6feb