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/test-scope.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tools/LuaMacro/tests/test-scope.lua (limited to 'Tools/LuaMacro/tests/test-scope.lua') diff --git a/Tools/LuaMacro/tests/test-scope.lua b/Tools/LuaMacro/tests/test-scope.lua new file mode 100644 index 0000000..8007225 --- /dev/null +++ b/Tools/LuaMacro/tests/test-scope.lua @@ -0,0 +1,17 @@ +-- simple macros created using def_ are lexically scoped +do + def_ X 42 + assert(X == 42) + do + def_ X 'hello' + assert(X == 'hello') + do + def_ X 999 + assert (X == 999) + end + assert(X == 'hello') + end + assert(X == 42) +end +assert (X==nil) + -- cgit v1.1-26-g67d0