diff options
author | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
commit | 7d7e0d3c8d778650105cfb479f31a2bb54d69d50 (patch) | |
tree | e0c4e7d8bf466a70af56be02a0de703bbd09a5af /tex/context/base/node-acc.lua | |
parent | b469b8ec1b494ab72cd462bfc539ce01440e6aaf (diff) | |
download | context-7d7e0d3c8d778650105cfb479f31a2bb54d69d50.tar.gz |
beta 2010.08.19 01:08
Diffstat (limited to 'tex/context/base/node-acc.lua')
-rw-r--r-- | tex/context/base/node-acc.lua | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/tex/context/base/node-acc.lua b/tex/context/base/node-acc.lua index fc0c5fb0f..c131a0002 100644 --- a/tex/context/base/node-acc.lua +++ b/tex/context/base/node-acc.lua @@ -6,25 +6,29 @@ if not modules then modules = { } end modules ['node-acc'] = { license = "see context related readme files" } -local traverse_nodes, traverse_id, has_attribute, copy_node = node.traverse, node.traverse_id, node.has_attribute, node.copy +local nodes, node = nodes, node -nodes.accessibility = nodes.accessibility or { } +local nodecodes = nodes.nodecodes +local tasks = nodes.tasks -local nodecodes = nodes.nodecodes +local traverse_nodes = node.traverse +local traverse_id = node.traverse_id +local has_attribute = node.has_attribute +local copy_node = node.copy -local glue = nodecodes.glue -local glyph = nodecodes.glyph -local hlist = nodecodes.hlist -local vlist = nodecodes.vlist +local glue_code = nodecodes.glue +local glyph_code = nodecodes.glyph +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist local function injectspaces(head) local p for n in traverse_nodes(head) do local id = n.id - if id == glue then -- todo: check for subtype related to spacing (13/14 but most seems to be 0) + if id == glue_code then -- todo: check for subtype related to spacing (13/14 but most seems to be 0) -- local at = has_attribute(n,attribute) -- if at then - if p and p.id == glyph then + if p and p.id == glyph_code then local g = copy_node(p) local s = copy_node(n.spec) g.char, n.spec = 32, s @@ -33,7 +37,7 @@ local function injectspaces(head) s.width = s.width - g.width end -- end - elseif id == hlist or id == vlist then + elseif id == hlist_code or id == vlist_code then injectspaces(n.list,attribute) end p = n @@ -41,9 +45,7 @@ local function injectspaces(head) return head, true end -nodes.accessibility.handler = injectspaces - --- nodes.accessibility.handler(tex.box[255].list) +nodes.handlers.accessibility = injectspaces -- todo: @@ -53,7 +55,7 @@ nodes.accessibility.handler = injectspaces --~ --~ local function compact(n) --~ local t = { } ---~ for n in traverse_id(glyph,n) do +--~ for n in traverse_id(glyph_code,n) do --~ t[#t+1] = utfchar(n.char) -- check for unicode --~ end --~ return concat(t,"") @@ -74,7 +76,7 @@ nodes.accessibility.handler = injectspaces --~ end --~ set_attribute(n,a_hyphenated,hsh) --~ end ---~ elseif id == hlist or id == vlist then +--~ elseif id == hlist_code or id == vlist_code then --~ injectspans(n.list) --~ end --~ end @@ -97,7 +99,7 @@ nodes.accessibility.handler = injectspaces --~ node.insert_before(head,n,b) --~ node.insert_after(head,n,e) --~ end ---~ elseif id == hlist or id == vlist then +--~ elseif id == hlist_code or id == vlist_code then --~ injectspans(n.list) --~ end --~ end |