summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/context/lua/mtxrun.lua38
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua38
-rw-r--r--scripts/context/stubs/unix/mtxrun38
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4103 -> 4113 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/core-con.lua21
-rw-r--r--tex/context/base/l-os.lua57
-rw-r--r--tex/context/base/math-noa.lua1
-rw-r--r--tex/context/base/status-files.pdfbin24754 -> 24754 bytes
-rw-r--r--tex/context/base/status-lua.log2
-rw-r--r--tex/context/base/type-imp-hgz.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 172 insertions, 31 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index f7e7f7822..69293450c 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -2575,7 +2575,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-os"] = package.loaded["l-os"] or true
--- original size: 14418, stripped down to: 8830
+-- original size: 15800, stripped down to: 9551
if not modules then modules={} end modules ['l-os']={
version=1.001,
@@ -2914,6 +2914,38 @@ if not os.sleep then
socket.sleep(n)
end
end
+local function isleapyear(year)
+ return (year%400==0) or ((year%100~=0) and (year%4==0))
+end
+os.isleapyear=isleapyear
+local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
+local function nofdays(year,month)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ else
+ return month==2 and isleapyear(year) and 29 or days[month]
+ end
+end
+os.nofdays=nofdays
+function os.weekday(day,month,year)
+ return date("%w",time { year=year,month=month,day=day })+1
+end
+function os.validdate(year,month,day)
+ if month<1 then
+ month=1
+ elseif month>12 then
+ month=12
+ end
+ if day<1 then
+ day=1
+ else
+ local max=nofdays(year,month)
+ if day>max then
+ day=max
+ end
+ end
+ return year,month,day
+end
end -- of closure
@@ -16489,8 +16521,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 : 676625
--- stripped bytes : 239146
+-- original bytes : 678007
+-- stripped bytes : 239807
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index f7e7f7822..69293450c 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -2575,7 +2575,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-os"] = package.loaded["l-os"] or true
--- original size: 14418, stripped down to: 8830
+-- original size: 15800, stripped down to: 9551
if not modules then modules={} end modules ['l-os']={
version=1.001,
@@ -2914,6 +2914,38 @@ if not os.sleep then
socket.sleep(n)
end
end
+local function isleapyear(year)
+ return (year%400==0) or ((year%100~=0) and (year%4==0))
+end
+os.isleapyear=isleapyear
+local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
+local function nofdays(year,month)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ else
+ return month==2 and isleapyear(year) and 29 or days[month]
+ end
+end
+os.nofdays=nofdays
+function os.weekday(day,month,year)
+ return date("%w",time { year=year,month=month,day=day })+1
+end
+function os.validdate(year,month,day)
+ if month<1 then
+ month=1
+ elseif month>12 then
+ month=12
+ end
+ if day<1 then
+ day=1
+ else
+ local max=nofdays(year,month)
+ if day>max then
+ day=max
+ end
+ end
+ return year,month,day
+end
end -- of closure
@@ -16489,8 +16521,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 : 676625
--- stripped bytes : 239146
+-- original bytes : 678007
+-- stripped bytes : 239807
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index f7e7f7822..69293450c 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -2575,7 +2575,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-os"] = package.loaded["l-os"] or true
--- original size: 14418, stripped down to: 8830
+-- original size: 15800, stripped down to: 9551
if not modules then modules={} end modules ['l-os']={
version=1.001,
@@ -2914,6 +2914,38 @@ if not os.sleep then
socket.sleep(n)
end
end
+local function isleapyear(year)
+ return (year%400==0) or ((year%100~=0) and (year%4==0))
+end
+os.isleapyear=isleapyear
+local days={ 31,28,31,30,31,30,31,31,30,31,30,31 }
+local function nofdays(year,month)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ else
+ return month==2 and isleapyear(year) and 29 or days[month]
+ end
+end
+os.nofdays=nofdays
+function os.weekday(day,month,year)
+ return date("%w",time { year=year,month=month,day=day })+1
+end
+function os.validdate(year,month,day)
+ if month<1 then
+ month=1
+ elseif month>12 then
+ month=12
+ end
+ if day<1 then
+ day=1
+ else
+ local max=nofdays(year,month)
+ if day>max then
+ day=max
+ end
+ end
+ return year,month,day
+end
end -- of closure
@@ -16489,8 +16521,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 : 676625
--- stripped bytes : 239146
+-- original bytes : 678007
+-- stripped bytes : 239807
-- end library merge
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 37c102604..fec4739ad 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.09.18 22:06}
+\newcontextversion{2013.09.19 09:20}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index b7288b53d..edd770ee2 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index c73883998..fde3ea3ab 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.09.18 22:06}
+\edef\contextversion{2013.09.19 09:20}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/core-con.lua b/tex/context/base/core-con.lua
index cb284b9a7..315a34f39 100644
--- a/tex/context/base/core-con.lua
+++ b/tex/context/base/core-con.lua
@@ -216,27 +216,14 @@ function commands.Character (n) context(chr (n,upper_offset)) end
function commands.characters(n) context(chrs(n,lower_offset)) end
function commands.Characters(n) context(chrs(n,upper_offset)) end
-local days = {
- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-}
-
-local function weekday(day,month,year)
- return date("%w",time{year=year,month=month,day=day}) + 1
-end
-
-local function isleapyear(year)
- return (year % 400 == 0) or ((year % 100 ~= 0) and (year % 4 == 0))
-end
+local weekday = os.weekday -- moved to l-os
+local isleapyear = os.isleapyear -- moved to l-os
+local nofdays = os.nofdays -- moved to l-os
local function leapyear(year)
return isleapyear(year) and 1 or 0
end
-local function nofdays(year,month)
- return days[isleapyear(year)][month]
-end
-
local function textime()
return tonumber(date("%H")) * 60 + tonumber(date("%M"))
end
@@ -254,7 +241,7 @@ converters.nofdays = nofdays
converters.textime = textime
function commands.weekday (day,month,year) context(weekday (day,month,year)) end
-function commands.leapyear(year) context(leapyear(year)) end -- rather useless
+function commands.leapyear(year) context(leapyear(year)) end -- rather useless, only for ifcase
function commands.nofdays (year,month) context(nofdays (year,month)) end
function commands.year () context(date("%Y")) end
diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua
index 8bfcf786c..7f3fd7caf 100644
--- a/tex/context/base/l-os.lua
+++ b/tex/context/base/l-os.lua
@@ -492,3 +492,60 @@ end
-- print(os.which("inkscape"))
-- print(os.which("gs.exe"))
-- print(os.which("ps2pdf"))
+
+-- These are moved from core-con.lua (as I needed them elsewhere).
+
+local function isleapyear(year)
+ return (year % 400 == 0) or ((year % 100 ~= 0) and (year % 4 == 0))
+end
+
+os.isleapyear = isleapyear
+
+-- nicer:
+--
+-- local days = {
+-- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+-- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+-- }
+--
+-- local function nofdays(year,month)
+-- return days[isleapyear(year)][month]
+-- return month == 2 and isleapyear(year) and 29 or days[month]
+-- end
+--
+-- more efficient:
+
+local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+
+local function nofdays(year,month)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ else
+ return month == 2 and isleapyear(year) and 29 or days[month]
+ end
+end
+
+os.nofdays = nofdays
+
+function os.weekday(day,month,year)
+ return date("%w",time { year = year, month = month, day = day }) + 1
+end
+
+function os.validdate(year,month,day)
+ -- we assume that all three values are set
+ -- year is always ok, even if lua has a 1970 time limit
+ if month < 1 then
+ month = 1
+ elseif month > 12 then
+ month = 12
+ end
+ if day < 1 then
+ day = 1
+ else
+ local max = nofdays(year,month)
+ if day > max then
+ day = max
+ end
+ end
+ return year, month, day
+end
diff --git a/tex/context/base/math-noa.lua b/tex/context/base/math-noa.lua
index cd0115c47..f72f568d4 100644
--- a/tex/context/base/math-noa.lua
+++ b/tex/context/base/math-noa.lua
@@ -124,6 +124,7 @@ local right_fence_code = 3
local function process(start,what,n,parent)
if n then n = n + 1 else n = 0 end
+ local prev = nil
while start do
local id = start.id
if trace_processing then
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 0555d1048..22d672c62 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log
index 2d1cf1c00..bc318b8ed 100644
--- a/tex/context/base/status-lua.log
+++ b/tex/context/base/status-lua.log
@@ -1,6 +1,6 @@
(cont-yes.mkiv
-ConTeXt ver: 2013.09.18 22:06 MKIV beta fmt: 2013.9.18 int: english/english
+ConTeXt ver: 2013.09.19 09:20 MKIV beta fmt: 2013.9.19 int: english/english
system > 'cont-new.mkiv' loaded
(cont-new.mkiv)
diff --git a/tex/context/base/type-imp-hgz.mkiv b/tex/context/base/type-imp-hgz.mkiv
index a3c2a7841..091adeb2d 100644
--- a/tex/context/base/type-imp-hgz.mkiv
+++ b/tex/context/base/type-imp-hgz.mkiv
@@ -1 +1 @@
-\input type-ghz.mkiv \endinput % can be file synonym
+\input type-imp-ghz.mkiv \endinput % can be file synonym
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 7352bc5cb..f8e3e802e 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 09/18/13 22:06:17
+-- merge date : 09/19/13 09:20:57
do -- begin closure to overcome local limits and interference