diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-28 15:11:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-28 15:11:56 +0000 |
commit | cc17ad601696f5cf966c8a0b9d79144cd42828a6 (patch) | |
tree | f6007b9b2f886d942f9b30b4797e8718001f65bd /Master/texmf-dist/tex/context/base/mkiv/math-dir.lua | |
parent | e298746bb92cdf7e87bc3b5b9bd973b6c429a47f (diff) |
context for tl19
git-svn-id: svn://tug.org/texlive/trunk@50165 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/math-dir.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/math-dir.lua | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua b/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua index 759f1e79715..38aa44358e2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua @@ -48,7 +48,9 @@ local vlist_code = nodecodes.vlist local nodepool = nuts.pool -local new_textdir = nodepool.textdir +local new_direction = nodepool.direction + +local lefttoright_code = nodes.dirvalues.lefttoright local chardirections = characters.directions local charmirrors = characters.mirrors @@ -60,16 +62,14 @@ local a_mathbidi = attributes.private('mathbidi') local function processmath(head) local current = head - local done = false local start = nil local stop = nil local function capsulate() - head = insert_node_before(head,start,new_textdir("+TLT")) - insert_node_after(head,stop,new_textdir("-TLT")) + head = insert_node_before(head,start,new_direction(lefttoright_code)) + insert_node_after(head,stop,new_direction(lefttoright_code,true)) if trace_directions then report_directions("reversed: %s",nodes.listtoutf(start,false,false,stop)) end - done = true start = false stop = nil end @@ -100,7 +100,6 @@ local function processmath(head) if trace_directions then report_directions("mirrored: %C to %C",char,mirror) end - done = true end end end @@ -108,11 +107,8 @@ local function processmath(head) elseif not start then -- nothing if id == hlist_code or id == vlist_code then - local list, d = processmath(getlist(current)) + local list = processmath(getlist(current)) setlist(current,list) - if d then - done = true - end end elseif start == stop then start = nil @@ -121,11 +117,8 @@ local function processmath(head) -- math can pack things into hlists .. we need to make sure we don't process -- too often: needs checking if id == hlist_code or id == vlist_code then - local list, d = processmath(getlist(current)) + local list = processmath(getlist(current)) setlist(current,list) - if d then - done = true - end end end current = getnext(current) @@ -137,21 +130,18 @@ local function processmath(head) else capsulate() end - return head, done + return head end local enabled = false function directions.processmath(head) -- style, penalties if enabled then - local h = tonut(head) - local a = getattr(h,a_mathbidi) + local a = getattr(head,a_mathbidi) if a and a > 0 then - local head, done = processmath(h) - return tonode(head), done + return processmath(head) end end - return head, false end function directions.setmath(n) |