From 27d6efb5f5a076f825fe2da1875e0cabaf02b4e7 Mon Sep 17 00:00:00 2001 From: chai <chaifix@163.com> Date: Wed, 17 Nov 2021 23:03:07 +0800 Subject: + LuaMacro --- Tools/LuaMacro/tests/qw.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Tools/LuaMacro/tests/qw.lua (limited to 'Tools/LuaMacro/tests/qw.lua') diff --git a/Tools/LuaMacro/tests/qw.lua b/Tools/LuaMacro/tests/qw.lua new file mode 100644 index 0000000..80fb26d --- /dev/null +++ b/Tools/LuaMacro/tests/qw.lua @@ -0,0 +1,16 @@ +local macro = require 'macro' +macro.define('qw',function(get,put) + local append = table.insert + local t,v = get() + local res = {{'{','{'}} + t,v = get:next() + while t ~= ')' do + if t ~= ',' then + append(res,{'string','"'..v..'"'}) + append(res,{',',','}) + end + t,v = get:next() + end + append(res,{'}','}'}) + return res +end) \ No newline at end of file -- cgit v1.1-26-g67d0