diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
commit | f74161ca4e7eb3c5af9afcbe92522ae3b58987c1 (patch) | |
tree | 3c30a13df5ac7968195c85070a2b074578e669d2 /Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua | |
parent | 1d5a55ac8f5506a7ae9cfca52f4b588182e199d4 (diff) |
context beta/cont-tmf.zip (Apr 16 12:55)
git-svn-id: svn://tug.org/texlive/trunk@43931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua index 28f2e5d50cc..6fde353f7dd 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua @@ -52,11 +52,13 @@ local getchar = nuts.getchar local isglyph = nuts.isglyph local setfield = nuts.setfield +local getfield = nuts.getfield local setattr = nuts.setattr local setlink = nuts.setlink local setnext = nuts.setnext local setprev = nuts.setprev local setchar = nuts.setchar +local setattrlist = nuts.setattrlist local insert_node_before = nuts.insert_before local remove_node = nuts.remove @@ -65,12 +67,13 @@ local flush_list = nuts.flush_list local insert_after = nuts.insert_after local nodepool = nuts.pool -local new_glyph = nodepool.glyph local new_disc = nodepool.disc local texsetattribute = tex.setattribute local unsetvalue = attributes.unsetvalue +local enableaction = nodes.tasks.enableaction + local v_reset = interfaces.variables.reset local implement = interfaces.implement @@ -223,34 +226,35 @@ function replacements.handler(head) local i = 1 while i <= newlength do local codes = newcodes[i] - local new = nil if type(codes) == "table" then local method = codes[1] if method == "discretionary" then local pre, post, replace = codes[2], codes[3], codes[4] - new = new_disc() if pre then - setfield(new,"pre",tonodes(pre,last)) + pre = tonodes(pre,last) end if post then - setfield(new,"post",tonodes(post,last)) + post = tonodes(post,last) end if replace then - setfield(new,"replace",tonodes(replace,last)) + replace = tonodes(replace,last) end + -- todo: also set attr + local new = new_disc(pre,post,replace) + setattrlist(new,last) head, current = insert_after(head,current,new) elseif method == "noligature" then -- not that efficient to copy but ok for testing local list = codes[2] if list then for i=1,#list do - new = copy_node(last) + local new = copy_node(last) setchar(new,list[i]) setattr(new,a_noligature,1) head, current = insert_after(head,current,new) end else - new = copy_node(last) + local new = copy_node(last) setchar(new,zwnj) head, current = insert_after(head,current,new) end @@ -258,7 +262,7 @@ function replacements.handler(head) -- todo end else - new = copy_node(last) + local new = copy_node(last) setchar(new,codes) head, current = insert_after(head,current,new) end @@ -311,7 +315,7 @@ function replacements.set(n) else n = lists[n].attribute if not enabled then - nodes.tasks.enableaction("processors","languages.replacements.handler") + enableaction("processors","languages.replacements.handler") if trace_replacements then report_replacement("enabling replacement handler") end |