<commit_before>
//
// Copyright © 2017-present Kary Foundation, Inc. All rights reserved.
//   Author: <NAME> <<EMAIL>>
//
// 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/.
//

namespace KaryScriptCompiler.Nodes.Body {

    //
    // ─── GENERATE FOR BODY ──────────────────────────────────────────────────────────
    //

        export function Compile ( node: Parser.IBody, env: IEnvInfo ) {

        }

    // ────────────────────────────────────────────────────────────────────────────────

}<commit_msg>body generator seems to be implemented right<commit_after>
//
// Copyright © 2017-present Kary Foundation, Inc. All rights reserved.
//   Author: <NAME> <<EMAIL>>
//
// 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/.
//

namespace KaryScriptCompiler.Nodes.Body {

    //
    // ─── GENERATE FOR BODY ──────────────────────────────────────────────────────────
    //

        export function Compile ( node: Parser.IBody, env: IEnvInfo ) {
            // if the body is empty we should return nothing
            if ( ( node.branch as Parser.IEmpty ).type === "Empty" ) return ''

            // making the env info
            let bodyENV: IEnvInfo = Object.assign({ }, env );
            bodyENV.ScopeLevel++
            bodyENV.ParentNode.push( node )

            // if not. we have to compile each statement and add them together
            let compiledStatements = new Array<string>( );
            for ( let statement of ( node.branch as Parser.TStatements[ ] ) ) {
                compiledStatements.push(
                    KaryScriptCompiler.Nodes.CompileSingleNode( statement, env )
                )
            }

            // applying tabulation and we're done
            let result = ( env.ScopeLevel === 0 )
                ? compiledStatements.join( '\n' )
                : compiledStatements.join( '\n' )
                                    .split( '\n' )
                                    .map( x => '    ' + x )
                                    .join( '\n' )
            // done
            return result
        }

    // ────────────────────────────────────────────────────────────────────────────────

}
{'fraction_non_alphanumeric': 0.21200980392156862, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 1.9051008303677344, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7362503', 'n_tokens_mistral': 765, 'n_tokens_neox': 628, 'n_words': 208}