diff options
Diffstat (limited to 'Master/texmf-dist/context/data/scite/scite-ctx.lua')
-rw-r--r-- | Master/texmf-dist/context/data/scite/scite-ctx.lua | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Master/texmf-dist/context/data/scite/scite-ctx.lua b/Master/texmf-dist/context/data/scite/scite-ctx.lua index 8e6b6ebab74..3557994f383 100644 --- a/Master/texmf-dist/context/data/scite/scite-ctx.lua +++ b/Master/texmf-dist/context/data/scite/scite-ctx.lua @@ -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) @@ -516,7 +516,7 @@ local worddone = 0 -- end -- end -function check_text() +function check_text() -- obsolete, replaced by lexer local dlanguage = props["ctx.spellcheck.language"] local dwordsize = props["ctx.spellcheck.wordsize"] @@ -836,3 +836,15 @@ menufunctions[14] = process_template_two function open_log() scite.Open(props['FileName'] .. ".log") end + +if not lpeg then + + local okay, root = pcall(function() return require "lpeg" end) + + if okay then + lpeg = root + else + trace("\nwarning: lpeg not loaded\n") + end + +end |