enables .raises: [] via a .push (#9834) [backport]
This commit is contained in:
parent
3f546b70ed
commit
c74226f4c1
1 changed files with 8 additions and 1 deletions
|
|
@ -1119,6 +1119,12 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||||
else:
|
else:
|
||||||
invalidPragma(c, it)
|
invalidPragma(c, it)
|
||||||
|
|
||||||
|
proc mergePragmas(n, pragmas: PNode) =
|
||||||
|
if n[pragmasPos].kind == nkEmpty:
|
||||||
|
n[pragmasPos] = pragmas
|
||||||
|
else:
|
||||||
|
for p in pragmas: n.sons[pragmasPos].add p
|
||||||
|
|
||||||
proc implicitPragmas*(c: PContext, sym: PSym, n: PNode,
|
proc implicitPragmas*(c: PContext, sym: PSym, n: PNode,
|
||||||
validPragmas: TSpecialWords) =
|
validPragmas: TSpecialWords) =
|
||||||
if sym != nil and sym.kind != skModule:
|
if sym != nil and sym.kind != skModule:
|
||||||
|
|
@ -1127,11 +1133,12 @@ proc implicitPragmas*(c: PContext, sym: PSym, n: PNode,
|
||||||
if not o.isNil:
|
if not o.isNil:
|
||||||
pushInfoContext(c.config, n.info)
|
pushInfoContext(c.config, n.info)
|
||||||
var i = 0
|
var i = 0
|
||||||
while i < o.len():
|
while i < o.len:
|
||||||
if singlePragma(c, sym, o, i, validPragmas):
|
if singlePragma(c, sym, o, i, validPragmas):
|
||||||
internalError(c.config, n.info, "implicitPragmas")
|
internalError(c.config, n.info, "implicitPragmas")
|
||||||
inc i
|
inc i
|
||||||
popInfoContext(c.config)
|
popInfoContext(c.config)
|
||||||
|
if sym.kind in routineKinds: mergePragmas(sym.ast, o)
|
||||||
|
|
||||||
if lfExportLib in sym.loc.flags and sfExportc notin sym.flags:
|
if lfExportLib in sym.loc.flags and sfExportc notin sym.flags:
|
||||||
localError(c.config, n.info, ".dynlib requires .exportc")
|
localError(c.config, n.info, ".dynlib requires .exportc")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue