mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
enables .raises: [] via a .push (#9834) [backport]
(cherry picked from commit c74226f4c1)
This commit is contained in:
@@ -1112,6 +1112,12 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
else:
|
||||
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,
|
||||
validPragmas: TSpecialWords) =
|
||||
if sym != nil and sym.kind != skModule:
|
||||
@@ -1120,11 +1126,12 @@ proc implicitPragmas*(c: PContext, sym: PSym, n: PNode,
|
||||
if not o.isNil:
|
||||
pushInfoContext(c.config, n.info)
|
||||
var i = 0
|
||||
while i < o.len():
|
||||
while i < o.len:
|
||||
if singlePragma(c, sym, o, i, validPragmas):
|
||||
internalError(c.config, n.info, "implicitPragmas")
|
||||
inc i
|
||||
popInfoContext(c.config)
|
||||
if sym.kind in routineKinds: mergePragmas(sym.ast, o)
|
||||
|
||||
if lfExportLib in sym.loc.flags and sfExportc notin sym.flags:
|
||||
localError(c.config, n.info, ".dynlib requires .exportc")
|
||||
|
||||
Reference in New Issue
Block a user