diff options
author | Marius <mariausol@gmail.com> | 2011-09-14 13:40:13 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-09-14 13:40:13 +0300 |
commit | a39b448f695e8f4ce44c909a493d83643e8227cc (patch) | |
tree | 2594f7ef5b6b1e704c7315549eed040a17781764 /context/data/scite/scite-ctx.lua | |
parent | 79f4f6dcc36ebeec36914f7dbcbf35f0f7a8fcae (diff) | |
download | context-a39b448f695e8f4ce44c909a493d83643e8227cc.tar.gz |
beta 2011.09.14 12:21
Diffstat (limited to 'context/data/scite/scite-ctx.lua')
-rw-r--r-- | context/data/scite/scite-ctx.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/context/data/scite/scite-ctx.lua b/context/data/scite/scite-ctx.lua index fb10ce87d..72fcb967c 100644 --- a/context/data/scite/scite-ctx.lua +++ b/context/data/scite/scite-ctx.lua @@ -68,7 +68,7 @@ -- generic functions -props = props or { } setmetatable(props,{ __index = function(k,v) props[k] = "unknown" return "unknown" end } ) +props = props or { } -- setmetatable(props,{ __index = function(k,v) props[k] = "unknown" return "unknown" end } ) local byte, lower, upper, gsub, sub, find, rep, match, gmatch = string.byte, string.lower, string.upper, string.gsub, string.sub, string.find, string.rep, string.match, string.gmatch local sort, concat = table.sort, table.concat @@ -80,20 +80,20 @@ function traceln(str) io.flush() end -function string:grab(delimiter) - local list = {} - for snippet in self:gmatch(delimiter) do +function string.grab(str,delimiter) + local list = { } + for snippet in gmatch(str,delimiter) do list[#list+1] = snippet end return list end -function string:expand() - return (self:gsub("ENV%((%w+)%)", os.envvar)) +function string.expand(str) + return (gsub(str,"ENV%((%w+)%)", os.envvar)) end -function string:strip() - return (self:gsub("^%s*(.-)%s*$", "%1")) +function string.strip(str) + return (gsub(str,"^%s*(.-)%s*$", "%1")) end function table.alphasort(list,i) |