summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-04-16 20:20:28 +0300
committerMarius <mariausol@gmail.com>2013-04-16 20:20:28 +0300
commit2bce12e0c387ba3a0e084bf0c44c23af1f93642e (patch)
treefcf93a966bbc848411295c490198b61ac17849be /tex
parent7d59d03f80badf3733d3230b9976b66c19e92919 (diff)
downloadcontext-2bce12e0c387ba3a0e084bf0c44c23af1f93642e.tar.gz
beta 2013.04.16 18:49
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/cont-yes.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4134 -> 4136 bytes
-rw-r--r--tex/context/base/context-version.pngbin40227 -> 40545 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/core-ctx.lua3
-rw-r--r--tex/context/base/core-sys.mkiv48
-rw-r--r--tex/context/base/data-met.lua6
-rw-r--r--tex/context/base/data-res.lua7
-rw-r--r--tex/context/base/l-file.lua18
-rw-r--r--tex/context/base/luat-mac.lua5
-rw-r--r--tex/context/base/mult-low.lua2
-rw-r--r--tex/context/base/status-files.pdfbin24708 -> 24709 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin211461 -> 211438 bytes
-rw-r--r--tex/context/base/strc-flt.mkvi15
-rw-r--r--tex/context/base/syst-aux.mkiv8
-rw-r--r--tex/generic/context/luatex/luatex-basics-nod.lua4
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua19
18 files changed, 99 insertions, 42 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 83717e773..8466f5301 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.04.16 12:08}
+\newcontextversion{2013.04.16 18:49}
%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/cont-yes.mkiv b/tex/context/base/cont-yes.mkiv
index 0bea65f5a..1a10fc30e 100644
--- a/tex/context/base/cont-yes.mkiv
+++ b/tex/context/base/cont-yes.mkiv
@@ -80,7 +80,9 @@
-- We have a regular tex file so no \starttext yet as we can
-- load fonts.
+ -- context.enabletrackers { "resolvers.*" }
context.input(filename)
+ -- context.disabletrackers { "resolvers.*" }
end
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 102fd5c44..98f60c42f 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-version.png b/tex/context/base/context-version.png
index 773b3a4bd..9c794d4ab 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index b6c7e5097..357723f69 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.04.16 12:08}
+\edef\contextversion{2013.04.16 18:49}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/core-ctx.lua b/tex/context/base/core-ctx.lua
index 33662731e..18978a530 100644
--- a/tex/context/base/core-ctx.lua
+++ b/tex/context/base/core-ctx.lua
@@ -332,7 +332,8 @@ function commands.getctxfile()
end
function ctxrunner.resolve(name) -- used a few times later on
- return ctxrunner.prepfiles[file.collapsepath(name)] or name
+ local collapsedname = file.collapsepath(name,".")
+ return ctxrunner.prepfiles[collapsedname] or collapsedname
end
-- ctxrunner.load("t:/sources/core-ctx.ctx")
diff --git a/tex/context/base/core-sys.mkiv b/tex/context/base/core-sys.mkiv
index b65934432..8f56b6f16 100644
--- a/tex/context/base/core-sys.mkiv
+++ b/tex/context/base/core-sys.mkiv
@@ -285,9 +285,29 @@
\fi
#1#2{#3}}
+% new:
+%
+% \checked\def \whatever#alpha#beta{#alpha + #beta}
+% \checked\edef\whatever#alpha#beta{#alpha + #beta}
+
+\unexpanded\def\unique#1#2%
+ {\ifdefined#2%
+ \showmessage\m!system4{\string#2}%
+ \expandafter#1\expandafter\gobbleddefinition
+ \else
+ \expandafter#1%
+ \fi#2}
+
+\unexpanded\def\checked#1#2%
+ {\ifdefined#2%
+ \showmessage\m!system4{\string#2}%
+ \fi
+ #1#2}
+
% \startluacode
-% local contextsprint, ctxcatcodes = context.sprint, tex.ctxcatcodes
-% local format, match, gmatch, rep = string.format, string.match, string.gmatch, string.rep
+% local formatters = string.formatters
+% local contextsprint, ctxcatcodes, prtcatcodes = context.sprint, tex.ctxcatcodes, tex.prtcatcodes
+% local match, gmatch, rep = string.match, string.gmatch, string.rep
% local empty = {
% "single",
% "double",
@@ -315,22 +335,22 @@
% else
% n = 0
% end
-% contextsprint(ctxcatcodes,format("\\unexpanded\\def\\%s",cmd))
+% contextsprint(ctxcatcodes,formatters["\\unexpanded\\def\\%s"](cmd))
% if #a > 0 then
-% contextsprint(ctxcatcodes,format("{\\do%sempty\\do%s}",empty[#a],cmd))
-% contextsprint(ctxcatcodes,format("\\def\\do%s",cmd))
+% contextsprint(prtcatcodes,formatters["{\\do%sempty\\user_defined_%s}"](empty[#a],cmd))
+% contextsprint(prtcatcodes,formatters["\\def\\user_defined_%s"](cmd))
% for i=1,#a do
-% contextsprint(ctxcatcodes,"[#",i,"]")
+% contextsprint(ctxcatcodes,formatters["[#%s]"](i))
% end
% contextsprint(ctxcatcodes,"{")
% for i=#a,1,-1 do
-% contextsprint(ctxcatcodes,format("\\if%sargument",check[i]))
-% contextsprint(ctxcatcodes,format("\\def\\next{\\dodo%s",cmd))
+% contextsprint(ctxcatcodes,formatters["\\if%sargument"](check[i]))
+% contextsprint(prtcatcodes,formatters["\\def\\next{\\user_defined_indeed_%s"](cmd))
% for j=1,#a-i do
-% contextsprint(ctxcatcodes,format("[%s]",a[j]))
+% contextsprint(ctxcatcodes,formatters["[%s]"](a[j]))
% end
% for j=1,i do
-% contextsprint(ctxcatcodes,format("[#%s]",j))
+% contextsprint(ctxcatcodes,formatters["[#%s]"](j))
% end
% contextsprint(ctxcatcodes,"}")
% if i == 1 then
@@ -340,13 +360,13 @@
% end
% end
% contextsprint(ctxcatcodes,"\\next}")
-% contextsprint(ctxcatcodes,format("\\def\\dodo%s",cmd))
+% contextsprint(prtcatcodes,formatters["\\def\\user_defined_indeed_%s"](cmd))
% for i=1,#a do
-% contextsprint(ctxcatcodes,"[#",i,"]")
+% contextsprint(ctxcatcodes,formatters["[#%s]"](i))
% end
% end
% for i=1,n do
-% contextsprint(ctxcatcodes,"#",#a+i)
+% contextsprint(ctxcatcodes,formatters["#%s"](#a+i))
% end
% end
% \stopluacode
@@ -359,6 +379,8 @@
% \define[me][too][2]\whateverb{#1+#2+#3+#4}
% \whateverb[A]{B}{C}
% \whateverb[A][B]{C}{D}
+% \define[alpha][beta][gamma][delta]\whateverc{#1+#2+#3+#4}
+% \whateverc[P][Q]
% \stoptext
%D This is a checked variant of \type {\getvalue}.
diff --git a/tex/context/base/data-met.lua b/tex/context/base/data-met.lua
index 4ca443895..96da70bfd 100644
--- a/tex/context/base/data-met.lua
+++ b/tex/context/base/data-met.lua
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['data-met'] = {
local find, format = string.find, string.format
local sequenced = table.sequenced
local addurlscheme, urlhashed = url.addscheme, url.hashed
+local getcurrentdir = lfs.currentdir
local trace_locating = false
local trace_methods = false
@@ -33,7 +34,10 @@ local function splitmethod(filename) -- todo: filetype in specification
if type(filename) == "table" then
return filename -- already split
end
- filename = file.collapsepath(filename)
+ filename = file.collapsepath(filename,".") -- hm, we should keep ./ in some cases
+
+-- filename = gsub(filename,"^%./",getcurrentdir().."/") -- we will merge dir.expandname and collapse some day
+
if not find(filename,"://") then
return { scheme = "file", path = filename, original = filename, filename = filename }
end
diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua
index caf7fb8b4..532b6261f 100644
--- a/tex/context/base/data-res.lua
+++ b/tex/context/base/data-res.lua
@@ -36,6 +36,7 @@ local allocate = utilities.storage.allocate
local settings_to_array = utilities.parsers.settings_to_array
local setmetatableindex = table.setmetatableindex
local luasuffixes = utilities.lua.suffixes
+local getcurrentdir = lfs.currentdir
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
local trace_detail = false trackers.register("resolvers.details", function(v) trace_detail = v end)
@@ -1306,7 +1307,10 @@ end
collect_instance_files = function(filename,askedformat,allresults) -- uses nested
askedformat = askedformat or ""
- filename = collapsepath(filename)
+ filename = collapsepath(filename,".")
+
+ filename = gsub(filename,"^%./",getcurrentdir().."/") -- we will merge dir.expandname and collapse some day
+
if allresults then
-- no need for caching, only used for tracing
local filetype, wantedfiles = find_analyze(filename,askedformat)
@@ -1384,7 +1388,6 @@ end
-- -- -- end of main file search routing -- -- --
-
local function findfiles(filename,filetype,allresults)
local result, status = collect_instance_files(filename,filetype or "",allresults)
if not result or #result == 0 then
diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua
index af86f9397..29416caf0 100644
--- a/tex/context/base/l-file.lua
+++ b/tex/context/base/l-file.lua
@@ -62,7 +62,7 @@ elseif not lfs.isfile then
end
local insert, concat = table.insert, table.concat
-local match = string.match
+local match, find = string.match, string.find
local lpegmatch = lpeg.match
local getcurrentdir, attributes = lfs.currentdir, lfs.attributes
local checkedsplit = string.checkedsplit
@@ -410,11 +410,11 @@ local untouched = periods + (1-period)^1 * P(-1)
local splitstarter = (Cs(drivespec * (bwslash/"/" + fwslash)^0) + Cc(false)) * Ct(lpeg.splitat(S("/\\")^1))
local absolute = fwslash
-function file.collapsepath(str,anchor)
+function file.collapsepath(str,anchor) -- anchor: false|nil, true, "."
if not str then
return
end
- if anchor and not lpegmatch(anchors,str) then
+ if anchor == true and not lpegmatch(anchors,str) then
str = getcurrentdir() .. "/" .. str
end
if str == "" or str =="." then
@@ -455,12 +455,17 @@ function file.collapsepath(str,anchor)
elseif lpegmatch(absolute,str) then
return "/" .. concat(newelements,'/')
else
- return concat(newelements, '/')
+ newelements = concat(newelements, '/')
+ if anchor == "." and find(str,"^%./") then
+ return "./" .. newelements
+ else
+ return newelements
+ end
end
end
--- local function test(str)
--- print(string.format("%-20s %-15s %-15s",str,file.collapsepath(str),file.collapsepath(str,true)))
+-- local function test(str,...)
+-- print(string.format("%-20s %-15s %-30s %-20s",str,file.collapsepath(str),file.collapsepath(str,true),file.collapsepath(str,".")))
-- end
-- test("a/b.c/d") test("b.c/d") test("b.c/..")
-- test("/") test("c:/..") test("sys://..")
@@ -468,6 +473,7 @@ end
-- test("a") test("./a") test("/a") test("a/../..")
-- test("a/./b/..") test("a/aa/../b/bb") test("a/.././././b/..") test("a/./././b/..")
-- test("a/b/c/../..") test("./a/b/c/../..") test("a/b/c/../..")
+-- test("./a")
local validchars = R("az","09","AZ","--","..")
local pattern_a = lpeg.replacer(1-validchars)
diff --git a/tex/context/base/luat-mac.lua b/tex/context/base/luat-mac.lua
index 6a9401227..c8be06b63 100644
--- a/tex/context/base/luat-mac.lua
+++ b/tex/context/base/luat-mac.lua
@@ -102,6 +102,8 @@ local stopcode = P("\\stoptexdefinition")
local anything = patterns.anything
local always = patterns.alwaysmatched
+local definer = escape * (P("u")^-1 * S("egx")^-1 * P("def")) -- tex
+
-- The comment nilling can become an option but it nicely compensates the Lua
-- parsing here with less parsing at the TeX end. We keep lines so the errors
-- get reported all right, but comments are never seen there anyway. We keep
@@ -147,6 +149,7 @@ local grammar = { "converter",
)^0,
definition = pushlocal
* definer
+ * spaces^0
* escapedname
-- * (declaration + furthercomment + commentline + (1-leftbrace))^0
* (declaration + furthercomment + commentline + csname_endcsname + (1-leftbrace))^0
@@ -326,7 +329,7 @@ end
-- \stoptexdefinition
-- ]]))
--- print(macros.preprocessed([[\def\bla#bla{bla#{bla}}]]))
+-- print(macros.preprocessed([[\checked \def \bla #bla{bla#{bla}}]]))
-- print(macros.preprocessed([[\def\bla#bla{#{bla}bla}]]))
-- print(macros.preprocessed([[\def\blä#{blá}{blà:#{blá}}]]))
-- print(macros.preprocessed([[\def\blä#bla{blà:#bla}]]))
diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua
index 61f8316bc..d5848e5c7 100644
--- a/tex/context/base/mult-low.lua
+++ b/tex/context/base/mult-low.lua
@@ -240,7 +240,7 @@ return {
"resetvalue", "undefinevalue", "ignorevalue",
"setuvalue", "setuevalue", "setugvalue", "setuxvalue",
--
- "globallet", "glet", "udef", "ugdef", "uedef", "uxdef",
+ "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique",
--
"getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters",
--
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index a10e413cc..d6ca0d33d 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.pdf b/tex/context/base/status-lua.pdf
index 900a662a0..d6e70ce92 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/strc-flt.mkvi b/tex/context/base/strc-flt.mkvi
index d1f4477b9..8122b953e 100644
--- a/tex/context/base/strc-flt.mkvi
+++ b/tex/context/base/strc-flt.mkvi
@@ -468,6 +468,13 @@
% place
+\def\strc_floats_analyze_location
+ {% moved here, will do more
+ \let\floatlabel \empty
+ \let\floatcolumn\empty
+ \let\floatrow \empty
+ \setfloatmethodvariables\floatlocation}
+
\unexpanded\def\strc_floats_place#tag%
{\flushnotes
\page_otr_command_flush_side_floats % here !
@@ -481,12 +488,7 @@
\ifx\floatlocation\empty
\edef\floatlocation{\floatparameter\c!default}% beware of a clash between alignment locations
\fi
- % moved here, will do more
- \let\floatlabel \empty
- \let\floatcolumn\empty
- \let\floatrow \empty
- \setfloatmethodvariables\floatlocation
- %
+ \strc_floats_analyze_location
\setupcurrentfloatcaption[\c!reference={#reference},\c!title={#caption},\c!marking=,\c!list=,\c!bookmark=]%
\doifinsetelse\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal}
@@ -532,6 +534,7 @@
\ifsecondargument
\setupcurrentfloatuserdata[#userdata]%
\fi
+ \strc_floats_analyze_location
\doifinsetelse\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal
\bgroup
\ignorespaces}
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index a5551b954..4a8c8d32f 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -3088,6 +3088,14 @@
\fi
\unexpanded\def#1}
+\unexpanded\def\definemacro#1%
+ {\ifdefined#1%
+ \message{[\noexpand#1is already defined]}%
+ \unexpanded\expandafter\def\expandafter\gobbleddefinition
+ \else
+ \unexpanded\expandafter\def
+ \fi#1}
+
% \define\hans{hans}
% \redefine\hans{hans}
% \define\hans#1[]#2#3{hans}
diff --git a/tex/generic/context/luatex/luatex-basics-nod.lua b/tex/generic/context/luatex/luatex-basics-nod.lua
index ec515001e..5ab9df7f9 100644
--- a/tex/generic/context/luatex/luatex-basics-nod.lua
+++ b/tex/generic/context/luatex/luatex-basics-nod.lua
@@ -28,12 +28,12 @@ if tex.attribute[0] ~= 0 then
end
-attributes = { }
+attributes = attributes or { }
attributes.unsetvalue = -0x7FFFFFFF
local numbers, last = { }, 127
-function attributes.private(name)
+attributes.private = attributes.private or function(name)
local number = numbers[name]
if not number then
if last < 255 then
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 150b9cc77..8633b8e3a 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 : 04/16/13 12:08:48
+-- merge date : 04/16/13 18:49:45
do -- begin closure to overcome local limits and interference
@@ -2141,7 +2141,7 @@ elseif not lfs.isfile then
end
end
local insert,concat=table.insert,table.concat
-local match=string.match
+local match,find=string.match,string.find
local lpegmatch=lpeg.match
local getcurrentdir,attributes=lfs.currentdir,lfs.attributes
local checkedsplit=string.checkedsplit
@@ -2355,11 +2355,11 @@ local anchors=fwslash+drivespec
local untouched=periods+(1-period)^1*P(-1)
local splitstarter=(Cs(drivespec*(bwslash/"/"+fwslash)^0)+Cc(false))*Ct(lpeg.splitat(S("/\\")^1))
local absolute=fwslash
-function file.collapsepath(str,anchor)
+function file.collapsepath(str,anchor)
if not str then
return
end
- if anchor and not lpegmatch(anchors,str) then
+ if anchor==true and not lpegmatch(anchors,str) then
str=getcurrentdir().."/"..str
end
if str=="" or str=="." then
@@ -2399,7 +2399,12 @@ function file.collapsepath(str,anchor)
elseif lpegmatch(absolute,str) then
return "/"..concat(newelements,'/')
else
- return concat(newelements,'/')
+ newelements=concat(newelements,'/')
+ if anchor=="." and find(str,"^%./") then
+ return "./"..newelements
+ else
+ return newelements
+ end
end
end
local validchars=R("az","09","AZ","--","..")
@@ -3399,10 +3404,10 @@ if tex.attribute[0]~=0 then
texio.write_nl("log","!")
tex.attribute[0]=0
end
-attributes={}
+attributes=attributes or {}
attributes.unsetvalue=-0x7FFFFFFF
local numbers,last={},127
-function attributes.private(name)
+attributes.private=attributes.private or function(name)
local number=numbers[name]
if not number then
if last<255 then