<commit_before>var through = require('through');
var riot = require('riot');
var preamble = "var riot = require('riot');\n";

module.exports = function (file, o) {
  var opts = o || {};
  var ext = opts.ext || 'tag';
  var content = '';

  return !file.match('\.' + ext + '$') ? through() : through(
    function (chunk) { // write
      content += chunk.toString();
    },
    function () { // end
      try {
        this.queue(preamble + 'module.exports = ' + riot.compile(content, opts));
        this.emit('end');
      } catch (e) {
        this.emit('error', e);
      }
    }
  );
};<commit_msg>Passing the file name to the riot compiler<commit_after>var through = require('through');
var riot = require('riot');
var preamble = "var riot = require('riot');\n";

module.exports = function (file, o) {
  var opts = o || {};
  var ext = opts.ext || 'tag';
  var content = '';

  return !file.match('\.' + ext + '$') ? through() : through(
    function (chunk) { // write
      content += chunk.toString();
    },
    function () { // end
      try {
        this.queue(preamble + 'module.exports = ' + riot.compile(content, opts, file));
        this.emit('end');
      } catch (e) {
        this.emit('error', e);
      }
    }
  );
};
{'fraction_non_alphanumeric': 0.1990330378726833, 'fraction_numerical': 0.0, 'mean_word_length': 2.4985915492957744, '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': '7597744', 'n_tokens_mistral': 408, 'n_tokens_neox': 394, 'n_words': 100}