1 %#! euptex -shell-escape
4 \immediate\openout1=jisx0208_1.lua
5 \def\OUT{\immediate\write1}
7 \def\@firstoftwo#1#2{#1}
8 \def\@secondoftwo#1#2{#2}
10 \ifnum\numexpr#1\relax#2\numexpr#3\relax
11 \expandafter\@firstoftwo
13 \expandafter\@secondoftwo
17 \ifnumcomp{#1}<{(#1)/(#2)*(#2)}{%
24 \ifnumcomp{#1}<0{}{\hn@i{#1}{}}%
31 \expandafter\hn@ii\expandafter{%
32 \the\numexpr\truncdiv{#1}{16}%
37 \expandafter\hn@i\expandafter{%
38 \number\numexpr#1\expandafter\expandafter\expandafter
39 \expandafter\expandafter\expandafter\expandafter}%
40 \expandafter\expandafter\expandafter\expandafter
41 \expandafter\expandafter\expandafter{%
42 \hn@digit{(#2)-16*(#1)}#3}%
45 \catcode`012\catcode`112\catcode`212\catcode`312\catcode`412
46 \catcode`512\catcode`612\catcode`712\catcode`812\catcode`912
47 \catcode`A12\catcode`B12\catcode`C12\catcode`D12\catcode`E12
50 \ifcase\numexpr#1\relax 0%
80 \font\tt=cmtt10 at 10pt\tt\baselineskip=12pt\parindent=0pt\parskip=0pt
85 \OUT!table_jisx0208_uptex = {?
89 \tmp=\ku \multiply\tmp"100 \advance\tmp"2020 %"
93 \tmpa=\jis\tmp \tmpb=\tmp\advance\tmpb-"2020%"
97 \OUT! false, -- 0x\hex\tmpb?
100 \ifnum\ten<95\relax\repeat
103 \ifnum\ku<95\relax\repeat
108 \immediate\openout1=jisx0208_2.tmp
109 \OUT!kpse.set_program_name("luatex")?
110 \OUT!require('lualibs')?
111 \OUT!local t=require('jisx0208_1.lua')?
112 \OUT!local s=t.table_jisx0208_uptex?
113 \OUT!for i=#s,1,-1 do if type(s[i])=='number' then a=i;break end end?
114 \OUT!for i=a+1,#s do s[i]=nil end?
115 \OUT!local f = io.open('ltj-jisx0208.lua', 'w')?
116 \OUT!f:write(table.serialize(t, 'return'))?
119 \immediate\write18!texlua jisx0208_2.tmp?
120 \immediate\write18!rm jisx0208_2.tmp?
121 \immediate\write18!rm jisx0208_1.lua?