diff options
author | Araq <rumpf_a@web.de> | 2018-09-03 12:27:23 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-09-03 12:27:23 +0200 |
commit | 1abef2dc59e812f7aee41620bf5cd298f5cc8270 (patch) | |
tree | 188c21370eb3086fe25706bb38814575b8f9635c /compiler/renderer.nim | |
parent | 6261309d1b329537d8b968c8d9a9d7ae0be36178 (diff) | |
download | Nim-1abef2dc59e812f7aee41620bf5cd298f5cc8270.tar.gz |
improve the error message for 'addQuitProc' etc; fixes #5794
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r-- | compiler/renderer.nim | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 8a25d76e8..a8f3f4afc 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -752,7 +752,8 @@ proc gproc(g: var TSrcGen, n: PNode) = gsub(g, n.sons[genericParamsPos]) g.inGenericParams = oldInGenericParams gsub(g, n.sons[paramsPos]) - gsub(g, n.sons[pragmasPos]) + if renderNoPragmas notin g.flags: + gsub(g, n.sons[pragmasPos]) if renderNoBody notin g.flags: if n.sons[bodyPos].kind != nkEmpty: put(g, tkSpaces, Space) @@ -1297,17 +1298,16 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = putWithSpace(g, tkContinue, "continue") gsub(g, n, 0) of nkPragma: - if renderNoPragmas notin g.flags: - if g.inPragma <= 0: - inc g.inPragma - #if not previousNL(g): - put(g, tkSpaces, Space) - put(g, tkCurlyDotLe, "{.") - gcomma(g, n, emptyContext) - put(g, tkCurlyDotRi, ".}") - dec g.inPragma - else: - gcomma(g, n, emptyContext) + if g.inPragma <= 0: + inc g.inPragma + #if not previousNL(g): + put(g, tkSpaces, Space) + put(g, tkCurlyDotLe, "{.") + gcomma(g, n, emptyContext) + put(g, tkCurlyDotRi, ".}") + dec g.inPragma + else: + gcomma(g, n, emptyContext) of nkImportStmt, nkExportStmt: if n.kind == nkImportStmt: putWithSpace(g, tkImport, "import") |