Async macro fixes (#5739)

This commit is contained in:
Yuriy Glukhov 2017-05-16 23:09:19 +03:00 • committed by Andreas Rumpf
commit 6599cae281
3 changed files with 30 additions and 20 deletions

View file

@ -982,6 +982,9 @@ proc semProcAnnotation(c: PContext, prc: PNode;
var x = newNodeI(nkCall, n.info)
x.add(newSymNode(m))
prc.sons[pragmasPos] = copyExcept(n, i)
if prc[pragmasPos].kind != nkEmpty and prc[pragmasPos].len == 0:
prc.sons[pragmasPos] = emptyNode
if it.kind == nkExprColonExpr:
# pass pragma argument to the macro too:
x.add(it.sons[1])