<commit_before>/******************************************************************************\
* MakeLuaFunction.hpp                                                          *
* Macros (yes, macros) to create 'lua_CFunctions' from slightly more friendly  *
* functions taking (and possibly returning) 'LuaValue's.                       *
* <NAME>                                                         *
\******************************************************************************/

#ifndef _DILUCULUM_MAKE_LUA_FUNCTION_HPP_
#define _DILUCULUM_MAKE_LUA_FUNCTION_HPP_

#include <Diluculum/LuaValue.hpp>
#include <Diluculum/LuaUtils.hpp>

namespace Diluculum
{
   namespace Impl
   {
      /** Issues a Lua error (by calling \c lua_error()) if a given condition
       *  is true.
       *  @param ls The Lua state on which \c lua_error() will possibly be
       *         called.
       *  @param condition The error will be raised only if this is \c true.
       *  @param function The function name as available in Lua. This is used
       *         only to give some additional information to the error message.
       *  @param message An error message that will be associated with the
       *         generated error
       */
      void MLF_IssueLuaErrorIf (lua_State* ls, bool condition,
                                const std::string& function,
                                const std::string& message);

      /** Reads the parameters passed to a function. The parameters are read<commit_msg>Just added a missing dot in a Doxygen comment.<commit_after>/******************************************************************************\
* MakeLuaFunction.hpp                                                          *
* Macros (yes, macros) to create 'lua_CFunctions' from slightly more friendly  *
* functions taking (and possibly returning) 'LuaValue's.                       *
* <NAME>                                                         *
\******************************************************************************/

#ifndef _DILUCULUM_MAKE_LUA_FUNCTION_HPP_
#define _DILUCULUM_MAKE_LUA_FUNCTION_HPP_

#include <Diluculum/LuaValue.hpp>
#include <Diluculum/LuaUtils.hpp>

namespace Diluculum
{
   namespace Impl
   {
      /** Issues a Lua error (by calling \c lua_error()) if a given condition
       *  is true.
       *  @param ls The Lua state on which \c lua_error() will possibly be
       *         called.
       *  @param condition The error will be raised only if this is \c true.
       *  @param function The function name as available in Lua. This is used
       *         only to give some additional information to the error message.
       *  @param message An error message that will be associated with the
       *         generated error.
       */
      void MLF_IssueLuaErrorIf (lua_State* ls, bool condition,
                                const std::string& function,
                                const std::string& message);

      /** Reads the parameters passed to a function. The parameters are read
{'fraction_non_alphanumeric': 0.16164921465968587, 'fraction_numerical': 0.0, 'mean_word_length': 2.0723618090452263, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3382972', 'n_tokens_mistral': 756, 'n_tokens_neox': 710, 'n_words': 265}