Skip to content

Instantly share code, notes, and snippets.

View planetis-m's full-sized avatar
🏖️
Stand-by.

Antonis Geralis planetis-m

🏖️
Stand-by.
View GitHub Profile
import macros, sets
macro lcSet(body): untyped =
# analyse the body, find the deepest expression 'it' and replace it via
# 'result.add it'
let res = genSym(nskVar, "lcResult")
proc t(n, res: NimNode): NimNode =
# Looks for the last statement of the last statement, etc...
case n.kind