// Path: src/main/java/com/redhat/ceylon/compiler/js/BlockWithCaptureVisitor.java
// public class BlockWithCaptureVisitor extends Visitor {
// 
//     private boolean hasCapture;
//     private final Scope scope;
// 
//     public BlockWithCaptureVisitor(Tree.Block block) {
//         scope = ModelUtil.getRealScope(block.getScope());
//         block.visit(this);
//     }
// 
//     public void visit(Tree.Declaration that) {
//         if (that.getDeclarationModel() != null && that.getDeclarationModel().isCaptured()) {
//             hasCapture |= scope == ModelUtil.getRealScope(that.getDeclarationModel().getScope());
//         }
//         super.visit(that);
//     }
// 
//     public void visit(Tree.BaseMemberExpression that) {
//         if (that.getDeclaration() != null && that.getDeclaration().isCaptured()) {
//             hasCapture |= scope == ModelUtil.getRealScope(that.getDeclaration().getScope());
//         }
//         super.visit(that);
//     }
// 
//     public boolean hasCapture() {
//         return hasCapture;
//     }
// }


import java.util.IdentityHashMap;
import com.redhat.ceylon.compiler.js.BlockWithCaptureVisitor;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;
import com.redhat.ceylon.model.typechecker.model.Scope;
package com.redhat.ceylon.compiler.js.util;



public class ContinueBreakVisitor extends Visitor {

    private boolean breaks;
    private boolean continues;
    private boolean returns;
    private final Scope scope;
    private final JsIdentifierNames names;
    private String bname;
    private String cname;
    private String rname;
    private int level;
    private boolean ignore;
    private final IdentityHashMap<Tree.Directive, Boolean> dirs = new IdentityHashMap<>();

    public ContinueBreakVisitor(Tree.Block n, JsIdentifierNames names) {
        scope = n.getScope();
        this.names = names;
        n.visit(this);
    }

    public void visit(Tree.Block that) {
        level++;
        if (level>1) {
// Path: src/main/java/com/redhat/ceylon/compiler/js/BlockWithCaptureVisitor.java
// public class BlockWithCaptureVisitor extends Visitor {
// 
//     private boolean hasCapture;
//     private final Scope scope;
// 
//     public BlockWithCaptureVisitor(Tree.Block block) {
//         scope = ModelUtil.getRealScope(block.getScope());
//         block.visit(this);
//     }
// 
//     public void visit(Tree.Declaration that) {
//         if (that.getDeclarationModel() != null && that.getDeclarationModel().isCaptured()) {
//             hasCapture |= scope == ModelUtil.getRealScope(that.getDeclarationModel().getScope());
//         }
//         super.visit(that);
//     }
// 
//     public void visit(Tree.BaseMemberExpression that) {
//         if (that.getDeclaration() != null && that.getDeclaration().isCaptured()) {
//             hasCapture |= scope == ModelUtil.getRealScope(that.getDeclaration().getScope());
//         }
//         super.visit(that);
//     }
// 
//     public boolean hasCapture() {
//         return hasCapture;
//     }
// }


// Path: src/main/java/com/redhat/ceylon/compiler/js/util/ContinueBreakVisitor.java
import java.util.IdentityHashMap;
import com.redhat.ceylon.compiler.js.BlockWithCaptureVisitor;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;
import com.redhat.ceylon.model.typechecker.model.Scope;

package com.redhat.ceylon.compiler.js.util;



public class ContinueBreakVisitor extends Visitor {

    private boolean breaks;
    private boolean continues;
    private boolean returns;
    private final Scope scope;
    private final JsIdentifierNames names;
    private String bname;
    private String cname;
    private String rname;
    private int level;
    private boolean ignore;
    private final IdentityHashMap<Tree.Directive, Boolean> dirs = new IdentityHashMap<>();

    public ContinueBreakVisitor(Tree.Block n, JsIdentifierNames names) {
        scope = n.getScope();
        this.names = names;
        n.visit(this);
    }

    public void visit(Tree.Block that) {
        level++;
        if (level>1) {
            ignore=new BlockWithCaptureVisitor(that).hasCapture();