<commit_before>/**
 * Provides methods for compiling and manipulating DarwinBots dna
 * source code.
 * @module Parser
 **/

var parse   = require('./parser.js'),
    Result  = require('object-result'),
    ok      = Result.createOk,
    err     = Result.createErr;

/**
 * Compiles the given DNA source code into an executable javascript function.
 * @param {String} sourceAsString - The DNA source code.
 * @return {Result} Ok value is the function that executes the dna, Err value
 *                  is an error message describing why compilation failed.
 **/
module.exports.compileSource = function(sourceAsString) {
  return parse(sourceAsString);
};
<commit_msg>updated parser index to use the new parser implemenation<commit_after>/**
 * Provides methods for compiling and manipulating DarwinBots dna
 * source code.
 * @module Parser
 **/

var parse   = require('./parser.js'),
    manager = require('./sourceManager.js');

/**
 * Compiles the given DNA source code into an executable javascript function.
 * @param {String} sourceAsString - The DNA source code.
 * @return {Result} Ok value is the function that executes the dna, Err value
 *                  is an error message describing why compilation failed.
 **/
module.exports.compileSource = function(sourceAsString) {
  return parser.parseDna(manager(sourceAsString));
};

{'fraction_non_alphanumeric': 0.10059612518628912, 'fraction_numerical': 0.0, 'mean_word_length': 3.568027210884354, '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': '2315491', 'n_tokens_mistral': 364, 'n_tokens_neox': 349, 'n_words': 134}