- tex.write( (c<0) and 1 or ltjc.get_range_setting(c))
- else
- if c<0 or c>0x10FFFF then
- ltjb.package_error('luatexja',
- 'bad character code (' .. c .. ')',
- 'A character number must be between -1 and 0x10ffff.\n'..
- "(-1 is used for denoting `math boundary')\n"..
- 'So I changed this one to zero.')
- c=0
- end
- if k == 'prebreakpenalty' then
- tex.write(ltjs.get_penalty_table(stack_table_index.PRE + c, 0, t))
- elseif k == 'postbreakpenalty' then
- tex.write(ltjs.get_penalty_table(stack_table_index.POST+ c, 0, t))
- elseif k == 'kcatcode' then
- tex.write(ltjs.get_penalty_table(stack_table_index.KCAT+ c, 0, t))
- elseif k == 'chartorange' then
- tex.write(ltjc.char_to_range(c))
- elseif k == 'jaxspmode' or k == 'alxspmode' then
- tex.write(ltjs.get_penalty_table(stack_table_index.XSP + c, 3, t))
+ return (c<0) and 1 or ltjc.get_range_setting(c)
+ end,
+ prebreakpenalty = function(c, t)
+ return ltjs.get_stack_table(stack_table_index.PRE
+ + ltjb.in_unicode(c, true), 0, t)
+ end,
+ postbreakpenalty = function(c, t)
+ return ltjs.get_stack_table(stack_table_index.POST
+ + ltjb.in_unicode(c, true), 0, t)
+ end,
+ kcatcode = function(c, t)
+ return ltjs.get_stack_table(stack_table_index.KCAT
+ + ltjb.in_unicode(c, false), 0, t)
+ end,
+ chartorange = function(c, t)
+ return ltjc.char_to_range(ltjb.in_unicode(c, false))
+ end,
+ jaxspmode = function(c, t)
+ return ltjs.get_stack_table(stack_table_index.XSP
+ + ltjb.in_unicode(c, true), 3, t)
+ end,
+ boxdir = function(c, t)
+ if type(c)~='number' or c<0 or c>65535 then
+ ltjb.package_error('luatexja',
+ 'Bad register code (' .. tostring(c) .. ')',
+ 'A register must be between 0 and 65535.\n'..
+ 'I changed this one to zero.')
+ c=0
+ end
+ return ltjd.get_register_dir(c)
+ end,
+ }
+ local binary_pars = luatexja.binary_pars
+
+ binary_pars.alxspmode = binary_pars.jaxspmode
+ function luatexja.ext_get_parameter_binary(k,c)
+ if binary_pars[k] then
+ tex.write(tostring(binary_pars[k](c,tex.getcount('ltj@@stack'))))