diff options
author | Araq <rumpf_a@web.de> | 2017-09-05 01:03:45 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-09-05 01:03:45 +0200 |
commit | c02159dde43f6d04e33eb273c336732d557074b5 (patch) | |
tree | e4bf4111b1783c76e819b51cb3485390362a8126 /compiler | |
parent | 21e22624a21b7ace0ba8e11aab7e7df583aa0c1e (diff) | |
parent | d539eb53b523dc0e6d1da8f5736592e7739bc20b (diff) | |
download | Nim-c02159dde43f6d04e33eb273c336732d557074b5.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cgen.nim | 10 | ||||
-rw-r--r-- | compiler/ropes.nim | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 39c14347b..b618837c7 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -215,7 +215,7 @@ proc genLineDir(p: BProc, t: PNode) = {optLineTrace, optStackTrace}) and (p.prc == nil or sfPure notin p.prc.flags) and tt.info.fileIndex >= 0: if freshLineInfo(p, tt.info): - linefmt(p, cpsStmts, "nimln_($1, $2);$N", + linefmt(p, cpsStmts, "nimln_($1, $2);$n", line.rope, tt.info.quotedFilename) proc postStmtActions(p: BProc) {.inline.} = @@ -394,7 +394,8 @@ proc assignLocalVar(p: BProc, s: PSym) = #assert(s.loc.k == locNone) # not yet assigned # this need not be fulfilled for inline procs; they are regenerated # for each module that uses them! - let decl = localVarDecl(p, s) & ";" & tnl + let nl = if optLineDir in gOptions: "" else: tnl + let decl = localVarDecl(p, s) & ";" & nl line(p, cpsLocals, decl) localDebugInfo(p, s) @@ -627,11 +628,11 @@ proc initFrame(p: BProc, procname, filename: Rope): Rope = discard cgsym(p.module, "nimFrame") if p.maxFrameLen > 0: discard cgsym(p.module, "VarSlot") - result = rfmt(nil, "\tnimfrs_($1, $2, $3, $4)$N", + result = rfmt(nil, "\tnimfrs_($1, $2, $3, $4);$n", procname, filename, p.maxFrameLen.rope, p.blocks[0].frameLen.rope) else: - result = rfmt(nil, "\tnimfr_($1, $2)$N", procname, filename) + result = rfmt(nil, "\tnimfr_($1, $2);$n", procname, filename) proc deinitFrame(p: BProc): Rope = result = rfmt(p.module, "\t#popFrame();$n") @@ -1311,6 +1312,7 @@ proc myProcess(b: PPassContext, n: PNode): PNode = if b == nil or passes.skipCodegen(n): return var m = BModule(b) m.initProc.options = initProcOptions(m) + softRnl = if optLineDir in gOptions: noRnl else: rnl genStmts(m.initProc, n) proc finishModule(m: BModule) = diff --git a/compiler/ropes.nim b/compiler/ropes.nim index d84b59f78..358ce8a53 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -228,6 +228,7 @@ proc prepend*(a: var Rope, b: string) = a = b & a var rnl* = tnl.newRope softRnl* = tnl.newRope + noRnl* = "".newRope proc `%`*(frmt: FormatStr, args: openArray[Rope]): Rope = var i = 0 |