<commit_before>'use strict';

module.exports = ['$scope', 'sim', 'run', 'log', 'codeMirror',
  function($scope, sim, run, log, codeMirror) {
    // init delay at 500ms
    $scope.delay = 500;

    // run button pressed (play / step)
    $scope.run = function(status) {
      // check for input errors
      var lines;
      if (lines = codeMirror.hasErrors()) {
        log('','separator');
        log('LOG_COMPILATION_FAILED', 'error');
        // log problematic lines numbers
        for(var i in lines) log('LOG_SYNTAX_ERROR', (+lines[i] + 1));
        log('','separator');
        return;
      }
      // update status and startup the simulation
      sim.status = status;
      run.begin($scope.delay);
      console.log(status);
      log('LOG_RUNNING', ((status == 1) ? 'success' : 'step'));
    };

    // 'pause' button pressed
    $scope.pause = function() {
      sim.status = 3;
      run.stop();
      log('LOG_PAUSED');
    };

    // 'stop' button pressed
    $scope.stop = function() {
      run.stop();
      log('LOG_STOPPED');
      run.clear();
      sim.status = sim.step = sim.pc.val = 0;
      log('LOG_RESET');
    };

    // watch for delay changes
    $scope.delayChanged = function() {
      if (run.isRunning()) {
        run.stop();
        run.begin($scope.delay);
      }
    };
  }
];<commit_msg>Remove debug console log<commit_after>'use strict';

module.exports = ['$scope', 'sim', 'run', 'log', 'codeMirror',
  function($scope, sim, run, log, codeMirror) {
    // init delay at 500ms
    $scope.delay = 500;

    // run button pressed (play / step)
    $scope.run = function(status) {
      // check for input errors
      var lines;
      if (lines = codeMirror.hasErrors()) {
        log('','separator');
        log('LOG_COMPILATION_FAILED', 'error');
        // log problematic lines numbers
        for(var i in lines) log('LOG_SYNTAX_ERROR', (+lines[i] + 1));
        log('','separator');
        return;
      }
      // update status and startup the simulation
      sim.status = status;
      run.begin($scope.delay);
      log('LOG_RUNNING', ((status == 1) ? 'success' : 'step'));
    };

    // 'pause' button pressed
    $scope.pause = function() {
      sim.status = 3;
      run.stop();
      log('LOG_PAUSED');
    };

    // 'stop' button pressed
    $scope.stop = function() {
      run.stop();
      log('LOG_STOPPED');
      run.clear();
      sim.status = sim.step = sim.pc.val = 0;
      log('LOG_RESET');
    };

    // watch for delay changes
    $scope.delayChanged = function() {
      if (run.isRunning()) {
        run.stop();
        run.begin($scope.delay);
      }
    };
  }
];
{'fraction_non_alphanumeric': 0.17157974300831444, 'fraction_numerical': 0.007558578987150416, 'mean_word_length': 2.166267942583732, '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': '6935545', 'n_tokens_mistral': 864, 'n_tokens_neox': 823, 'n_words': 198}