summaryrefslogtreecommitdiff
path: root/Tools/LuaMacro/tests/test-with.lua
blob: ac5d0fe36640e4faaef780b7b234d401d07f864a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require_ 'macro.with'

aLongTableName = {}
with aLongTableName do
  .a = 1
  .b = {{x=1},{x=2}}
  .c = {f = 2}
  print(.a,.c.f,.b[1].x)
end

def_ @ return
def_ F function

F f(x) @ x+1 end

print(f(10))