12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- discard """
- output: '''
- var data = @[(1, "one"), (2, "two")]
- for (i, d) in pairs(data):
- discard
- for i, d in pairs(data):
- discard
- for i, (x, y) in pairs(data):
- discard
- var
- a = 1
- b = 2
- type
- A* = object
- var data = @[(1, "one"), (2, "two")]
- for (i, d) in pairs(data):
- discard
- for i, d in pairs(data):
- discard
- for i, (x, y) in pairs(data):
- discard
- var (a, b) = (1, 2)
- type
- A* = object
- '''
- """
- import macros
- macro echoTypedRepr(arg: typed) =
- result = newCall(ident"echo", newLit(arg.repr))
- macro echoUntypedRepr(arg: untyped) =
- result = newCall(ident"echo", newLit(arg.repr))
- template echoTypedAndUntypedRepr(arg: untyped) =
- echoTypedRepr(arg)
- echoUntypedRepr(arg)
- echoTypedAndUntypedRepr:
- var data = @[(1,"one"), (2,"two")]
- for (i, d) in pairs(data):
- discard
- for i, d in pairs(data):
- discard
- for i, (x,y) in pairs(data):
- discard
- var (a,b) = (1,2)
- type A* = object # issue #22933
|