aboutsummaryrefslogtreecommitdiff
path: root/utils.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-21 21:11:13 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-21 21:11:13 -0700
commit26d72ce56ed1e9066edfbb3fedd8f5570d0cb5f4 (patch)
tree539761e2fc96f20579b106cec99bf0634dfe0708 /utils.moon
parente478b33d7abba5933ddfcc60558585b58b898bff (diff)
Overhaul of invocations/specs. Much cleaner and more consistent now,
with less code duplication.
Diffstat (limited to 'utils.moon')
-rw-r--r--utils.moon6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.moon b/utils.moon
index 3b3573c..f267c7d 100644
--- a/utils.moon
+++ b/utils.moon
@@ -41,6 +41,12 @@ utils = {
split: (str, sep="%s")->
[chunk for chunk in str\gmatch("[^#{sep}]+")]
+ remove_from_list: (list, item)->
+ for i,list_item in ipairs(list)
+ if list_item == item
+ table.remove list, i
+ return
+
accumulate: (glue, co)->
if co == nil then glue, co = "", glue
bits = {}