summaryrefslogtreecommitdiff
path: root/tex/context/base/buff-par.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/buff-par.lua')
-rw-r--r--tex/context/base/buff-par.lua27
1 files changed, 16 insertions, 11 deletions
diff --git a/tex/context/base/buff-par.lua b/tex/context/base/buff-par.lua
index 2015b0bc0..29742f497 100644
--- a/tex/context/base/buff-par.lua
+++ b/tex/context/base/buff-par.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['buff-ini'] = {
+if not modules then modules = { } end modules ['buff-par'] = {
version = 1.001,
comment = "companion to buff-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -6,21 +6,26 @@ if not modules then modules = { } end modules ['buff-ini'] = {
license = "see context related readme files"
}
-local trace_parallel = false trackers.register("buffers.parallel", function(v) trace_parallel = v end)
-
-local report_parallel = logs.reporter("buffers","parallel")
+local context, commands = context, commands
local insert, remove, find, gmatch = table.insert, table.remove, string.find, string.gmatch
local strip, format = string.strip, string.format
-local variables = interfaces.variables
+local trace_parallel = false trackers.register("buffers.parallel", function(v) trace_parallel = v end)
+
+local report_parallel = logs.reporter("buffers","parallel")
+
+local variables = interfaces.variables
+
+local parallel = buffers.parallel or { }
+buffers.parallel = parallel
-buffers.parallel = { } local parallel = buffers.parallel
+local settings_to_array = utilities.parsers.settings_to_array
-local data = { }
+local data = { }
function parallel.define(category,tags)
- local tags = utilities.parsers.settings_to_array(tags)
+ local tags = settings_to_array(tags)
local entries = { }
data[category] = {
tags = tags,
@@ -38,7 +43,7 @@ function parallel.reset(category,tags)
if not tags or tags == "" or tags == variables.all then
tags = table.keys(entries)
else
- tags = utilities.parsers.settings_to_array(tags)
+ tags = settings_to_array(tags)
end
for i=1,#tags do
entries[tags[i]] = {
@@ -76,7 +81,7 @@ function parallel.save(category,tag,content)
end
-- maybe no strip
-- use lpeg
- if find(content,"^%s*%[") then
+ if find(content,"%s*%[") then
local done = false
for label, content in gmatch(content,"%s*%[(.-)%]%s*([^%[]+)") do
if done then
@@ -175,5 +180,5 @@ commands.placeparallel = parallel.place
commands.resetparallel = parallel.reset
function commands.doifelseparallel(category,tags)
- commands.testcase(parallel.hassomecontent(category,tags))
+ commands.doifelse(parallel.hassomecontent(category,tags))
end