summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/context/data/scite/scite-ctx.lua
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
commit15995e10bfc68edf79970c4ea4fbb6678566c46e (patch)
tree2de7ca2a83f2d37ef043ad7429a5cb945bb79ddb /Master/texmf-dist/context/data/scite/scite-ctx.lua
parentc9a39f716f1e5ec820ed3aab2c9aef25c5a9d730 (diff)
ConTeXt 2012.05.14 16:00
git-svn-id: svn://tug.org/texlive/trunk@26371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/context/data/scite/scite-ctx.lua')
-rw-r--r--Master/texmf-dist/context/data/scite/scite-ctx.lua28
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