<commit_before>'use strict'

class ControlFlow {

    static update(node) {

        node instanceof Executable ? node.execute() : node.calculate();

    };

    constructor(node) {

        this.node = node;
        this.exeOut = node.exeDocks.out;

    };

    execute() {

        const stream = new Stream(this.node.root);

        do {

            stream.calculate();

        } while (stream.next());

    };

}

class Stream {

    constructor(root) {

        this.nodes = [ root ];

    }

    get current() {

        return this.nodes[ this.nodes.length - 1 ];

    }

    set current(nextNode) {

        this.nodes.push(nextNode);

    };

    calculate() {

        this.current.calculate();

    };

    next() {

        const exeDocks = this.current.exeDocks.out;
        if (exeDocks.length && exeDocks[0].links.length) {

            return this.current = exeDocks[0].links[0].endDock.node;

        }

    };

}<commit_msg>moved class Stream in seperate file<commit_after>'use strict'

class ControlFlow {

    static update(node) {

        // <? check for cycles
        // const cycleDetected = ~data.propagationTree.indexOf(node);

        _(`[ControlFlow on ${node.id}]`);

        node instanceof Executable ? node.execute() : node.calculate();

    };

    constructor(node) {

        this.node = node;
        this.exeOut = node.exeDocks.out;

    };

    execute() {

        const stream = new Stream(this.node.root);

        do {

            stream.calculate();

        } while (stream.next());

    };

}
{'fraction_non_alphanumeric': 0.13692407527579495, 'fraction_numerical': 0.0025957170668397143, 'mean_word_length': 1.8555555555555556, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '1036966', 'n_tokens_mistral': 512, 'n_tokens_neox': 460, 'n_words': 90}