<commit_before>#!/usr/bin/env node

var esprima = require('../third_party/esprima/esprima.js');

function main() {
    process.stdin.resume();
    process.stdin.setEncoding('utf8');

    console.log('Waiting for standard input...');
    process.stdin.on('end', handleStdInEnd);
}

function handleStdInEnd() {
    console.log('Standard input ended.');
    var source = process.stdin.read();
    console.log('Source read from standard input.');

    console.log('Parsing...');
    var obj = esprima.parse(source);

    console.log('Parsing complete.');

    console.log('Writing resulting JSON to standard output');
    process.stdout.write(JSON.stringify(obj))
}

main();<commit_msg>Turn on comment, line, and column options for esprima.<commit_after>#!/usr/bin/env node

var esprima = require('../third_party/esprima/esprima.js');

function main() {
    process.stdin.resume();
    process.stdin.setEncoding('utf8');

    console.log('Waiting for standard input...');
    process.stdin.on('end', handleStdInEnd);
}

function handleStdInEnd() {
    console.log('Standard input ended.');
    var source = process.stdin.read();
    console.log('Source read from standard input.');

    console.log('Parsing...');
    var obj = esprima.parse(source, {
	'loc': true,
	'range': true,
	'comment': true
    });

    console.log('Parsing complete.');

    console.log('Writing resulting JSON to standard output');
    process.stdout.write(JSON.stringify(obj))
}

main();
{'fraction_non_alphanumeric': 0.1676933607118412, 'fraction_numerical': 0.0013689253935660506, 'mean_word_length': 3.7934426229508196, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2803390', 'n_tokens_mistral': 465, 'n_tokens_neox': 460, 'n_words': 97}