Shorten JS block code (#20370)
This commit is contained in:
parent
97259a5ab3
commit
7a756bfaef
1 changed files with 4 additions and 4 deletions
|
|
@ -971,12 +971,12 @@ proc genBlock(p: PProc, n: PNode, r: var TCompRes) =
|
|||
sym.loc.k = locOther
|
||||
sym.position = idx+1
|
||||
let labl = p.unique
|
||||
lineF(p, "Label$1: do {$n", [labl.rope])
|
||||
lineF(p, "Label$1: {$n", [labl.rope])
|
||||
setLen(p.blocks, idx + 1)
|
||||
p.blocks[idx].id = - p.unique # negative because it isn't used yet
|
||||
gen(p, n[1], r)
|
||||
setLen(p.blocks, idx)
|
||||
lineF(p, "} while (false);$n", [labl.rope])
|
||||
lineF(p, "};$n", [labl.rope])
|
||||
|
||||
proc genBreakStmt(p: PProc, n: PNode) =
|
||||
var idx: int
|
||||
|
|
@ -2426,9 +2426,9 @@ proc genProcBody(p: PProc, prc: PSym): Rope =
|
|||
else:
|
||||
result = nil
|
||||
if p.beforeRetNeeded:
|
||||
result.add p.indentLine(~"BeforeRet: do {$n")
|
||||
result.add p.indentLine(~"BeforeRet: {$n")
|
||||
result.add p.body
|
||||
result.add p.indentLine(~"} while (false);$n")
|
||||
result.add p.indentLine(~"};$n")
|
||||
else:
|
||||
result.add(p.body)
|
||||
if prc.typ.callConv == ccSysCall:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue