aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-14 15:54:44 +1000
committerDavid Walter Seikel2014-05-14 15:54:44 +1000
commit859839dd9a93af045f95189c039b17191ab9f988 (patch)
treeaa428e470606b2266add9bd2223e1b06b83fa3f2 /lib
parentComment out some excess compiler warnings. (diff)
downloadSledjHamr-859839dd9a93af045f95189c039b17191ab9f988.zip
SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.gz
SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.bz2
SledjHamr-859839dd9a93af045f95189c039b17191ab9f988.tar.xz
Get list appending and adding to work.
Diffstat (limited to 'lib')
-rw-r--r--lib/LSL.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/LSL.lua b/lib/LSL.lua
index 695c05d..092c3d9 100644
--- a/lib/LSL.lua
+++ b/lib/LSL.lua
@@ -871,5 +871,46 @@ function LSL.gimmeLSL()
871 end 871 end
872end 872end
873 873
874-- Misc support functions.
875
876function LSL.listAddList(a, b)
877 local i = 1
878 local result = {}
879
880 for j, v in ipairs(a) do
881 i = i + 1
882 table.insert(result, i, v)
883 end
884
885 for j, v in ipairs(b) do
886 i = i + 1
887 table.insert(result, i, v)
888 end
889
890 return result;
891end
892
893function LSL.listAdd(a, b)
894 local i = 1
895 local result = {}
896
897 for j, v in ipairs(a) do
898 i = i + 1
899 table.insert(result, i, v)
900 end
901
902 table.insert(result, i, b)
903
904 return result;
905end
906
907function LSL.listConcat(a, b)
908 local i = table.maxn(a)
909 local result = a
910
911 table.insert(result, i + 1, b)
912
913 return result;
914end
874 915
875return LSL; 916return LSL;