summaryrefslogtreecommitdiff
path: root/Tools/LuaMacro/tests/qw.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/LuaMacro/tests/qw.lua')
-rw-r--r--Tools/LuaMacro/tests/qw.lua16
1 files changed, 16 insertions, 0 deletions
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