summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua')
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-context.lua2
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-patterns.lua23
2 files changed, 13 insertions, 12 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-context.lua b/Master/texmf-dist/scripts/context/lua/mtx-context.lua
index a5f01cebc1f..84254d5700c 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-context.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-context.lua
@@ -108,7 +108,7 @@ local function restart(engine_old,engine_new)
local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline())
report(format("redirect %s -> %s: %s",engine_old,engine_new,command))
local result = os.execute(command)
- os.exit(result)
+ os.exit(result == 0 and 0 or 1)
end
if getargument("redirected") then
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua b/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua
index b3f5f5bb144..e8d4d3e6537 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-patterns.lua
@@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['mtx-patterns'] = {
local format, find, concat, gsub, match, gmatch = string.format, string.find, table.concat, string.gsub, string.match, string.gmatch
local byte, char = utf.byte, utf.char
local addsuffix = file.addsuffix
-local lpegmatch, validutf8 = lpeg.match, lpeg.patterns.validutf8
+local lpegmatch, lpegsplit, lpegpatterns, validutf8 = lpeg.match, lpeg.split, lpeg.patterns, lpeg.patterns.validutf8
+local P, V, Cs = lpeg.P, lpeg.V, lpeg.Cs
local helpinfo = [[
<?xml version="1.0"?>
@@ -165,7 +166,7 @@ scripts.patterns.list = {
local utf = unicode.utf8
function utf.check(str)
- return lpeg.match(lpeg.patterns.validutf8,str)
+ return lpegmatch(lpegpatterns.validutf8,str)
end
-- *.tex
@@ -214,9 +215,9 @@ function scripts.patterns.load(path,name,mnemonic,ignored)
end
if okay then
-- split into lines
- local how = lpeg.patterns.whitespace^1
- splitpatternsnew = lpeg.split(how,patterns)
- splithyphenationsnew = lpeg.split(how,hyphenations)
+ local how = lpegpatterns.whitespace^1
+ splitpatternsnew = lpegsplit(how,patterns)
+ splithyphenationsnew = lpegsplit(how,hyphenations)
end
if okay then
-- remove comments
@@ -316,23 +317,23 @@ function scripts.patterns.load(path,name,mnemonic,ignored)
if ignored then
for k, v in next, ignored do
if p then
- p = p + lpeg.P(char(k))
+ p = p + P(char(k))
else
- p = lpeg.P(char(k))
+ p = P(char(k))
end
end
- p = lpeg.P{ p + 1 * lpeg.V(1) } -- anywhere
+ p = P{ p + 1 * V(1) } -- anywhere
end
-- replaced (all languages)
local r = nil
for k, v in next, replaced_whatever do
if r then
- r = r + lpeg.P(k)/v
+ r = r + P(k)/v
else
- r = lpeg.P(k)/v
+ r = P(k)/v
end
end
- r = lpeg.Cs((r + 1)^0)
+ r = Cs((r + 1)^0)
local result = { }
for i=1,#what do
local line = what[i]