summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/lua/mtx-check.lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/scripts/context/lua/mtx-check.lua
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua/mtx-check.lua')
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-check.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-check.lua b/Master/texmf-dist/scripts/context/lua/mtx-check.lua
index 6be7f276597..4266ddf0d46 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-check.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-check.lua
@@ -40,6 +40,8 @@ do
local l_s, r_s = P("["), P("]")
local l_g, r_g = P("{"), P("}")
+ local okay = lpeg.P("{[}") + lpeg.P("{]}")
+
local esc = P("\\")
local cr = P("\r")
local lf = P("\n")
@@ -72,7 +74,7 @@ do
["tokens"] = (V("ignore") + V("whatever") + V("grouped") + V("setup") + V("display") + V("inline") + V("errors") + 1)^0,
["whatever"] = line + esc * 1 + C(P("%") * (1-line)^0),
["grouped"] = l_g * (V("whatever") + V("grouped") + V("setup") + V("display") + V("inline") + (1 - l_g - r_g))^0 * r_g,
- ["setup"] = l_s * (V("whatever") + V("grouped") + V("setup") + V("display") + V("inline") + (1 - l_s - r_s))^0 * r_s,
+ ["setup"] = l_s * (okay + V("whatever") + V("grouped") + V("setup") + V("display") + V("inline") + (1 - l_s - r_s))^0 * r_s,
["display"] = d_m * (V("whatever") + V("grouped") + (1 - d_m))^0 * d_m,
["inline"] = i_m * (V("whatever") + V("grouped") + (1 - i_m))^0 * i_m,
["errors"] = (V("gerror")+ V("serror") + V("derror") + V("ierror")),
@@ -103,8 +105,10 @@ function scripts.checker.check(filename)
local str = io.loaddata(filename)
if str then
validator.check(str)
- if #validator.errors > 0 then
- for k, v in ipairs(validator.errors) do
+ local errors = validator.errors
+ if #errors > 0 then
+ for k=1,#errors do
+ local v = errors[k]
local kind, position, line = v[1], v[2], v[3]
local data = str:sub(position-30,position+30)
data = data:gsub("(.)", {
@@ -123,7 +127,7 @@ function scripts.checker.check(filename)
end
end
-logs.extendbanner("Syntax Checking 0.10",true)
+logs.extendbanner("Basic ConTeXt Syntax Checking 0.10",true)
messages.help = [[
--convert check tex file for errors