diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-fonts.lua | 1 | ||||
-rw-r--r-- | scripts/context/lua/mtx-patterns.lua | 36 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 12 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 12 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 12 |
5 files changed, 49 insertions, 24 deletions
diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua index 3cc3d242e..b171dd611 100644 --- a/scripts/context/lua/mtx-fonts.lua +++ b/scripts/context/lua/mtx-fonts.lua @@ -85,6 +85,7 @@ local report = application.report if not fontloader then fontloader = fontforge end dofile(resolvers.findfile("font-otp.lua","tex")) -- we need to unpack the font for analysis +dofile(resolvers.findfile("font-trt.lua","tex")) dofile(resolvers.findfile("font-syn.lua","tex")) dofile(resolvers.findfile("font-mis.lua","tex")) diff --git a/scripts/context/lua/mtx-patterns.lua b/scripts/context/lua/mtx-patterns.lua index 7144da9b0..2dcd3db54 100644 --- a/scripts/context/lua/mtx-patterns.lua +++ b/scripts/context/lua/mtx-patterns.lua @@ -148,10 +148,11 @@ scripts.patterns.list = { { "sv", "hyph-sv", "swedish" }, -- { "ta", "hyph-ta", "tamil" }, -- { "te", "hyph-te", "telugu" }, + { "th", "hyph-th", "thai" }, { "tk", "hyph-tk", "turkmen" }, { "tr", "hyph-tr", "turkish" }, { "uk", "hyph-uk", "ukrainian" }, - { "zh", "hyph-zh-latn", "zh-latn, chinese pinyin" }, + { "zh", "hyph-zh-latn-pinyin","zh-latn, chinese pinyin" }, } -- stripped down from lpeg example: @@ -166,6 +167,7 @@ end -- *.hyp.txt *.pat.txt *.lic.txt *.chr.txt function scripts.patterns.load(path,name,mnemonic,ignored) + local basename = name local fullname = file.join(path,name) local texfile = addsuffix(fullname,"tex") local hypfile = addsuffix(fullname,"hyp.txt") @@ -190,7 +192,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) local subfull = file.join(file.dirname(texfile),subname) local subdata = io.loaddata(subfull) or "" if subdata == "" then - report("no subfile %s",subname) + report("%s: no subfile %s",basename,subname) end return previous .. subdata end) @@ -219,7 +221,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) local line = splitdata[i] if find(line,"%%") then splitdata[i] = gsub(line,"%%.*$","") - report("removing comment: %s",line) + report("%s: removing comment: %s",basename,line) end end end @@ -235,7 +237,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) local line = splitdata[i] if find(line,"\\") then splitdata[i] = "" - report("removing line with command: %s",line) + report("%s: removing line with command: %s",basename,line) end end end @@ -251,7 +253,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) local ok = lpegmatch(validutf8,line) if not ok then splitdata[i] = "" - report("removing line with invalid utf: %s",line) + report("%s: removing line with invalid utf: %s",basename,line) end end -- check for commands being used in comments @@ -275,15 +277,15 @@ function scripts.patterns.load(path,name,mnemonic,ignored) else local cdb = cd[b] if not cdb then - report("no entry in chardata for character %s (0x%04X)",char(b),b) + report("%s: no entry in chardata for character %C",basename,b) else local ct = cdb.category - if ct == "lu" or ct == "ll" then + if ct == "lu" or ct == "ll" or ct == "lo" or ct == "mn" then -- hm, really mn ? used[char(b)] = true elseif ct == "nd" then -- number else - report("removing line with suspected utf character %s (0x%04X), category %s: %s",char(b),b,ct,line) + report("%s: removing line with suspected utf character %C, category %s: %s",basename,b,ct,line) splitdata[i] = "" break end @@ -296,7 +298,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) usedpatterncharactersnew = check(splitpatternsnew,byte(".")) usedhyphenationcharactersnew = check(splithyphenationsnew,byte("-")) for k, v in next, stripped do - report("entries that contain character %s (0x%04X) have been omitted",char(k),k) + report("%s: entries that contain character %C have been omitted",basename,k) end end if okay then @@ -327,11 +329,11 @@ function scripts.patterns.load(path,name,mnemonic,ignored) for i=1,#what do local line = what[i] if p and lpegmatch(p,line) then - report("discarding conflicting pattern: %s",line) + report("%s: discarding conflicting pattern: %s",basename,line) else -- we can speed this up by testing for replacements in the string local l = lpegmatch(r,line) if l ~= line then - report("sanitizing pattern: %s -> %s (for old patterns)",line,l) + report("%s: sanitizing pattern: %s -> %s (for old patterns)",basename,line,l) end result[#result+1] = l end @@ -353,7 +355,7 @@ function scripts.patterns.load(path,name,mnemonic,ignored) -- discard elseif used[line] then -- discard - report("discarding duplicate pattern: %s",line) + report("%s: discarding duplicate pattern: %s",basename,line) else used[line] = true collected[#collected+1] = line @@ -557,3 +559,13 @@ end -- 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/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns + +-- copy /Y *.hyp e:\tex-context\tex\texmf-context\tex\context\patterns +-- copy /Y *.pat e:\tex-context\tex\texmf-context\tex\context\patterns +-- copy /Y *.rme e:\tex-context\tex\texmf-context\tex\context\patterns +-- copy /Y *.lua e:\tex-context\tex\texmf-context\tex\context\patterns + +-- move /Y *.hyp e:\tex-context\tex\texmf-mine\tex\context\patterns +-- move /Y *.pat e:\tex-context\tex\texmf-mine\tex\context\patterns +-- move /Y *.rme e:\tex-context\tex\texmf-mine\tex\context\patterns +-- move /Y *.lua e:\tex-context\tex\texmf-mine\tex\context\patterns diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 124c0dac9..396220bd3 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -2843,7 +2843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16912, stripped down to: 9198 +-- original size: 17032, stripped down to: 9238 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2947,7 +2947,11 @@ function file.splitname(str,splitdrive) end end function file.splitbase(str) - return str and lpegmatch(pattern_d,str) + if str then + return lpegmatch(pattern_d,str) + else + return "",str + end end function file.nametotable(str,splitdrive) if str then @@ -15991,8 +15995,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 667272 --- stripped bytes : 244370 +-- original bytes : 667392 +-- stripped bytes : 244450 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 124c0dac9..396220bd3 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -2843,7 +2843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16912, stripped down to: 9198 +-- original size: 17032, stripped down to: 9238 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2947,7 +2947,11 @@ function file.splitname(str,splitdrive) end end function file.splitbase(str) - return str and lpegmatch(pattern_d,str) + if str then + return lpegmatch(pattern_d,str) + else + return "",str + end end function file.nametotable(str,splitdrive) if str then @@ -15991,8 +15995,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 667272 --- stripped bytes : 244370 +-- original bytes : 667392 +-- stripped bytes : 244450 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 124c0dac9..396220bd3 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -2843,7 +2843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16912, stripped down to: 9198 +-- original size: 17032, stripped down to: 9238 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2947,7 +2947,11 @@ function file.splitname(str,splitdrive) end end function file.splitbase(str) - return str and lpegmatch(pattern_d,str) + if str then + return lpegmatch(pattern_d,str) + else + return "",str + end end function file.nametotable(str,splitdrive) if str then @@ -15991,8 +15995,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.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 util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 667272 --- stripped bytes : 244370 +-- original bytes : 667392 +-- stripped bytes : 244450 -- end library merge |