summaryrefslogtreecommitdiff
path: root/Tools/LuaMacro/tests/test-scope.lua
blob: 80072258917549ddd048cdd0ffd10fba6446f52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)