<commit_before>#include <string>
#include <forward_list>

#include "Option.h"
#include "Token.h"
#include "Compiler.h"

#include "FatalErrorCode.h"
#include "ErrorHandler.h"

namespace lyrics
{
	using std::u16string;
	using std::forward_list;

	const u16string Tokenizer::BREAK = u"break";
	const u16string Tokenizer::CASE = u"case";
	const u16string Tokenizer::CLASS = u"class";
	const u16string Tokenizer::DO = u"do";
	const u16string Tokenizer::END = u"end";
	const u16string Tokenizer::ELSE = u"else";
	const u16string Tokenizer::ELSEIF = u"elseif";
	const u16string Tokenizer::FALSE = u"false";
	const u16string Tokenizer::FOR = u"for";
	const u16string Tokenizer::FOREACH = u"foreach";
	const u16string Tokenizer::IF = u"if";
	const u16string Tokenizer::IMPORT = u"import";
	const u16string Tokenizer::IN = u"in";
	const u16string Tokenizer::INCLUDE = u"include";
	const u16string Tokenizer::NEXT = u"next";
	const u16string Tokenizer::NULL_TOKEN = u"null";
	const u16string Tokenizer::OUT = u"out";
	const u16string Tokenizer::PACKAGE = u"package";
	const u16string Tokenizer::PRIVATE = u"private";
	const u16string Tokenizer::PUBLIC = u"public";
	const u16string Tokenizer::RETURN = u"return";
	const u16string Tokenizer::ROUTINE = u"routine";
	const u16string Tokenizer::THEN = u"then";
	const u16string Tokenizer::THIS = u"this";
	const u16string Tokenizer::TRUE = u"true";
	const u16string Tokenizer::WHEN = u"when";
	const u16string Tokenizer::WHILE = u"while";

	constexpr char ErrorHandler::WARNING[];
	constexpr char ErrorHandler::ERROR[];
	constexpr char ErrorHandler::FATAL_ERROR[];
}

int main( int argc, char *argv[] )
{
	using lyrics::Option;
	using lyrics::Compiler;

	const Option option = Option( argc, argv );

	try
	{
		if ( !Compiler().Compile( option ) )
		{
			// TODO:
			return 1;
		}
	}
	catch ( lyrics::FatalErrorCode &fatalErrorCode )
	{
		lyrics::ErrorHandler::FatalError( fatalErrorCode );

		return 1;
	}

	return 0;
}
<commit_msg>Use const to catch fatal error code<commit_after>#include <string>
#include <forward_list>

#include "Option.h"
#include "Token.h"
#include "Compiler.h"

#include "FatalErrorCode.h"
#include "ErrorHandler.h"

namespace lyrics
{
	using std::u16string;
	using std::forward_list;

	const u16string Tokenizer::BREAK = u"break";
	const u16string Tokenizer::CASE = u"case";
	const u16string Tokenizer::CLASS = u"class";
	const u16string Tokenizer::DO = u"do";
	const u16string Tokenizer::END = u"end";
	const u16string Tokenizer::ELSE = u"else";
	const u16string Tokenizer::ELSEIF = u"elseif";
	const u16string Tokenizer::FALSE = u"false";
	const u16string Tokenizer::FOR = u"for";
	const u16string Tokenizer::FOREACH = u"foreach";
	const u16string Tokenizer::IF = u"if";
	const u16string Tokenizer::IMPORT = u"import";
	const u16string Tokenizer::IN = u"in";
	const u16string Tokenizer::INCLUDE = u"include";
	const u16string Tokenizer::NEXT = u"next";
	const u16string Tokenizer::NULL_TOKEN = u"null";
	const u16string Tokenizer::OUT = u"out";
	const u16string Tokenizer::PACKAGE = u"package";
	const u16string Tokenizer::PRIVATE = u"private";
	const u16string Tokenizer::PUBLIC = u"public";
	const u16string Tokenizer::RETURN = u"return";
	const u16string Tokenizer::ROUTINE = u"routine";
	const u16string Tokenizer::THEN = u"then";
	const u16string Tokenizer::THIS = u"this";
	const u16string Tokenizer::TRUE = u"true";
	const u16string Tokenizer::WHEN = u"when";
	const u16string Tokenizer::WHILE = u"while";

	constexpr char ErrorHandler::WARNING[];
	constexpr char ErrorHandler::ERROR[];
	constexpr char ErrorHandler::FATAL_ERROR[];
}

int main( int argc, char *argv[] )
{
	using lyrics::Option;
	using lyrics::Compiler;

	const Option option = Option( argc, argv );

	try
	{
		if ( !Compiler().Compile( option ) )
		{
			// TODO:
			return 1;
		}
	}
	catch ( const lyrics::FatalErrorCode &fatalErrorCode )
	{
		lyrics::ErrorHandler::FatalError( fatalErrorCode );

		return 1;
	}

	return 0;
}

{'fraction_non_alphanumeric': 0.1337708228167592, 'fraction_numerical': 0.02978293791014639, 'mean_word_length': 5.694256756756757, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4521561', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1365, 'n_words': 345}