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, 11 insertions, 16 deletions
diff --git a/tex/context/base/buff-par.lua b/tex/context/base/buff-par.lua
index 29742f497..2015b0bc0 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-par'] = {
+if not modules then modules = { } end modules ['buff-ini'] = {
version = 1.001,
comment = "companion to buff-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -6,26 +6,21 @@ if not modules then modules = { } end modules ['buff-par'] = {
license = "see context related readme files"
}
-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 trace_parallel = false trackers.register("buffers.parallel", function(v) trace_parallel = v end)
+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 insert, remove, find, gmatch = table.insert, table.remove, string.find, string.gmatch
+local strip, format = string.strip, string.format
-local parallel = buffers.parallel or { }
-buffers.parallel = parallel
+local variables = interfaces.variables
-local settings_to_array = utilities.parsers.settings_to_array
+buffers.parallel = { } local parallel = buffers.parallel
-local data = { }
+local data = { }
function parallel.define(category,tags)
- local tags = settings_to_array(tags)
+ local tags = utilities.parsers.settings_to_array(tags)
local entries = { }
data[category] = {
tags = tags,
@@ -43,7 +38,7 @@ function parallel.reset(category,tags)
if not tags or tags == "" or tags == variables.all then
tags = table.keys(entries)
else
- tags = settings_to_array(tags)
+ tags = utilities.parsers.settings_to_array(tags)
end
for i=1,#tags do
entries[tags[i]] = {
@@ -81,7 +76,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
@@ -180,5 +175,5 @@ commands.placeparallel = parallel.place
commands.resetparallel = parallel.reset
function commands.doifelseparallel(category,tags)
- commands.doifelse(parallel.hassomecontent(category,tags))
+ commands.testcase(parallel.hassomecontent(category,tags))
end