summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-blk.lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/strc-blk.lua
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-blk.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/strc-blk.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-blk.lua b/Master/texmf-dist/tex/context/base/strc-blk.lua
index 33dbb0b7ce8..2589190eb5c 100644
--- a/Master/texmf-dist/tex/context/base/strc-blk.lua
+++ b/Master/texmf-dist/tex/context/base/strc-blk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc--blk'] = {
version = 1.001,
- comment = "companion to strc--blk.mkiv",
+ comment = "companion to strc-blk.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['strc--blk'] = {
-- this one runs on top of buffers and structure
-local texprint, format, gmatch = tex.print, string.format, string.gmatch
+local texprint, format, gmatch, find = tex.print, string.format, string.gmatch, string.find
+local lpegmatch = lpeg.match
local ctxcatcodes = tex.ctxcatcodes
@@ -29,7 +30,7 @@ end
job.register('structure.blocks.collected', structure.blocks.tobesaved, initializer)
-local printer = (lpeg.linebyline/texprint)^0
+local printer = (lpeg.patterns.textline/texprint)^0 -- can be shared
function blocks.print(name,data,hide)
if hide then
@@ -42,7 +43,7 @@ function blocks.print(name,data,hide)
texprint(data[i])
end
else
- printer:match(data)
+ lpegmatch(printer,data)
end
if hide then
texprint(ctxcatcodes,"\\dostophiddenblock")
@@ -65,7 +66,7 @@ function blocks.setstate(state,name,tag)
elseif all then
sn.all = state
else
- for _, tag in pairs(tags) do
+ for _, tag in next, tags do
sn[tag] = state
end
end
@@ -76,7 +77,7 @@ end
function blocks.select(state,name,tag,criterium)
criterium = criterium or "text"
- if tag:find("=") then tag = "" end
+ if find(tag,"=") then tag = "" end
local names = aux.settings_to_set(name)
local all = tag == ""
local tags = not all and aux.settings_to_set(tag)
@@ -91,7 +92,7 @@ function blocks.select(state,name,tag,criterium)
blocks.print(name,ri.data,hide)
else
local mtags = metadata.tags
- for tag, sta in pairs(tags) do
+ for tag, sta in next, tags do
if mtags[tag] then
blocks.print(name,ri.data,hide)
break
@@ -129,7 +130,7 @@ function blocks.save(name,tag,buffer) -- wrong, not yet adapted
end
else
local sn = states[name]
- for tag, _ in pairs(tags) do
+ for tag, _ in next, tags do
if sn[tag] == nil then
if allstate ~= "hide" then
blocks.print(name,data)