Something similar to this: https://play.nim-lang.org/#ix=24QX
Alternatively, if there's a way to check if an Ident from an untyped AST is of type ntyObject, that could work too. I just need that check in one place in my macro.
This is how I would do it.
import macros
var saveNode {.compiletime.} : NimNode
macro tester2(a : varargs[typed]) : untyped =
echo treeRepr saveNode
echo treeRepr a
macro tester(a : untyped) : untyped =
saveNode = a
result = newCall(bindSym"tester2",a[1],a[2])
var a = 5
var b = 8
tester(a|b)