<commit_before>'use strict';

var parser = new (require('./ast').Parser)();
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});


function loop() {
    rl.question('$>: ', function(answer) {
        if (answer == 'q') {
            rl.close();
            process.exit();
        }

        console.log(parser.fromSource(answer));
        console.log(parser.fromSource(answer).Eval());
        loop();
    });
};

loop();
<commit_msg>in repl, don't die on errors<commit_after>'use strict';

var parser = new (require('./ast').Parser)();
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});


function loop() {
    rl.question('$>: ', function(answer) {
        if (answer == 'q') {
            rl.close();
            process.exit();
        }

        try {
            console.log(parser.fromSource(answer));
            console.log(parser.fromSource(answer).Eval());
        } catch (e) {
            console.log(e, Object.keys(e));
        }
        loop();
    });
};

loop();

{'fraction_non_alphanumeric': 0.18117854001759015, 'fraction_numerical': 0.0, 'mean_word_length': 2.317784256559767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7667562', 'n_tokens_mistral': 350, 'n_tokens_neox': 340, 'n_words': 68}