summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtxrun.lua91
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua91
-rw-r--r--scripts/context/stubs/unix/mtxrun91
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua91
4 files changed, 272 insertions, 92 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index c9096d81e..f7af42969 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -444,7 +444,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 34559, stripped down to: 18815
+-- original size: 38619, stripped down to: 19653
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -1009,24 +1009,48 @@ function lpeg.append(list,pp,delayed,checked)
end
return p
end
+local p_false=P(false)
+local p_true=P(true)
local function make(t,hash)
- local p=P(false)
+ local p=p_false
local keys=sortedkeys(t)
+ local function making(t,w)
+ local p=p_false
+ local keys=sortedkeys(t)
+ for i=1,#keys do
+ local k=keys[i]
+ local v=t[k]
+ if w then
+ if v==true then
+ p=p+P(k)*p_true
+ else
+ p=p+P(k)*(making(v,w)+p_true)
+ end
+ else
+ if v==true then
+ p=p+P(k)
+ else
+ p=p+P(k)*making(v,w)
+ end
+ end
+ end
+ return p
+ end
for i=1,#keys do
local k=keys[i]
local v=t[k]
local h=hash[v]
if h then
- if next(v) then
- p=p+P(k)*(make(v,hash)+P(true))
+ if v==true then
+ p=p+P(k)*p_true
else
- p=p+P(k)*P(true)
+ p=p+P(k)*(making(v,true)+p_true)
end
else
- if next(v) then
- p=p+P(k)*make(v,hash)
- else
+ if v==true then
p=p+P(k)
+ else
+ p=p+P(k)*making(v,false)
end
end
end
@@ -1034,34 +1058,55 @@ local function make(t,hash)
end
function lpeg.utfchartabletopattern(list)
local tree={}
- local hash={}
+ local hash
local n=#list
if n==0 then
+ hash=list
for s in next,list do
local t=tree
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=tc
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
end
else
+ hash={}
for i=1,n do
local t=tree
local s=list[i]
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=true
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
+ hash[s]=true
end
end
return make(tree,hash)
@@ -17774,8 +17819,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-gzip.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 : 745333
--- stripped bytes : 272372
+-- original bytes : 749393
+-- stripped bytes : 275594
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index c9096d81e..f7af42969 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -444,7 +444,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 34559, stripped down to: 18815
+-- original size: 38619, stripped down to: 19653
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -1009,24 +1009,48 @@ function lpeg.append(list,pp,delayed,checked)
end
return p
end
+local p_false=P(false)
+local p_true=P(true)
local function make(t,hash)
- local p=P(false)
+ local p=p_false
local keys=sortedkeys(t)
+ local function making(t,w)
+ local p=p_false
+ local keys=sortedkeys(t)
+ for i=1,#keys do
+ local k=keys[i]
+ local v=t[k]
+ if w then
+ if v==true then
+ p=p+P(k)*p_true
+ else
+ p=p+P(k)*(making(v,w)+p_true)
+ end
+ else
+ if v==true then
+ p=p+P(k)
+ else
+ p=p+P(k)*making(v,w)
+ end
+ end
+ end
+ return p
+ end
for i=1,#keys do
local k=keys[i]
local v=t[k]
local h=hash[v]
if h then
- if next(v) then
- p=p+P(k)*(make(v,hash)+P(true))
+ if v==true then
+ p=p+P(k)*p_true
else
- p=p+P(k)*P(true)
+ p=p+P(k)*(making(v,true)+p_true)
end
else
- if next(v) then
- p=p+P(k)*make(v,hash)
- else
+ if v==true then
p=p+P(k)
+ else
+ p=p+P(k)*making(v,false)
end
end
end
@@ -1034,34 +1058,55 @@ local function make(t,hash)
end
function lpeg.utfchartabletopattern(list)
local tree={}
- local hash={}
+ local hash
local n=#list
if n==0 then
+ hash=list
for s in next,list do
local t=tree
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=tc
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
end
else
+ hash={}
for i=1,n do
local t=tree
local s=list[i]
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=true
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
+ hash[s]=true
end
end
return make(tree,hash)
@@ -17774,8 +17819,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-gzip.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 : 745333
--- stripped bytes : 272372
+-- original bytes : 749393
+-- stripped bytes : 275594
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index c9096d81e..f7af42969 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -444,7 +444,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 34559, stripped down to: 18815
+-- original size: 38619, stripped down to: 19653
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -1009,24 +1009,48 @@ function lpeg.append(list,pp,delayed,checked)
end
return p
end
+local p_false=P(false)
+local p_true=P(true)
local function make(t,hash)
- local p=P(false)
+ local p=p_false
local keys=sortedkeys(t)
+ local function making(t,w)
+ local p=p_false
+ local keys=sortedkeys(t)
+ for i=1,#keys do
+ local k=keys[i]
+ local v=t[k]
+ if w then
+ if v==true then
+ p=p+P(k)*p_true
+ else
+ p=p+P(k)*(making(v,w)+p_true)
+ end
+ else
+ if v==true then
+ p=p+P(k)
+ else
+ p=p+P(k)*making(v,w)
+ end
+ end
+ end
+ return p
+ end
for i=1,#keys do
local k=keys[i]
local v=t[k]
local h=hash[v]
if h then
- if next(v) then
- p=p+P(k)*(make(v,hash)+P(true))
+ if v==true then
+ p=p+P(k)*p_true
else
- p=p+P(k)*P(true)
+ p=p+P(k)*(making(v,true)+p_true)
end
else
- if next(v) then
- p=p+P(k)*make(v,hash)
- else
+ if v==true then
p=p+P(k)
+ else
+ p=p+P(k)*making(v,false)
end
end
end
@@ -1034,34 +1058,55 @@ local function make(t,hash)
end
function lpeg.utfchartabletopattern(list)
local tree={}
- local hash={}
+ local hash
local n=#list
if n==0 then
+ hash=list
for s in next,list do
local t=tree
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=tc
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
end
else
+ hash={}
for i=1,n do
local t=tree
local s=list[i]
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=true
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
+ hash[s]=true
end
end
return make(tree,hash)
@@ -17774,8 +17819,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-gzip.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 : 745333
--- stripped bytes : 272372
+-- original bytes : 749393
+-- stripped bytes : 275594
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index c9096d81e..f7af42969 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -444,7 +444,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true
--- original size: 34559, stripped down to: 18815
+-- original size: 38619, stripped down to: 19653
if not modules then modules={} end modules ['l-lpeg']={
version=1.001,
@@ -1009,24 +1009,48 @@ function lpeg.append(list,pp,delayed,checked)
end
return p
end
+local p_false=P(false)
+local p_true=P(true)
local function make(t,hash)
- local p=P(false)
+ local p=p_false
local keys=sortedkeys(t)
+ local function making(t,w)
+ local p=p_false
+ local keys=sortedkeys(t)
+ for i=1,#keys do
+ local k=keys[i]
+ local v=t[k]
+ if w then
+ if v==true then
+ p=p+P(k)*p_true
+ else
+ p=p+P(k)*(making(v,w)+p_true)
+ end
+ else
+ if v==true then
+ p=p+P(k)
+ else
+ p=p+P(k)*making(v,w)
+ end
+ end
+ end
+ return p
+ end
for i=1,#keys do
local k=keys[i]
local v=t[k]
local h=hash[v]
if h then
- if next(v) then
- p=p+P(k)*(make(v,hash)+P(true))
+ if v==true then
+ p=p+P(k)*p_true
else
- p=p+P(k)*P(true)
+ p=p+P(k)*(making(v,true)+p_true)
end
else
- if next(v) then
- p=p+P(k)*make(v,hash)
- else
+ if v==true then
p=p+P(k)
+ else
+ p=p+P(k)*making(v,false)
end
end
end
@@ -1034,34 +1058,55 @@ local function make(t,hash)
end
function lpeg.utfchartabletopattern(list)
local tree={}
- local hash={}
+ local hash
local n=#list
if n==0 then
+ hash=list
for s in next,list do
local t=tree
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=tc
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
end
else
+ hash={}
for i=1,n do
local t=tree
local s=list[i]
+ local p,pk
for c in gmatch(s,".") do
- local tc=t[c]
- if not tc then
- tc={}
- t[c]=tc
+ if t==true then
+ t={ [c]=true }
+ p[pk]=t
+ p=t
+ t=true
+ else
+ local tc=t[c]
+ if not tc then
+ tc=true
+ t[c]=true
+ end
+ p=t
+ t=tc
end
- t=tc
+ pk=c
end
- hash[t]=s
+ hash[s]=true
end
end
return make(tree,hash)
@@ -17774,8 +17819,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-gzip.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 : 745333
--- stripped bytes : 272372
+-- original bytes : 749393
+-- stripped bytes : 275594
-- end library merge