@@ -107,7 +107,7 @@ proc getPragmaVal*(procAst: PNode; name: TSpecialWord): PNode =
107107 return it[1 ]
108108
109109proc pragma * (c: PContext , sym: PSym , n: PNode , validPragmas: TSpecialWords ;
110- isStatement: bool = false )
110+ isStatement: bool = false ; comesFromPush = false )
111111
112112proc recordPragma (c: PContext ; n: PNode ; args: varargs [string ]) =
113113 var recorded = newNodeI (nkReplayAction, n.info)
@@ -893,7 +893,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
893893 if keyDeep:
894894 localError (c.config, it.info, " user pragma cannot have arguments" )
895895
896- pragma (c, sym, userPragma.ast, validPragmas, isStatement)
896+ pragma (c, sym, userPragma.ast, validPragmas, isStatement, comesFromPush )
897897 n.sons[i.. i] = userPragma.ast.sons # expand user pragma with its content
898898 i.inc (userPragma.ast.len - 1 ) # inc by -1 is ok, user pragmas was empty
899899 else :
@@ -1405,11 +1405,12 @@ proc pragmaRec(c: PContext, sym: PSym, n: PNode, validPragmas: TSpecialWords;
14051405 inc i
14061406
14071407proc pragma (c: PContext , sym: PSym , n: PNode , validPragmas: TSpecialWords ;
1408- isStatement: bool ) =
1408+ isStatement: bool ; comesFromPush = false ) =
14091409 if n == nil : return
14101410 pragmaRec (c, sym, n, validPragmas, isStatement)
14111411 # XXX: in the case of a callable def, this should use its info
1412- implicitPragmas (c, sym, n.info, validPragmas)
1412+ if not comesFromPush:
1413+ implicitPragmas (c, sym, n.info, validPragmas)
14131414
14141415proc pragmaCallable * (c: PContext , sym: PSym , n: PNode , validPragmas: TSpecialWords ,
14151416 isStatement: bool = false ) =
0 commit comments