summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/typo-prc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/typo-prc.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/typo-prc.lua25
1 files changed, 13 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/typo-prc.lua b/Master/texmf-dist/tex/context/base/typo-prc.lua
index 959cabbb8e5..cde66df0087 100644
--- a/Master/texmf-dist/tex/context/base/typo-prc.lua
+++ b/Master/texmf-dist/tex/context/base/typo-prc.lua
@@ -6,14 +6,15 @@ if not modules then modules = { } end modules ['typo-prc'] = {
license = "see context related readme files"
}
--- moved from strc-ini.lua
-
-local context, commands = context, commands
-local formatters = string.formatters
local lpegmatch, patterns, P, C, Cs = lpeg.match, lpeg.patterns, lpeg.P, lpeg.C, lpeg.Cs
-- processors: syntax: processor->data ... not ok yet
+local context = context
+local implement = interfaces.implement
+
+local formatters = string.formatters
+
typesetters.processors = typesetters.processors or { }
local processors = typesetters.processors
@@ -21,8 +22,8 @@ local trace_processors = false
local report_processors = logs.reporter("processors")
local registered = { }
-context_applyprocessor = context.applyprocessor
-context_firstofoneargument = context.firstofoneargument
+local ctx_applyprocessor = context.applyprocessor
+local ctx_firstofoneargument = context.firstofoneargument
trackers.register("typesetters.processors", function(v) trace_processors = v end)
@@ -58,7 +59,7 @@ function processors.apply(p,s)
if trace_processors then
report_processors("applying %s processor %a, argument: %s","known",p,s)
end
- context_applyprocessor(p,s)
+ ctx_applyprocessor(p,s)
elseif s then
if trace_processors then
report_processors("applying %s processor %a, argument: %s","unknown",p,s)
@@ -81,21 +82,21 @@ function processors.startapply(p,s)
if trace_processors then
report_processors("start applying %s processor %a","known",p)
end
- context_applyprocessor(p)
+ ctx_applyprocessor(p)
context("{")
return s
elseif p then
if trace_processors then
report_processors("start applying %s processor %a","unknown",p)
end
- context_firstofoneargument()
+ ctx_firstofoneargument()
context("{")
return s
else
if trace_processors then
report_processors("start applying %s processor","ignored")
end
- context_firstofoneargument()
+ ctx_firstofoneargument()
context("{")
return str
end
@@ -124,5 +125,5 @@ end
-- interface
-commands.registerstructureprocessor = processors.register
-commands.resetstructureprocessor = processors.reset
+implement { name = "registerstructureprocessor", actions = processors.register, arguments = "string" }
+implement { name = "resetstructureprocessor", actions = processors.reset, arguments = "string" }