diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-patterns.lua | 48 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 30 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 30 | ||||
-rw-r--r-- | scripts/context/stubs/unix/mtxrun | 30 | ||||
-rw-r--r-- | scripts/context/stubs/win64/mtxrun.lua | 30 |
5 files changed, 113 insertions, 55 deletions
diff --git a/scripts/context/lua/mtx-patterns.lua b/scripts/context/lua/mtx-patterns.lua index d37019f70..36b60192d 100644 --- a/scripts/context/lua/mtx-patterns.lua +++ b/scripts/context/lua/mtx-patterns.lua @@ -150,7 +150,8 @@ scripts.patterns.list = { -- { "sa", "hyph-sa", "sanskrit" }, { "sk", "hyph-sk", "slovak" }, { "sl", "hyph-sl", "slovenian" }, - { "sr", "hyph-sr-cyrl", "serbian" }, + { "sr", "hyph-sr", "serbian", false, { "hyph-sr-cyrl", "hyph-sr-latn" }, }, + -- { "sr", "hyph-sr-cyrl", "serbian", false }, -- { "sr", "hyph-sr-latn", "serbian" }, { "sv", "hyph-sv", "swedish" }, -- { "ta", "hyph-ta", "tamil" }, @@ -171,23 +172,32 @@ end -- *.tex -- *.hyp.txt *.pat.txt *.lic.txt *.chr.txt -function scripts.patterns.load(path,name,mnemonic,ignored) - local basename = name +function scripts.patterns.load(path,name,mnemonic,ignored, merged) local fullname = file.join(path,name) - local texfile = addsuffix(fullname,"tex") - local hypfile = addsuffix(fullname,"hyp.txt") - local patfile = addsuffix(fullname,"pat.txt") - local licfile = addsuffix(fullname,"lic.txt") - -- local chrfile = addsuffix(fullname,"chr.txt") + local basename = name + local texfile = addsuffix(fullname,"tex") + local hypfile = addsuffix(fullname,"hyp.txt") + local patfile = addsuffix(fullname,"pat.txt") + local licfile = addsuffix(fullname,"lic.txt") + -- local chrfile = addsuffix(fullname,"chr.txt") local okay = true local hyphenations, patterns, comment, stripset = "", "", "", "" local splitpatternsnew, splithyphenationsnew = { }, { } local splitpatternsold, splithyphenationsold = { }, { } local usedpatterncharactersnew, usedhyphenationcharactersnew = { }, { } - if lfs.isfile(patfile) then + if merged then + report("using merged txt files %s.[hyp|pat|lic].txt",name) + for i=1,#merged do + local fullname = file.join(path,merged[i]) + comment = comment .. (io.loaddata(addsuffix(fullname,"lic.txt")) or "") .. "\n\n" + patterns = patterns .. (io.loaddata(addsuffix(fullname,"pat.txt")) or "") .. "\n\n" + hyphenations = hyphenations .. (io.loaddata(addsuffix(fullname,"hyp.txt")) or "") .. "\n\n" + end + elseif lfs.isfile(patfile) then report("using txt files %s.[hyp|pat|lic].txt",name) - comment, patterns, hyphenations = io.loaddata(licfile) or "", io.loaddata(patfile) or "", io.loaddata(hypfile) or "" - hypfile, patfile, licfile = hypfile, patfile, licfile + comment = io.loaddata(licfile) or "" + patterns = io.loaddata(patfile) or "" + hyphenations = io.loaddata(hypfile) or "" elseif lfs.isfile(texfile) then report("using tex file %s.txt",name) local data = io.loaddata(texfile) or "" @@ -203,9 +213,9 @@ function scripts.patterns.load(path,name,mnemonic,ignored) end) data = gsub(data,"%%.-[\n\r]","") data = gsub(data," *[\n\r]+","\n") - patterns = match(data,"\\patterns[%s]*{[%s]*(.-)[%s]*}") or "" + patterns = match(data,"\\patterns[%s]*{[%s]*(.-)[%s]*}") or "" hyphenations = match(data,"\\hyphenation[%s]*{[%s]*(.-)[%s]*}") or "" - comment = match(data,"^(.-)[\n\r]\\patterns") or "" + comment = match(data,"^(.-)[\n\r]\\patterns") or "" else okay = false end @@ -514,10 +524,10 @@ function scripts.patterns.check() only = table.tohash(files) end for k, v in next, scripts.patterns.list do - local mnemonic, name, ignored = v[1], v[2], v[4] + local mnemonic, name, ignored, merged = v[1], v[2], v[4], v[5] if not only or only[mnemonic] then report("checking language %s, file %s", mnemonic, name) - local okay = scripts.patterns.load(path,name,mnemonic,ignored) + local okay = scripts.patterns.load(path,name,mnemonic,ignored, merged) if not okay then report("there are errors that need to be fixed") end @@ -541,11 +551,11 @@ function scripts.patterns.convert() only = table.tohash(files) end for k, v in next, scripts.patterns.list do - local mnemonic, name, ignored = v[1], v[2], v[4] + local mnemonic, name, ignored, merged = v[1], v[2], v[4], v[5] if not only or only[mnemonic] then report("converting language %s, file %s", mnemonic, name) local okay, patternsnew, hyphenationsnew, patternsold, hyphenationsold, comment, stripped, - pusednew, husednew, pusedold, husedold = scripts.patterns.load(path,name,mnemonic,ignored) + pusednew, husednew, pusedold, husedold = scripts.patterns.load(path,name,mnemonic,ignored,merged) if okay then scripts.patterns.save(destination,mnemonic,name,patternsnew,hyphenationsnew,patternsold,hyphenationsold,comment,stripped, pusednew,husednew,pusedold,husedold,ignored) @@ -689,8 +699,8 @@ end -- mtxrun --script pattern --check hyph-*.tex -- mtxrun --script pattern --check --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns --- mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/tex --destination=e:/tmp/patterns --- mtxrun --script pattern --convert --path=c:/data/repositories/tex-hyphen/hyph-utf8/tex/generic/hyph-utf8/patterns/tex --destination=e:/tmp/patterns +-- mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns +-- mtxrun --script pattern --convert --path=c:/data/repositories/tex-hyphen/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns -- -- use this call: -- diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 0b9672e89..8753c2821 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -849,7 +849,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11793, stripped down to: 8387 +-- original size: 11969, stripped down to: 8501 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -1083,7 +1083,10 @@ methods["already loaded"]=function(name) return package.loaded[name] end methods["preload table"]=function(name) - return builtin["preload table"](name) + local f=builtin["preload table"] + if f then + return f(name) + end end methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) @@ -1095,15 +1098,24 @@ methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") end methods["path specification"]=function(name) - getluapaths() - return builtin["path specification"](name) + local f=builtin["path specification"] + if f then + getluapaths() + return f(name) + end end methods["cpath specification"]=function(name) - getlibpaths() - return builtin["cpath specification"](name) + local f=builtin["cpath specification"] + if f then + getlibpaths() + return f(name) + end end methods["all in one fallback"]=function(name) - return builtin["all in one fallback"](name) + local f=builtin["all in one fallback"] + if f then + return f(name) + end end methods["not loaded"]=function(name) if helpers.trace then @@ -25761,8 +25773,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023146 --- stripped bytes : 404426 +-- original bytes : 1023322 +-- stripped bytes : 404488 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 0b9672e89..8753c2821 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -849,7 +849,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11793, stripped down to: 8387 +-- original size: 11969, stripped down to: 8501 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -1083,7 +1083,10 @@ methods["already loaded"]=function(name) return package.loaded[name] end methods["preload table"]=function(name) - return builtin["preload table"](name) + local f=builtin["preload table"] + if f then + return f(name) + end end methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) @@ -1095,15 +1098,24 @@ methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") end methods["path specification"]=function(name) - getluapaths() - return builtin["path specification"](name) + local f=builtin["path specification"] + if f then + getluapaths() + return f(name) + end end methods["cpath specification"]=function(name) - getlibpaths() - return builtin["cpath specification"](name) + local f=builtin["cpath specification"] + if f then + getlibpaths() + return f(name) + end end methods["all in one fallback"]=function(name) - return builtin["all in one fallback"](name) + local f=builtin["all in one fallback"] + if f then + return f(name) + end end methods["not loaded"]=function(name) if helpers.trace then @@ -25761,8 +25773,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023146 --- stripped bytes : 404426 +-- original bytes : 1023322 +-- stripped bytes : 404488 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 0b9672e89..8753c2821 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -849,7 +849,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11793, stripped down to: 8387 +-- original size: 11969, stripped down to: 8501 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -1083,7 +1083,10 @@ methods["already loaded"]=function(name) return package.loaded[name] end methods["preload table"]=function(name) - return builtin["preload table"](name) + local f=builtin["preload table"] + if f then + return f(name) + end end methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) @@ -1095,15 +1098,24 @@ methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") end methods["path specification"]=function(name) - getluapaths() - return builtin["path specification"](name) + local f=builtin["path specification"] + if f then + getluapaths() + return f(name) + end end methods["cpath specification"]=function(name) - getlibpaths() - return builtin["cpath specification"](name) + local f=builtin["cpath specification"] + if f then + getlibpaths() + return f(name) + end end methods["all in one fallback"]=function(name) - return builtin["all in one fallback"](name) + local f=builtin["all in one fallback"] + if f then + return f(name) + end end methods["not loaded"]=function(name) if helpers.trace then @@ -25761,8 +25773,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023146 --- stripped bytes : 404426 +-- original bytes : 1023322 +-- stripped bytes : 404488 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 0b9672e89..8753c2821 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -849,7 +849,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11793, stripped down to: 8387 +-- original size: 11969, stripped down to: 8501 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -1083,7 +1083,10 @@ methods["already loaded"]=function(name) return package.loaded[name] end methods["preload table"]=function(name) - return builtin["preload table"](name) + local f=builtin["preload table"] + if f then + return f(name) + end end methods["qualified path"]=function(name) return loadedbyname(addsuffix(lualibfile(name),"lua"),name) @@ -1095,15 +1098,24 @@ methods["lib extra list"]=function(name) return loadedbypath(addsuffix(lualibfile(name),os.libsuffix),name,getextralibpaths(),true,"lib") end methods["path specification"]=function(name) - getluapaths() - return builtin["path specification"](name) + local f=builtin["path specification"] + if f then + getluapaths() + return f(name) + end end methods["cpath specification"]=function(name) - getlibpaths() - return builtin["cpath specification"](name) + local f=builtin["cpath specification"] + if f then + getlibpaths() + return f(name) + end end methods["all in one fallback"]=function(name) - return builtin["all in one fallback"](name) + local f=builtin["all in one fallback"] + if f then + return f(name) + end end methods["not loaded"]=function(name) if helpers.trace then @@ -25761,8 +25773,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023146 --- stripped bytes : 404426 +-- original bytes : 1023322 +-- stripped bytes : 404488 -- end library merge |