<commit_before>var templater = require('tiny-templater'),
    dotpather = require('dotpather'),
    regex = /{%\s*([\w\d\s\-\.]*)\s*%}/;

function Parser(tags, template) {
  
  
}

Parser.prototype.parse = function (obj) {

}

Parser.prototype.lookup = dotpather;

Parser.prototype.render = function (obj) {
  
}

function language(tags) {

  return function (template) {

    var parser = new Parser(tags, template);

    return function (obj) {

      return parser.render(obj);

    }<commit_msg>trying a simple approach<commit_after>var templater = require('tiny-templater'),
    dotpather = require('dotpather'),
    regex = /{%\s*([\w\d\s\-\.]*)\s*%}/;

function Parser(tags, template) {

  this.tags = tags;
  this.finalParts = [];
  this.position = 0;
  this.template = template;

}

Parser.prototype.parse = function (obj) {
  if (true) {
  }
}

Parser.prototype.lookup = dotpather;

Parser.prototype.render = function doRender(obj) {
  
  var hasStatement = this.template.substring(this.position).match(regex);

  if (!hasStatement) {
    return this.finalParts.join('');
  }
  var nextStatement = hasStatement[1],
      nextTag = nextStatement.split(/\s+/)[0];

  if (this.tags.indexOf(nextTag) !== -1) {
    var piece = this.tags[nextTag](parser, nextStatement);
    this.finalPieces.push(piece(obj));
  }

  doRender(obj);

}

function language(tags) {

  return function (template) {

    var parser = new Parser(tags, template);

    return function (obj) {

      return parser.render(obj);

    }
{'fraction_non_alphanumeric': 0.16457369464639787, 'fraction_numerical': 0.0026437541308658294, 'mean_word_length': 3.3884057971014494, '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': '5051250', 'n_tokens_mistral': 531, 'n_tokens_neox': 511, 'n_words': 99}