diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-06-23 19:25:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-06-23 19:25:00 +0200 |
commit | bddac3f564687065474739c7face6fcd93ceea69 (patch) | |
tree | 26cb1a2ca4bf35c232da5b74347cb6aa5040a4da /tex/context/base/math-tag.lua | |
parent | 4001733dc25cb6743004db0e9319708481d91135 (diff) | |
download | context-bddac3f564687065474739c7face6fcd93ceea69.tar.gz |
beta 2011.06.23 19:25
Diffstat (limited to 'tex/context/base/math-tag.lua')
-rw-r--r-- | tex/context/base/math-tag.lua | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tex/context/base/math-tag.lua b/tex/context/base/math-tag.lua index ce7c9c864..49138ac3b 100644 --- a/tex/context/base/math-tag.lua +++ b/tex/context/base/math-tag.lua @@ -44,6 +44,7 @@ local a_mathmode = attributes.private('mathmode') local tags = structures.tags local start_tagged = tags.start +local restart_tagged = tags.restart local stop_tagged = tags.stop local taglist = tags.taglist @@ -164,31 +165,30 @@ process = function(start) -- we cannot use the processor as we have no finalizer local cache = { } -- we can have nested unboxed mess so best local to runner for n in traverse_nodes(list) do local id = n.id - if id == hlist_code or id == vlist_code then - runner(n.list) - else -- if id == glyph_code then - local aa = get_attribute(n,a_tagged) -- only glyph needed (huh?) - if aa then - local ac = cache[aa] - if not ac then - local tagdata = taglist[aa] - local extra = #tagdata - if common <= extra then - for i=common,extra do - ac = start_tagged(tagdata[i]) -- can be made faster - end - for i=common,extra do - stop_tagged() -- can be made faster - end - else - ac = text + local aa = get_attribute(n,a_tagged) + if aa then + local ac = cache[aa] + if not ac then + local tagdata = taglist[aa] + local extra = #tagdata + if common <= extra then + for i=common,extra do + ac = restart_tagged(tagdata[i]) -- can be made faster + end + for i=common,extra do + stop_tagged() -- can be made faster end - cache[aa] = ac + else + ac = text end - set_attribute(n,a_tagged,ac) - else - set_attribute(n,a_tagged,text) + cache[aa] = ac end + set_attribute(n,a_tagged,ac) + else + set_attribute(n,a_tagged,text) + end + if id == hlist_code or id == vlist_code then + runner(n.list) end end end |