<commit_before>/* Main function definition for vecomp program */

#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>

#include "../headers/ErrorReporter.hpp"
#include "../headers/FileReader.hpp"
#include "../headers/Parser.hpp"
#include "../headers/main.hpp"

using namespace std;


int main(int argc, char** argv)
{
  ErrorReporter* errorReporter = nullptr;

  if (argc == 2)
  {
#ifdef DEBUG
    cout << argc << " "  << argv[0] << " " << argv[1] << endl;
#endif
    errorReporter = ErrorReporter::getInstance();
    FileReader* fileReader = FileReader::getInstance();

    errorReporter->setFileReader(fileReader);
    fileReader->setErrorReporter(errorReporter);

    fileReader->readFile(argv[1]);

    Parser parser(fileReader, errorReporter);
    parser.parse();

    if (errorReporter->getErrors() > 0)
    {
      errorReporter->endErrorsFile();
    }
  }
  else
  {
    cerr << "error: se esperaba un nombre de archivo a compilar" << endl;
    cerr << "uso:   vecomp <archivo>" << endl;
  }

  int returnValue;
  if (errorReporter == nullptr)
  {
    returnValue = EXIT_FAILURE;
  }
  else
  {
    returnValue = errorReporter->getErrors() == 0 ? EXIT_SUCCESS :
        EXIT_FAILURE;
  }
  
  return returnValue;
}

<commit_msg>added call to ending of errors out<commit_after>/* Main function definition for vecomp program */

#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>

#include "../headers/ErrorReporter.hpp"
#include "../headers/FileReader.hpp"
#include "../headers/Parser.hpp"
#include "../headers/main.hpp"

using namespace std;


int main(int argc, char** argv)
{
  ErrorReporter* errorReporter = nullptr;

  if (argc == 2)
  {
#ifdef DEBUG
    cout << argc << " "  << argv[0] << " " << argv[1] << endl;
#endif
    errorReporter = ErrorReporter::getInstance();
    FileReader* fileReader = FileReader::getInstance();

    errorReporter->setFileReader(fileReader);
    fileReader->setErrorReporter(errorReporter);

    fileReader->readFile(argv[1]);

    Parser parser(fileReader, errorReporter);
    parser.parse();
  }
  else
  {
    cerr << "error: se esperaba un nombre de archivo a compilar" << endl;
    cerr << "uso:   vecomp <archivo>" << endl;
  }

  int returnValue;
  if (errorReporter == nullptr)
  {
    returnValue = EXIT_FAILURE;
  }
  else
  {
    returnValue = errorReporter->getErrors() == 0 ? EXIT_SUCCESS :
        EXIT_FAILURE;
  }
  
  return returnValue;
}


{'fraction_non_alphanumeric': 0.14518760195758565, 'fraction_numerical': 0.004486133768352365, 'mean_word_length': 3.5174953959484347, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 24, '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': '6095652', 'n_tokens_mistral': 823, 'n_tokens_neox': 803, 'n_words': 188}