From 58a313d8eb5750dc9b1c9f7f0bdebb08fb5023d3 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 5 Jun 2019 03:14:54 +0300 Subject: [PATCH] More robust findPragma --- std_shims/macros_shim.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std_shims/macros_shim.nim b/std_shims/macros_shim.nim index fe354d7..c301a00 100644 --- a/std_shims/macros_shim.nim +++ b/std_shims/macros_shim.nim @@ -18,9 +18,9 @@ const proc findPragma*(pragmas: NimNode, pragmaSym: NimNode): NimNode = for p in pragmas: - if p.kind == nnkSym and p == pragmaSym: + if p.kind in {nnkSym, nnkIdent} and eqIdent(p, pragmaSym): return p - if p.kind in nnkPragmaCallKinds and p.len > 0 and p[0].kind == nnkSym and p[0] == pragmaSym: + if p.kind in nnkPragmaCallKinds and p.len > 0 and eqIdent(p[0], pragmaSym): return p iterator recordFields*(typeImpl: NimNode): FieldDescription =