format: reformat project

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-03 19:53:48 +03:00
committed by Pugemon
parent 736cd175d5
commit bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
+13 -13
View File
@@ -1,25 +1,25 @@
#include "api_lua.hpp"
#include <iostream>
#include "api_lua.hpp"
/// @brief Modified version of luaB_print from lbaselib.c
int l_print(lua::State* L) {
int n = lua::gettop(L); /* number of arguments */
int n = lua::gettop(L); /* number of arguments */
lua::getglobal(L, "tostring");
for (int i=1; i<=n; i++) {
lua::pushvalue(L, -1); /* function to be called */
lua::pushvalue(L, i); /* value to print */
for (int i = 1; i <= n; i++) {
lua::pushvalue(L, -1); /* function to be called */
lua::pushvalue(L, i); /* value to print */
lua::call(L, 1, 1);
const char* s = lua::tostring(L, -1); /* get result */
const char* s = lua::tostring(L, -1); /* get result */
if (s == NULL)
return luaL_error(L, LUA_QL("tostring") " must return a string to "
LUA_QL("print"));
if (i > 1)
std::cout << "\t";
return luaL_error(
L,
LUA_QL("tostring") " must return a string to " LUA_QL("print")
);
if (i > 1) std::cout << "\t";
std::cout << s;
lua::pop(L); /* pop result */
lua::pop(L); /* pop result */
}
std::cout << std::endl;
return 0;
}