summaryrefslogtreecommitdiff
path: root/tex/context/base/typo-dig.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-10-20 01:21:09 +0300
committerMarius <mariausol@gmail.com>2013-10-20 01:21:09 +0300
commitb8ac6d7b7fdb16293c28034c349efd5b0b7b20b3 (patch)
tree0e9051dbe21b4e9cfc72fe594df5b0fe7bc511f3 /tex/context/base/typo-dig.lua
parent965214d981e6129b782c67adcaf3a81aedcb0bac (diff)
downloadcontext-b8ac6d7b7fdb16293c28034c349efd5b0b7b20b3.tar.gz
beta 2013.10.20 07:09
Diffstat (limited to 'tex/context/base/typo-dig.lua')
-rw-r--r--tex/context/base/typo-dig.lua21
1 files changed, 7 insertions, 14 deletions
diff --git a/tex/context/base/typo-dig.lua b/tex/context/base/typo-dig.lua
index 62d17fa3b..ef05e62da 100644
--- a/tex/context/base/typo-dig.lua
+++ b/tex/context/base/typo-dig.lua
@@ -24,7 +24,7 @@ local traverse_id = node.traverse_id
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local texattribute = tex.attribute
+local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
local nodecodes = nodes.nodecodes
@@ -55,7 +55,6 @@ digits.actions = { }
local actions = digits.actions
local a_digits = attributes.private("digits")
-digits.attribute = a_digits
-- at some point we can manipulate the glyph node so then i need
-- to rewrite this then
@@ -83,7 +82,7 @@ function nodes.aligned(head,start,stop,width,how)
end
end
-actions[1] = function(head,start,attribute,attr)
+actions[1] = function(head,start,attr)
local font = start.font
local char = start.char
local unic = chardata[font][char].tounicode
@@ -102,16 +101,16 @@ actions[1] = function(head,start,attribute,attr)
return head, start, false
end
-local function process(namespace,attribute,head)
+function digits.handler(head)
local done, current, ok = false, head, false
while current do
if current.id == glyph_code then
- local attr = current[attribute]
+ local attr = current[a_digits]
if attr and attr > 0 then
- current[attribute] = unsetvalue
+ current[a_digits] = unsetvalue
local action = actions[attr%100] -- map back to low number
if action then
- head, current, ok = action(head,current,attribute,attr)
+ head, current, ok = action(head,current,attr)
done = done and ok
elseif trace_digits then
report_digits("unknown digit trigger %a",attr)
@@ -148,15 +147,9 @@ function digits.set(n) -- number or 'reset'
n = unsetvalue
end
end
- texattribute[a_digits] = n
+ texsetattribute(a_digits,n)
end
-digits.handler = nodes.installattributehandler { -- we could avoid this wrapper
- name = "digits",
- namespace = digits,
- processor = process,
-}
-
-- interface
commands.setdigitsmanipulation = digits.set