Small fix and cosmetics
This commit is contained in:
parent
fb965719a6
commit
0b5883c21e
2 changed files with 2 additions and 8 deletions
|
|
@ -210,11 +210,6 @@ proc newCurExcAccess(ctx: var Ctx): PNode =
|
||||||
ctx.curExcSym = ctx.newEnvVar(":curExc", callCodegenProc("getCurrentException", emptyNode).typ)
|
ctx.curExcSym = ctx.newEnvVar(":curExc", callCodegenProc("getCurrentException", emptyNode).typ)
|
||||||
ctx.newEnvVarAccess(ctx.curExcSym)
|
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 =
|
proc newState(ctx: var Ctx, n, gotoOut: PNode): int =
|
||||||
# Creates a new state, adds it to the context fills out `gotoOut` so that it
|
# Creates a new state, adds it to the context fills out `gotoOut` so that it
|
||||||
# will goto this state.
|
# will goto this state.
|
||||||
|
|
@ -710,7 +705,7 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
|
||||||
n[0] = ex
|
n[0] = ex
|
||||||
result.add(n)
|
result.add(n)
|
||||||
|
|
||||||
of nkCast:
|
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
||||||
var ns = false
|
var ns = false
|
||||||
for i in 0 ..< n.len:
|
for i in 0 ..< n.len:
|
||||||
n[i] = ctx.lowerStmtListExprs(n[i], ns)
|
n[i] = ctx.lowerStmtListExprs(n[i], ns)
|
||||||
|
|
|
||||||
|
|
@ -881,9 +881,8 @@ proc liftForLoop*(body: PNode; owner: PSym): PNode =
|
||||||
cl = createClosure()
|
cl = createClosure()
|
||||||
while true:
|
while true:
|
||||||
let i = foo(cl)
|
let i = foo(cl)
|
||||||
if cl.state < 0:
|
if (nkBreakState(cl.state)):
|
||||||
break
|
break
|
||||||
# nkBreakState(cl.state)
|
|
||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
if liftingHarmful(owner): return body
|
if liftingHarmful(owner): return body
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue