summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/scrp-tib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/scrp-tib.lua')
-rw-r--r--tex/context/base/mkiv/scrp-tib.lua31
1 files changed, 10 insertions, 21 deletions
diff --git a/tex/context/base/mkiv/scrp-tib.lua b/tex/context/base/mkiv/scrp-tib.lua
index b67f69648..b1d50a469 100644
--- a/tex/context/base/mkiv/scrp-tib.lua
+++ b/tex/context/base/mkiv/scrp-tib.lua
@@ -12,25 +12,17 @@ local getnext = nuts.getnext
local getattr = nuts.getattr
local ischar = nuts.ischar
-local a_scriptstatus = attributes.private('scriptstatus')
+local getscriptstatus = scripts.getstatus
-local numbertocategory = scripts.numbertocategory
local inserters = scripts.inserters
+local colors = scripts.colors
local injectors = {
- breaking_tsheg = inserters.space_after,
+ breaking_tsheg = inserters.space_after
}
--- more efficient is to check directly
---
--- local b_tsheg = 0x0F0B -- breaking
--- local n_tsheg = 0x0F0C -- nonbreaking
---
--- if char == b_tsheg then
--- head, current = insert_space_after(head,current)
--- end
---
--- but this is more general
+colors.breaking_tsheg = "trace:1"
+colors.nonbreaking_tsheg = "trace:2"
local function process(head,first,last)
if first ~= last then
@@ -38,14 +30,11 @@ local function process(head,first,last)
while current do
local char, id = ischar(current)
if char then
- local scriptstatus = getattr(current,a_scriptstatus)
- if scriptstatus and scriptstatus > 0 then
- local category = numbertocategory[scriptstatus]
- if category then
- local injector = injectors[category]
- if injector then
- head, current = injector(head,current)
- end
+ local category = getscriptstatus(current)
+ if category then
+ local injector = injectors[category]
+ if injector then
+ head, current = injector(head,current)
end
end
end