summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c2
-rw-r--r--stdlib/helpers.lua11
2 files changed, 13 insertions, 0 deletions
diff --git a/main.c b/main.c
index f05a385..7c05a6a 100644
--- a/main.c
+++ b/main.c
@@ -13,6 +13,7 @@
#include "stdlib/json.h"
#include "stdlib/color.h"
#include "stdlib/button.h"
+#include "stdlib/helpers.h"
#include "fonts/dejavusans_mono_bold.h"
@@ -593,6 +594,7 @@ int main(int argc, char *argv[]) {
if (!load_embedded_module(L, json, json_len, "json")) return 1;
if (!load_embedded_module(L, color, color_len, "color")) return 1;
if (!load_embedded_module(L, button, button_len, "button")) return 1;
+ if (!load_embedded_module(L, helpers, helpers_len, "helpers")) return 1;
// Registring Raylib mappings.
lua_register(L, "open_window", l_open_window);
diff --git a/stdlib/helpers.lua b/stdlib/helpers.lua
new file mode 100644
index 0000000..bcf1418
--- /dev/null
+++ b/stdlib/helpers.lua
@@ -0,0 +1,11 @@
+function print_table(t, indent)
+ indent = indent or ""
+ for key, value in pairs(t) do
+ if type(value) == "table" then
+ print(indent .. key .. ":")
+ print_table(value, indent .. " ")
+ else
+ print(indent .. key .. ": " .. tostring(value))
+ end
+ end
+end