<commit_before>/*

Rimu

By: <NAME>
https://github.com/srackham/rimu

*/

/*
## Modularization

- This application uses Internal TypeScript modules and is compiled to a single rimu.js
  JavaScript file.
 - rimu.js can be used in the browser using a script tag or can be used in Nodejs using require().
- Rimu API functions are explicitly exported to Nodejs with the exportCommonjs() helper.
- Other internal objects are exported to Nodejs for use by nodeunit unit tests.
- To mimimize browser global namespace pollution and to disallow run-time access to internal
  objects all source is enveloped in a single open module named Rimu.

See http://srackham.wordpress.com/2012/11/20/building-heterogeneous-typescript-libraries/
*/

/// <reference path="references.ts" />

module Rimu {

  // Rimu public API.
  export function render(source: string, options: Options.Values = {}): string {
    Options.update(options);
    return renderSource(source);
  }

  // Same as render() but does not update options.
  export function renderSource(source: string): string {
    var reader = new Reader(source);
    var writer = new Writer();
    while (!reader.eof()) {
      reader.skipBlankLines();
      if (reader.eof()) break;
      if (LineBlocks.render(reader, writer)) continue;
      if (Lists.render(reader, writer)) continue;
      if (DelimitedBlocks.render(reader, writer)) continue;
      throw 'no matching delimited block found';
    }
    return writer.toString();
  }

}

// Export Rimu API.
Rimu.exportCommonjs({render: Rimu.render});

this.Rimu = Rimu; // Fix Meteor 0.6.0 var scope incompatibility.
<commit_msg>Added tslint support (base tslint.json containing all rules).<commit_after>/*

Rimu

By: <NAME>
https://github.com/srackham/rimu

*/

/*
## Modularization

- This application uses Internal TypeScript modules and is compiled to a single rimu.js
  JavaScript file.
 - rimu.js can be used in the browser using a script tag or can be used in Nodejs using require().
- Rimu API functions are explicitly exported to Nodejs with the exportCommonjs() helper.
- Other internal objects are exported to Nodejs for use by nodeunit unit tests.
- To minimize browser global namespace pollution and to disallow run-time access to internal
  objects all source is enveloped in a single open module named Rimu.

See http://srackham.wordpress.com/2012/11/20/building-heterogeneous-typescript-libraries/
*/

/// <reference path="references.ts" />

module Rimu {

  // Rimu public API.
  export function render(source: string, options: Options.Values = {}): string {
    Options.update(options);
    return renderSource(source);
  }

  // Same as render() but does not update options.
  export function renderSource(source: string): string {
    var reader = new Reader(source);
    var writer = new Writer();
    while (!reader.eof()) {
      reader.skipBlankLines();
      if (reader.eof()) break;
      if (LineBlocks.render(reader, writer)) continue;
      if (Lists.render(reader, writer)) continue;
      if (DelimitedBlocks.render(reader, writer)) continue;
      throw 'no matching delimited block found';
    }
    return writer.toString();
  }

}

// Export Rimu API.
Rimu.exportCommonjs({render: Rimu.render});

this.Rimu = Rimu; // Fix Meteor 0.6.0 var scope incompatibility.

{'fraction_non_alphanumeric': 0.10462287104622871, 'fraction_numerical': 0.006690997566909975, 'mean_word_length': 3.5554016620498614, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5120663', 'n_tokens_mistral': 998, 'n_tokens_neox': 946, 'n_words': 345}