From af172a8db5f7583d0117635edde17eba5619d883 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Tue, 17 May 2016 10:29:20 +0200 Subject: 2016-05-17 10:11:00 --- scripts/context/lua/mtx-patterns.lua | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-patterns.lua b/scripts/context/lua/mtx-patterns.lua index b3f5f5bb1..e8d4d3e65 100644 --- a/scripts/context/lua/mtx-patterns.lua +++ b/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 = [[ @@ -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] -- cgit v1.2.3