<commit_before>#pragma once
using namespace std;

#include <vector>
#include <regex>
#include "IEventHandler.hpp"
#include "ICommand.hpp"
#include "Line.hpp"
#include "Utility.hpp"

namespace OCScript
{
	// OCScript̃RANXłB
	class Core
	{
	private:
		vector<ICommand*> _Commands;

		vector<Line> _ScriptStorage;
		unsigned int _CurrentLineIndex;
	public:

		// R}hǉ܂B
		// : ICommandExecutableR}h̃NX
		void AddCommand(ICommand *command)
		{
			_Commands.push_back(command);
		}

		// ɎssύX܂B
		// : s0n܂CfbNX
		void SetCurrentLineIndex(int lineIndex)
		{
			_CurrentLineIndex = lineIndex;
		}

		// XNvg ScriptStorage Ɉꊇǂݍ݂܂B
		// : s؂蕶̃xN^
		// O\̂郁\bhł
		void LoadScript(const vector<string> scriptLines)
		{
			vector<Line> lines;

			int lineIndex = 1;
			for (auto scriptLine : scriptLines)
			{
				smatch m1, m2;

				// słȂ
				if (!regex_match(scriptLine, regex("^[ \t]*$")))
				{
					m1 = smatch();

					// \Ƀ}b`
					if (regex_match(scriptLine, m1, regex("^[ \t]*([a-zA-Z0-9._-]+)[ \t]*\\((.+)\\)[ \t]*;[ \t]*$")))
					{
						string commandName = m1[1];
						string paramsStr = m1[2];

						vector<string> paramsSourceVec = Utility::StrSplit(paramsStr, ',');
						vector<string> paramsDestVec;
						int paramIndex = 1;
						for (auto paramToken : paramsSourceVec)
						{
							string content;
							m1 = smatch();
							m2 = smatch();

							// NH[gẗł
							if (regex_match(paramToken, m1, regex("^[ \t]*\"(.*)\"[ \t]*$")) || regex_match(paramToken, m2, regex("^[ \t]*\'(.*)\'[ \t]*$")))
							{
								if (!m1.empty())
									content = m1[1];
								else if (!m2.empty())
									content = m2[1];
								else
									throw exception(("VXeG[܂B}b`ʂĂ܂B(s: " + to_string(lineIndex) + ")").c_str());
							}
							else
							{
								m1 = smatch();
								if (!regex_match(paramToken, m1, regex("^[ \t]*([^ \t]*)[ \t]*$")))
									throw exception(("͎̉ɃG[܂B(s: " + to_string(lineIndex) + ", ԍ: " + to_string(paramIndex) + ")").c_str());

								content = m1[1];
							}
							paramsDestVec.push_back(content);
							paramIndex++;
						}
						lines.push_back(Line(commandName, paramsDestVec));
					}
					else
						throw exception(("\G[܂B(s: " + to_string(lineIndex) + ")").c_str());
				}
				lineIndex++;
			}
			_ScriptStorage = vector<Line>(lines);
		}

		// XNvg ScriptStorage Ɉꊇǂݍ݂܂B
		// : XNvg̕
		// O\̂郁\bhł
		void LoadScript(const string scriptText)
		{
			vector<string> scriptLines = Utility::StrSplit(scriptText, '\n');
			LoadScript(scriptLines);
		}

		// s̑ΏۂƂȂĂXNvgs܂B
		// O\̂郁\bhł
		void ExecuteCurrentLine()
		{
			if (_ScriptStorage.empty())
				throw("ScriptStorage̒głB");

			if (_CurrentLineIndex > _ScriptStorage.size() - 1)
				throw("XNvg͍Ō܂ŎsĂ܂B");

			auto line = _ScriptStorage[_CurrentLineIndex];

			for (auto command : _Commands)
				if (line.GetCommandName() == command->GetCommandName())
				{
					AccessEventArgs accessEventArgs;
					command->Access(&accessEventArgs, line.GetParams());
					if (!accessEventArgs.GetIsCancelNextCommand())
						_CurrentLineIndex++;
				}

			if (_CurrentLineIndex >= _ScriptStorage.size() - 1)
			{

			}
		}
	};
}
<commit_msg>fix arg type<commit_after>#pragma once
using namespace std;

#include <vector>
#include <regex>
#include "IEventHandler.hpp"
#include "ICommand.hpp"
#include "Line.hpp"
#include "Utility.hpp"

namespace OCScript
{
	// OCScript̃RANXłB
	class Core
	{
	private:
		vector<ICommand*> _Commands;

		vector<Line> _ScriptStorage;
		unsigned int _CurrentLineIndex;
	public:

		// R}hǉ܂B
		// : ICommandExecutableR}h̃NX
		void AddCommand(ICommand *command)
		{
			_Commands.push_back(command);
		}

		// ɎssύX܂B
		// : s0n܂CfbNX
		void SetCurrentLineIndex(unsigned int lineIndex)
		{
			_CurrentLineIndex = lineIndex;
		}

		// XNvg ScriptStorage Ɉꊇǂݍ݂܂B
		// : s؂蕶̃xN^
		// O\̂郁\bhł
		void LoadScript(const vector<string> scriptLines)
		{
			vector<Line> lines;

			int lineIndex = 1;
			for (auto scriptLine : scriptLines)
			{
				smatch m1, m2;

				// słȂ
				if (!regex_match(scriptLine, regex("^[ \t]*$")))
				{
					m1 = smatch();

					// \Ƀ}b`
					if (regex_match(scriptLine, m1, regex("^[ \t]*([a-zA-Z0-9._-]+)[ \t]*\\((.+)\\)[ \t]*;[ \t]*$")))
					{
						string commandName = m1[1];
						string paramsStr = m1[2];

						vector<string> paramsSourceVec = Utility::StrSplit(paramsStr, ',');
						vector<string> paramsDestVec;
						int paramIndex = 1;
						for (auto paramToken : paramsSourceVec)
						{
							string content;
							m1 = smatch();
							m2 = smatch();

							// NH[gẗł
							if (regex_match(paramToken, m1, regex("^[ \t]*\"(.*)\"[ \t]*$")) || regex_match(paramToken, m2, regex("^[ \t]*\'(.*)\'[ \t]*$")))
							{
								if (!m1.empty())
									content = m1[1];
								else if (!m2.empty())
									content = m2[1];
								else
									throw exception(("VXeG[܂B}b`ʂĂ܂B(s: " + to_string(lineIndex) + ")").c_str());
							}
							else
							{
								m1 = smatch();
								if (!regex_match(paramToken, m1, regex("^[ \t]*([^ \t]*)[ \t]*$")))
									throw exception(("͎̉ɃG[܂B(s: " + to_string(lineIndex) + ", ԍ: " + to_string(paramIndex) + ")").c_str());

								content = m1[1];
							}
							paramsDestVec.push_back(content);
							paramIndex++;
						}
						lines.push_back(Line(commandName, paramsDestVec));
					}
					else
						throw exception(("\G[܂B(s: " + to_string(lineIndex) + ")").c_str());
				}
				lineIndex++;
			}
			_ScriptStorage = vector<Line>(lines);
		}

		// XNvg ScriptStorage Ɉꊇǂݍ݂܂B
		// : XNvg̕
		// O\̂郁\bhł
		void LoadScript(const string scriptText)
		{
			vector<string> scriptLines = Utility::StrSplit(scriptText, '\n');
			LoadScript(scriptLines);
		}

		// s̑ΏۂƂȂĂXNvgs܂B
		// O\̂郁\bhł
		void ExecuteCurrentLine()
		{
			if (_ScriptStorage.empty())
				throw("ScriptStorage̒głB");

			if (_CurrentLineIndex > _ScriptStorage.size() - 1)
				throw("XNvg͍Ō܂ŎsĂ܂B");

			auto line = _ScriptStorage[_CurrentLineIndex];

			for (auto command : _Commands)
				if (line.GetCommandName() == command->GetCommandName())
				{
					AccessEventArgs accessEventArgs;
					command->Access(&accessEventArgs, line.GetParams());
					if (!accessEventArgs.GetIsCancelNextCommand())
						_CurrentLineIndex++;
				}

			if (_CurrentLineIndex >= _ScriptStorage.size() - 1)
			{

			}
		}
	};
}

{'fraction_non_alphanumeric': 0.18158730158730158, 'fraction_numerical': 0.009206349206349206, 'mean_word_length': 2.7108362779740873, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 31, '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': '2240647', 'n_tokens_mistral': 3170, 'n_tokens_neox': 2475, 'n_words': 419}