<commit_before>#include <configure/bind.hpp>
#include <configure/bind/path_utils.hpp>

#include <configure/Build.hpp>
#include <configure/Rule.hpp>
#include <configure/lua/State.hpp>
#include <configure/lua/Type.hpp>
#include <configure/Filesystem.hpp>
#include <configure/Platform.hpp>

#include <boost/filesystem/path.hpp>

namespace fs = boost::filesystem;

namespace configure {

	template<typename T>
	static int Build_option(lua_State* state)
	{
		Build& self = lua::Converter<std::reference_wrapper<Build>>::extract(state, 1);
		auto name = lua::Converter<std::string>::extract(state, 2);
		auto descr = lua::Converter<std::string>::extract(state, 3);
		if (lua_gettop(state) == 3)
		{
			auto res = self.option<T>(std::move(name), std::move(descr));
			if (res)
				lua::Converter<T>::push(state, *res);
			else
				lua_pushnil(state);
		}
		else
		{
			lua::Converter<T>::push(
			    state,
				self.option<T>(
					std::move(name),
					std::move(descr),
					lua::Converter<T>::extract(state, 4)
				)
			);
		}
		return 1;
	}<commit_msg>Accept nil default value for build options.<commit_after>#include <configure/bind.hpp>
#include <configure/bind/path_utils.hpp>

#include <configure/Build.hpp>
#include <configure/Rule.hpp>
#include <configure/lua/State.hpp>
#include <configure/lua/Type.hpp>
#include <configure/Filesystem.hpp>
#include <configure/Platform.hpp>

#include <boost/filesystem/path.hpp>

namespace fs = boost::filesystem;

namespace configure {

	template<typename T>
	static int Build_option(lua_State* state)
	{
		Build& self = lua::Converter<std::reference_wrapper<Build>>::extract(state, 1);
		auto name = lua::Converter<std::string>::extract(state, 2);
		auto descr = lua::Converter<std::string>::extract(state, 3);
		if (lua_gettop(state) == 4 && !lua_isnil(state, 4))
		{
			lua::Converter<T>::push(
			    state,
				self.option<T>(
					std::move(name),
					std::move(descr),
					lua::Converter<T>::extract(state, 4)
				)
			);
		}
		else
		{
			auto res = self.option<T>(std::move(name), std::move(descr));
			if (res)
				lua::Converter<T>::push(state, *res);
			else
				lua_pushnil(state);
		}
		return 1;
	}
{'fraction_non_alphanumeric': 0.1731662024141133, 'fraction_numerical': 0.0060352831940575676, 'mean_word_length': 4.686015831134565, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '1978869', 'n_tokens_mistral': 866, 'n_tokens_neox': 749, 'n_words': 136}