<commit_before>var util = require('util');
var fs = require('fs');
var PEG = require('pegjs');
var ccs = require('./ccs.js');

var grammar = fs.readFileSync('./src/ccs_grammar.pegjs').toString();
var parser = PEG.buildParser(grammar);

var cmdText = process.argv.slice(2).join(" ");

if (cmdText.trim() !== "") {
	var cmdAst = parser.parse(cmdText, {astNodes: ccs.CCSNode});
	logObjectDeep(cmdAst);

	console.log("\nLabelled bracket notation: \n")
	console.log(labelledBracketNotation(cmdAst));
}
else 
    console.log("No css arguments");

function logObjectDeep(obj) {
	console.log(util.inspect(obj, false, null));
}

//You can use:
// http://ironcreek.net/phpsyntaxtree/?
function labelledBracketNotation(process) {
	var node = ccs.CCSNode,
		lbl = labelledBracketNotation;
	switch (process.type) {
		case node.Program:<commit_msg>stavefejl<commit_after>var util = require('util');
var fs = require('fs');
var PEG = require('pegjs');
var ccs = require('./ccs.js');

var grammar = fs.readFileSync('./src/ccs_grammar.pegjs').toString();
var parser = PEG.buildParser(grammar);

var cmdText = process.argv.slice(2).join(" ");

if (cmdText.trim() !== "") {
	var cmdAst = parser.parse(cmdText, {astNodes: ccs.CCSNode});
	logObjectDeep(cmdAst);

	console.log("\nLabelled bracket notation: \n")
	console.log(labelledBracketNotation(cmdAst));
}
else 
    console.log("No ccs arguments");

function logObjectDeep(obj) {
	console.log(util.inspect(obj, false, null));
}

//You can use:
// http://ironcreek.net/phpsyntaxtree/?
function labelledBracketNotation(process) {
	var node = ccs.CCSNode,
		lbl = labelledBracketNotation;
	switch (process.type) {
		case node.Program:
{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.001201923076923077, 'mean_word_length': 5.189591078066915, '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': '2912331', 'n_tokens_mistral': 614, 'n_tokens_neox': 582, 'n_words': 115}