@@ -221,12 +221,12 @@ module Trees {
221221 final override predicate succEntry ( Ast n , Completion c ) { n = this and completionIsSimple ( c ) }
222222 }
223223
224- class NamedBlockTree extends StandardPostOrderTree instanceof NamedBlock {
224+ class NamedBlockTree extends StandardPreOrderTree instanceof NamedBlock {
225225 // TODO: Handle trap
226- override AstNode getChildNode ( int i ) { result = super .getStatement ( i ) }
226+ override AstNode getChildNode ( int i ) { result = super .getStmt ( i ) }
227227 }
228228
229- class AssignStmtTree extends StandardPostOrderTree instanceof AssignStmt {
229+ class AssignStmtTree extends StandardPreOrderTree instanceof AssignStmt {
230230 override AstNode getChildNode ( int i ) {
231231 i = 0 and result = super .getLeftHandSide ( )
232232 or
@@ -348,6 +348,11 @@ module Trees {
348348 last ( this .getBody ( ) , pred , c ) and
349349 completionIsNormal ( c ) and
350350 first ( super .getIterator ( ) , succ )
351+ or
352+ // Iterator -> condition
353+ last ( super .getIterator ( ) , pred , c ) and
354+ completionIsNormal ( c ) and
355+ first ( super .getCondition ( ) , succ )
351356 }
352357 }
353358
@@ -381,7 +386,7 @@ module Trees {
381386 completionIsSimple ( c )
382387 or
383388 // Variable declaration to body
384- last ( super .getVarAccess ( ) , succ , c ) and
389+ last ( super .getVarAccess ( ) , pred , c ) and
385390 completionIsNormal ( c ) and
386391 first ( this .getBody ( ) , succ )
387392 or
0 commit comments