package/block.js
function format(node, context, recur) {
    var blockComments = context.blockComments(node);

    for (var i = 0; i < node.body.length; i++) {
        var previous = node.body[i - 1];
        var current = node.body[i];
        var next = node.body[i + 1];

        if (current.type === 'EmptyStatement') {
            continue;}


        if (newlines.extraNewLineBetween(previous, current)) {
            context.write('\n');}


        context.write(blockComments.printLeading(current, previous));
        context.write(context.getIndent());
        recur(current);
        context.write(utils.getLineTerminator(current));
        context.write(blockComments.printTrailing(current, previous, next));

        if (next) {
            context.write('\n');}}}
function format(node, context, recur) {
    var blockComments = context.blockComments(node);

    for (var i = 0; i < node.body.length; i++) {
        var previous = node.body[i - 1];
        var current = node.body[i];
        var next = node.body[i + 1];

        if (current.type === 'EmptyStatement') {
            continue;}


        if (newlines.extraNewLineBetween(previous, current)) {
            context.write('\n');}


        context.write(blockComments.printLeading(current, previous));
        context.write(context.getIndent());
        recur(current);
        context.write(utils.getLineTerminator(current));
        context.write(blockComments.printTrailing(current, previous, next));

        if (next) {
            context.write('\n');}}}
function format ( node , context , recur ) { var blockComments = context . blockComments ( node ) ; for ( var i = 0 ; i < node . body . length ; i ++ ) { var previous = node . body [ i - 1 ] ; var current = node . body [ i ] ; var next = node . body [ i + 1 ] ; if ( current . type === 'EmptyStatement' ) { continue ; } if ( newlines . extraNewLineBetween ( previous , current ) ) { context . write ( '\n' ) ; } context . write ( blockComments . printLeading ( current , previous ) ) ; context . write ( context . getIndent ( ) ) ; recur ( current ) ; context . write ( utils . getLineTerminator ( current ) ) ; context . write ( blockComments . printTrailing ( current , previous , next ) ) ; if ( next ) { context . write ( '\n' ) ; } } }
Shared block formatting function

@param {Object} node Program or BlockStatement
@param {Object} context
@param {Function} recur
Shared block formatting function