OSDN Git Service
(root)
/
luatex-ja
/
luatexja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a crash by "\ruby{Weierstraß}{ワイエルシュトラス}"
[luatex-ja/luatexja.git]
/
src
/
ltj-ruby.lua
diff --git
a/src/ltj-ruby.lua
b/src/ltj-ruby.lua
index
b168823
..
6ab3d1c
100644
(file)
--- a/
src/ltj-ruby.lua
+++ b/
src/ltj-ruby.lua
@@
-3,7
+3,7
@@
--
luatexbase.provides_module({
name = 'luatexja.ruby',
--
luatexbase.provides_module({
name = 'luatexja.ruby',
- date = '2018/0
2/18
',
+ date = '2018/0
9/29
',
description = 'Ruby annotation',
})
luatexja.ruby = {}
description = 'Ruby annotation',
})
luatexja.ruby = {}
@@
-67,6
+67,7
@@
luatexja.userid_table.RUBY_PRE = luatexbase.newuserwhatsitid('ruby_pre', 'luate
luatexja.userid_table.RUBY_POST = luatexbase.newuserwhatsitid('ruby_post', 'luatexja')
local RUBY_PRE = luatexja.userid_table.RUBY_PRE
local RUBY_POST = luatexja.userid_table.RUBY_POST
luatexja.userid_table.RUBY_POST = luatexbase.newuserwhatsitid('ruby_post', 'luatexja')
local RUBY_PRE = luatexja.userid_table.RUBY_PRE
local RUBY_POST = luatexja.userid_table.RUBY_POST
+local PROCESSED_BEGIN_FLAG = luatexja.icflag_table.PROCESSED_BEGIN_FLAG
----------------------------------------------------------------
-- TeX interface 0
----------------------------------------------------------------
-- TeX interface 0
@@
-144,6
+145,9
@@
end
local concat
do
local node_prev = node.direct.getprev
local concat
do
local node_prev = node.direct.getprev
+ local function get_attr_icflag(p)
+ return (has_attr(p, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG
+ end
function concat(f, b)
if f then
if b then
function concat(f, b)
if f then
if b then
@@
-151,6
+155,8
@@
do
if getid(nh)==id_whatsit and getsubtype(nh)==sid_user then
nh=node_next(nh); node_free(node_prev(nh))
end
if getid(nh)==id_whatsit and getsubtype(nh)==sid_user then
nh=node_next(nh); node_free(node_prev(nh))
end
+ set_attr(nh, attr_icflag,
+ get_attr_icflag(nh) + PROCESSED_BEGIN_FLAG)
setfield(node_tail(h), 'next', nh)
setfield(f, 'head', nil); node_free(f)
setfield(b, 'head', nil); node_free(b)
setfield(node_tail(h), 'next', nh)
setfield(f, 'head', nil); node_free(f)
setfield(b, 'head', nil); node_free(b)
@@
-202,7
+208,7
@@
do
local hh, hd = getfield(box, 'height'), getfield(box, 'depth')
local hx = h
while hx do
local hh, hd = getfield(box, 'height'), getfield(box, 'depth')
local hx = h
while hx do
- local hic = has_attr(hx, attr_icflag)
+ local hic = has_attr(hx, attr_icflag)
or 0
if (hic == KANJI_SKIP) or (hic == KANJI_SKIP_JFM)
or (hic == XKANJI_SKIP) or (hic == XKANJI_SKIP_JFM)
or ((hic<=FROM_JFM+63) and (hic>=FROM_JFM)) then
if (hic == KANJI_SKIP) or (hic == KANJI_SKIP_JFM)
or (hic == XKANJI_SKIP) or (hic == XKANJI_SKIP_JFM)
or ((hic<=FROM_JFM+63) and (hic>=FROM_JFM)) then