ソースコードの管理場所
Revision | 09881cb7ab237e96ec6ccb2629d186b9375d29a3 (tree) |
---|---|
Time | 2020-10-23 18:05:42 |
Author | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
fix "! This can't happen (weird par dir)" error
@@ -3,7 +3,7 @@ | ||
3 | 3 | -- |
4 | 4 | luatexbase.provides_module({ |
5 | 5 | name = 'luatexja.jfmglue', |
6 | - date = '2020-10-05', | |
6 | + date = '2020-10-22', | |
7 | 7 | description = 'Insertion process of JFM glues, [x]kanjiskip and others', |
8 | 8 | }) |
9 | 9 | luatexja.jfmglue = luatexja.jfmglue or {} |
@@ -1220,27 +1220,10 @@ do | ||
1220 | 1220 | end |
1221 | 1221 | end |
1222 | 1222 | |
1223 | -local ensure_tex_attr = ltjb.ensure_tex_attr | |
1224 | -local function cleanup(mode, TEMP) | |
1225 | - -- luatexja.ext_show_node_list(to_node(head), '> ', print) | |
1226 | - -- adjust attr_icflag for avoiding error | |
1227 | - if tex.getattribute(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end | |
1228 | - node_free(kanji_skip); | |
1229 | - node_free(xkanji_skip); node_free(TEMP) | |
1230 | - | |
1231 | - if mode then | |
1232 | - local h = node_next(head) | |
1233 | - if getid(h) == id_penalty and getfield(h, 'penalty') == 10000 then | |
1234 | - h = node_next(h) | |
1235 | - if getid(h) == id_glue and getsubtype(h) == 15 and not node_next(h) then | |
1236 | - return false | |
1237 | - end | |
1238 | - end | |
1239 | - end | |
1240 | - return head | |
1241 | -end | |
1242 | 1223 | -------------------- 外部から呼ばれる関数 |
1243 | 1224 | |
1225 | +local ensure_tex_attr = ltjb.ensure_tex_attr | |
1226 | +local tex_getattr = tex.getattribute | |
1244 | 1227 | -- main interface |
1245 | 1228 | function luatexja.jfmglue.main(ahead, mode, dir) |
1246 | 1229 | if not ahead then return ahead end |
@@ -1267,9 +1250,11 @@ function luatexja.jfmglue.main(ahead, mode, dir) | ||
1267 | 1250 | end |
1268 | 1251 | handle_list_tail(mode, last) |
1269 | 1252 | end |
1270 | - --luatexja.ext_show_node_list(to_node(ahead ), '>A ', print) | |
1271 | - --print() | |
1272 | - return cleanup(mode, TEMP) | |
1253 | + -- adjust attr_icflag for avoiding error | |
1254 | + if tex_getattr(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end | |
1255 | + node_free(kanji_skip); | |
1256 | + node_free(xkanji_skip); node_free(TEMP) | |
1257 | + return head | |
1273 | 1258 | end |
1274 | 1259 | end |
1275 | 1260 |