<commit_before>/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.javascript.ast;

import org.mozilla.javascript.Node;
import org.mozilla.javascript.Token;

/**
 * A block statement delimited by curly braces.  The node position is the
 * position of the open-curly, and the length extends to the position of
 * the close-curly.  Node type is {@link Token#BLOCK}.
 *
 * <pre><i>Block</i> :
 *     <b>{</b> Statement* <b>}</b></pre>
 */
public class Block extends AstNode {

    {
        this.type = Token.BLOCK;
    }

    public Block() {
    }

    public Block(int pos) {
        super(pos);
    }

    public Block(int pos, int len) {
        super(pos, len);
    }

    /**
     * Clones the AstNode.     
     * @return The clone of the AstNode.
     * @throws CloneNotSupportedException 
     */
    @Override
    public AstNode clone(AstNode parent) {
    	
    	/* Get the shallow clone. */
    	Block clone = (Block)super.clone();
    	clone.setParent(parent);
    	
    	/* Clone the children. */
    	clone.removeChildren();
    	
    	/* Clone the children and add them. */
    	for(Node c : this) {
    		AstNode child = (AstNode) c;
    		clone.addChild(child.clone(clone));
    	}
    	
    	return clone;

    }

    /**
     * Alias for {@link #addChild}.
     */
    public void addStatement(AstNode statement) {
        addChild(statement);
    }

    @Override
    public String toSource(int depth) {
        StringBuilder sb = new StringBuilder();
        sb.append(makeIndent(depth));
        sb.append("{\n");
        for (Node kid : this) {
            sb.append(((AstNode)kid).toSource(depth+1));
        }
        sb.append(makeIndent(depth));
        sb.append("}\n");
        return sb.toString();
    }

    @Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (Node kid : this) {
                ((AstNode)kid).visit(v);
            }
        }
    }

	@Override
	public boolean isStatement() {
		return false;
	}
}
<commit_msg>Made a Block AstNode return true for isStatement().<commit_after>/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.javascript.ast;

import org.mozilla.javascript.Node;
import org.mozilla.javascript.Token;

/**
 * A block statement delimited by curly braces.  The node position is the
 * position of the open-curly, and the length extends to the position of
 * the close-curly.  Node type is {@link Token#BLOCK}.
 *
 * <pre><i>Block</i> :
 *     <b>{</b> Statement* <b>}</b></pre>
 */
public class Block extends AstNode {

    {
        this.type = Token.BLOCK;
    }

    public Block() {
    }

    public Block(int pos) {
        super(pos);
    }

    public Block(int pos, int len) {
        super(pos, len);
    }

    /**
     * Clones the AstNode.     
     * @return The clone of the AstNode.
     * @throws CloneNotSupportedException 
     */
    @Override
    public AstNode clone(AstNode parent) {
    	
    	/* Get the shallow clone. */
    	Block clone = (Block)super.clone();
    	clone.setParent(parent);
    	
    	/* Clone the children. */
    	clone.removeChildren();
    	
    	/* Clone the children and add them. */
    	for(Node c : this) {
    		AstNode child = (AstNode) c;
    		clone.addChild(child.clone(clone));
    	}
    	
    	return clone;

    }

    /**
     * Alias for {@link #addChild}.
     */
    public void addStatement(AstNode statement) {
        addChild(statement);
    }

    @Override
    public String toSource(int depth) {
        StringBuilder sb = new StringBuilder();
        sb.append(makeIndent(depth));
        sb.append("{\n");
        for (Node kid : this) {
            sb.append(((AstNode)kid).toSource(depth+1));
        }
        sb.append(makeIndent(depth));
        sb.append("}\n");
        return sb.toString();
    }

    @Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (Node kid : this) {
                ((AstNode)kid).visit(v);
            }
        }
    }

	@Override
	public boolean isStatement() {
		return true;
	}
}

{'fraction_non_alphanumeric': 0.13211694877995164, 'fraction_numerical': 0.003077599472411519, 'mean_word_length': 2.0722484807562456, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1678135', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1420, 'n_words': 397}