aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--LuaSL/src/LSL.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index 8774121..82f7205 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -30,6 +30,32 @@ upvalue--either way is a bit more efficient and less error prone.
30 30
31local LSL = {}; 31local LSL = {};
32 32
33
34-- Debugging aids
35
36-- Functions to print tables.
37local print_table, print_table_start;
38
39function print_table_start(table, space, name)
40 print(space .. name .. ": ");
41 print(space .. "{");
42 print_table(table, space .. " ");
43 print(space .. "}");
44end
45
46function print_table(table, space)
47 for k, v in pairs(table) do
48 if type(v) == "table" then
49 print_table_start(v, space, k);
50 elseif type(v) == "string" then
51 print(space .. k .. ': "' .. v .. '";')
52 else
53 print(space .. k .. ": " .. v .. ";")
54 end
55 end
56end
57
58
33-- LSL constants. 59-- LSL constants.
34 60
35LSL.PI = 3.14159265358979323846264338327950; 61LSL.PI = 3.14159265358979323846264338327950;