improve error messages quality for '.push: raises []'
This commit is contained in:
parent
5cd18b0f24
commit
40115cd645
1 changed files with 7 additions and 0 deletions
|
|
@ -1123,7 +1123,14 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||||
else:
|
else:
|
||||||
invalidPragma(c, it)
|
invalidPragma(c, it)
|
||||||
|
|
||||||
|
proc overwriteLineInfo(n: PNode; info: TLineInfo) =
|
||||||
|
n.info = info
|
||||||
|
for i in 0..<safeLen(n):
|
||||||
|
overwriteLineInfo(n[i], info)
|
||||||
|
|
||||||
proc mergePragmas(n, pragmas: PNode) =
|
proc mergePragmas(n, pragmas: PNode) =
|
||||||
|
var pragmas = copyTree(pragmas)
|
||||||
|
overwriteLineInfo pragmas, n.info
|
||||||
if n[pragmasPos].kind == nkEmpty:
|
if n[pragmasPos].kind == nkEmpty:
|
||||||
n[pragmasPos] = pragmas
|
n[pragmasPos] = pragmas
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue