diff options
author | chai <chaifix@163.com> | 2021-11-17 23:03:07 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-17 23:03:07 +0800 |
commit | 27d6efb5f5a076f825fe2da1875e0cabaf02b4e7 (patch) | |
tree | 44f301110bc2ea742908ed92a78eba0803cd3b60 /Tools/LuaMacro/tests/const.lua | |
parent | b34310c631989551054d456eb47aaab5ded266a4 (diff) |
+ LuaMacro
Diffstat (limited to 'Tools/LuaMacro/tests/const.lua')
-rw-r--r-- | Tools/LuaMacro/tests/const.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tools/LuaMacro/tests/const.lua b/Tools/LuaMacro/tests/const.lua new file mode 100644 index 0000000..f5f8508 --- /dev/null +++ b/Tools/LuaMacro/tests/const.lua @@ -0,0 +1,9 @@ +local macro = require 'macro' +macro.define ('const',function(get) + get() + local vars,values = get:idens '=',get:list '\n' + for i,name in ipairs(vars) do + macro.assert(values[i],'each constant must be assigned!') + macro.define_scoped(name,tostring(values[i])) + end +end) |