More robust findPragma
This commit is contained in:
parent
5e03d90ad3
commit
58a313d8eb
|
@ -18,9 +18,9 @@ const
|
||||||
|
|
||||||
proc findPragma*(pragmas: NimNode, pragmaSym: NimNode): NimNode =
|
proc findPragma*(pragmas: NimNode, pragmaSym: NimNode): NimNode =
|
||||||
for p in pragmas:
|
for p in pragmas:
|
||||||
if p.kind == nnkSym and p == pragmaSym:
|
if p.kind in {nnkSym, nnkIdent} and eqIdent(p, pragmaSym):
|
||||||
return p
|
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
|
return p
|
||||||
|
|
||||||
iterator recordFields*(typeImpl: NimNode): FieldDescription =
|
iterator recordFields*(typeImpl: NimNode): FieldDescription =
|
||||||
|
|
Loading…
Reference in New Issue