This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |