mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 05:53:22 +00:00
Small fix and cosmetics
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user