<commit_before>/*
 * Application logic
 */
var Logic = {
  parser: PEG.buildParser(" \
    start = logic* \
    logic = q:query a:action ' '* { return {query:Query.compile(q), action:CoffeeScript.eval('-> ' + a.trim().replace(/^\{/, '').replace(/\}$/, '')) } }  \
    query = q:[^{]+ { return q.join('').trim() } \
    action = block:curly { return block } \
    curly = curly:('{' ([^{}]+ / curly)+ '}') { return curly.flatten().join('') } \
  "),

  compile: function(logics) {
    return this.parser.parse(logics).map(function(logic) {
      logic.apply = function() {
        var entities = World.queryRaw(this.query);
        for (var i = 0; i < entities.length; i++)
          this.action.call(entities[i]);
      }

      return logic;
    });
  },
<commit_msg>Start work on braceless logic blocks<commit_after>/*
 * Application logic
 */
var Logic = {
  parser: PEG.buildParser(" \
    start = logic* \
    logic = comment? q:query a:action ' '* { return {query:Query.compile(q), action:CoffeeScript.eval('-> ' + a.replace(/^\{/, '').replace(/\}$/, '')) } }  \
    query = q:[^{\\n]+ { return q.join('').trim() } \
    action = block:(curly / indented) { return block } \
    curly = curly:('{' ([^{}]+ / curly)+ '}') { return curly.flatten().join('') } \
    indented = '\\n' indented:indented_line+ ('\\n' / !.) { return '\\n  ' + indented.join('\\n  ') } \
    indented_line = '  ' line:[^\\n]+ ('\\n' / !.) { return line.join('') } \
    comment = '/*' (!'*/' .)* '*/' white / ('//'/'#') [^\\n]* '\\n' white \
    white = [\\n  ]* \
  "),

  compile: function(logics) {
    return this.parser.parse(logics).map(function(logic) {
      logic.apply = function() {
        var entities = World.queryRaw(this.query);
        for (var i = 0; i < entities.length; i++)
          this.action.call(entities[i]);
      }

      return logic;
    });
  },

{'fraction_non_alphanumeric': 0.2432723358449946, 'fraction_numerical': 0.001076426264800861, 'mean_word_length': 2.4553903345724906, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2683266', 'n_tokens_mistral': 675, 'n_tokens_neox': 645, 'n_words': 124}