minor breaking change: for loop bodies now get their own scope
This commit is contained in:
parent
eee43e4f8f
commit
4e4d466d06
4 changed files with 14 additions and 0 deletions
|
|
@ -335,8 +335,10 @@ proc semGenericStmt(c: PContext, n: PNode,
|
|||
n.sons[L - 2] = semGenericStmt(c, n.sons[L-2], flags, ctx)
|
||||
for i in countup(0, L - 3):
|
||||
addTempDecl(c, n.sons[i], skForVar)
|
||||
openScope(c)
|
||||
n.sons[L - 1] = semGenericStmt(c, n.sons[L-1], flags, ctx)
|
||||
closeScope(c)
|
||||
closeScope(c)
|
||||
of nkBlockStmt, nkBlockExpr, nkBlockType:
|
||||
checkSonsLen(n, 2)
|
||||
openScope(c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue