Small fix and cosmetics

This commit is contained in:
Yuriy Glukhov
2018-05-08 09:39:58 +03:00
parent fb965719a6
commit 0b5883c21e
2 changed files with 2 additions and 8 deletions

View File

@@ -210,11 +210,6 @@ proc newCurExcAccess(ctx: var Ctx): PNode =
ctx.curExcSym = ctx.newEnvVar(":curExc", callCodegenProc("getCurrentException", emptyNode).typ)
ctx.newEnvVarAccess(ctx.curExcSym)
proc setStateInAssgn(stateAssgn: PNode, stateNo: int) =
assert stateAssgn.kind == nkAsgn
assert stateAssgn[1].kind == nkIntLit
stateAssgn[1].intVal = stateNo
proc newState(ctx: var Ctx, n, gotoOut: PNode): int =
# Creates a new state, adds it to the context fills out `gotoOut` so that it
# will goto this state.
@@ -710,7 +705,7 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
n[0] = ex
result.add(n)
of nkCast:
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv:
var ns = false
for i in 0 ..< n.len:
n[i] = ctx.lowerStmtListExprs(n[i], ns)

View File

@@ -881,9 +881,8 @@ proc liftForLoop*(body: PNode; owner: PSym): PNode =
cl = createClosure()
while true:
let i = foo(cl)
if cl.state < 0:
if (nkBreakState(cl.state)):
break
# nkBreakState(cl.state)
...
"""
if liftingHarmful(owner): return body