% This is a change file for pTeX 3.1.9 % By Sadayuki Tanaka (sada-t@ascii.co.jp), Ken Nakano (ken-na@ascii.co.jp) % and ASCII Corporation. % % Thanks for : % Ryoichi Kurasawa (us009185@interramp.com), % Hisato Hamano, % Hiroto Kagotani (kagotani@in.it.okayama-u.ac.jp), % Takashi Kakiuchi (kakiuchi@sy6.isl.mei.co.jp), % Yoichi Kawabata (kawabata@canon.co.jp), % Makoto Kobayashi (makoto@lloem.fujidenki.co.jp), % Yoshihiro Aoki (aoki@tokyo-shoseki-ptg.co.jp), % Akira Kakuto (kakuto@fsci.fuk.kindai.ac.jp). % Koich Inoue (inoue@ma.ns.musashi-tech.ac.jp). % % (??/??/87) RKS jTeX 2.9 -- j1.0 % (??/??/89) RKS jTeX 2.93 -- j1.3 % (12/ 9/89) H_2 pTeX 2.93 j1.3 p1.0.1 % (12/??/89) RKS jTeX 2.95 -- j1.5 % (12/??/89) RKS jTeX 2.99 -- j1.5 % (02/02/90) RKS jTeX 2.99 -- j1.6 % (04/16/90) H_2 pTeX 2.99 j1.6 p1.0.3 % (09/14/90) H_2 pTeX 2.99 j1.6 p1.0.9 -- pre-release % (10/29/90) H_2 Bug fix (p1.0.9a) % (01/21/92) H_2 jTeX 2.99 - j1.7 % (01/21/92) H_2 pTeX 2.99 j1.7 p1.0.9F % (03/09/92) H_2 pTeX 2.99 j1.7 p1.0.9G jflag BUG % (03/20/95) KN pTeX p2.0 (based on 3.1415) % (09/08/95) KN pTeX p2.1 % (09/20/95) KN pTeX p2.1.1 % (11/21/95) KN pTeX p2.1.4 % (08/27/97) KN pTeX p2.1.5 (based on 3.14159) % (02/26/98) KN pTeX p2.1.6 % (03/19/98) KN pTeX p2.1.7 % (03/26/98) KN pTeX p2.1.8 (Web2c 7.2) % (02/21/2000) KN pTeX p2.1.9 (Web2c 7.3.1) % (11/13/2000) KN pTeX p2.1.10 % (05/22/2001) KN pTeX p2.1.11 % (03/10/2001) KN pTeX p3.0 (modified BSD licence) % (09/02/2004) ST pTeX p3.1.4 % (11/29/2004) KN pTeX p3.1.5 % (12/13/2004) KN pTeX p3.1.8 % (10/17/2005) ST pTeX p3.1.9 % @x [1.2] l.195 - pTeX: @d TeX_banner_k=='This is TeXk, Version 3.141592' {printed when \TeX\ starts} @d TeX_banner=='This is TeX, Version 3.141592' {printed when \TeX\ starts} @y @d TeX_banner_k=='This is pTeXk, Version 3.141592-p3.1.9' {printed when p\TeX\ starts} @d TeX_banner=='This is pTeX, Version 3.141592-p3.1.9' {printed when p\TeX\ starts} @z @x [2.??] l.586 - pTeX: @!ASCII_code=0..255; {eight-bit numbers} @y @!ASCII_code=0..255; {eight-bit numbers} @!KANJI_code=0..65535; {sixteen-bit numbers} @z @x l.632 - pTeX mubyte_read: array [ASCII_code] of pointer; { non zero iff character begins the multi byte code } mubyte_write: array [ASCII_code] of str_number; { non zero iff character expands to multi bytes in log and write files } mubyte_cswrite: array [0..127] of pointer; { non null iff cs mod 128 expands to multi bytes in log and write files } mubyte_skip: integer; { the number of bytes to skip in |buffer| } mubyte_keep: integer; { the number of chars we need to keep unchanged } mubyte_skeep: integer; { saved |mubyte_keep| } mubyte_prefix: integer; { the type of mubyte prefix } mubyte_tablein: boolean; { the input side of table will be updated } mubyte_tableout: boolean; { the output side of table will be updated } mubyte_relax: boolean; { the relax prefix is used } mubyte_start: boolean; { we are making the token at the start of the line } mubyte_sstart: boolean; { saved |mubyte_start| } mubyte_token: pointer; { the token returned by |read_buffer| } mubyte_stoken: pointer; { saved first token in mubyte primitive } mubyte_sout: integer; { saved value of |mubyte_out| } mubyte_slog: integer; { saved value of |mubyte_log| } spec_sout: integer; { saved value of |spec_out| } no_convert: boolean; { conversion supressed by noconvert primitive } active_noconvert: boolean; { true if noconvert primitive is active } write_noexpanding: boolean; { true only if we need not write expansion } cs_converting: boolean; { true only if we need csname converting } special_printing: boolean; { true only if we need converting in special } message_printing: boolean; { true if message or errmessage prints to string } @y @z @x l.803 - pTeX {Initialize enc\TeX\ data.} for i:=0 to 255 do mubyte_read[i]:=null; for i:=0 to 255 do mubyte_write[i]:=0; for i:=0 to 128 do mubyte_cswrite[i]:=null; mubyte_keep := 0; mubyte_start := false; write_noexpanding := false; cs_converting := false; special_printing := false; message_printing := false; no_convert := false; active_noconvert := false; @y @z @x [4.??] l.870 - pTeX: @!eight_bits=0..255; {unsigned one-byte quantity} @y @!eight_bits=0..255; {unsigned one-byte quantity} @!sixteen_bits=0..65535; {unsigned two-bytes quantity} @z @x [3.??] l.891 - pTeX: @ All of the file opening functions are defined in C. @y @ All of the file opening functions are defined in C. @ Kanji code handling. @d jis_enc=0 {denotes JIS X 2022 kanji encoding} @d euc_enc=1 {denotes EUC kanji encoding} @d sjis_enc=2 {denotes Shift JIS kanji encoding} @= @!proc_kanji_code:jis_enc..sjis_enc; @z @x [4.47] l.1325 - pTeX: @!init function get_strings_started:boolean; {initializes the string pool, but returns |false| if something goes wrong} label done,exit; var k,@!l:0..255; {small indices or counters} @y @!init function get_strings_started:boolean; {initializes the string pool, but returns |false| if something goes wrong} label done,exit; var k,@!l:KANJI_code; {small indices or counters} @z @x [4.49] l.1384 - pTeX: @= (k<" ")or(k>"~") @y @= not (iskanji1(k) or iskanji2(k) or xprn[k]) @z @x [5.54] l.1514 - pTeX: Global variables @!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for pseudoprinting} @y @!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for pseudoprinting} @!trick_buf2:array[0..ssup_error_line] of 0..2; {pTeX: buffer for KANJI} @!kcode_pos: 0..2; {pTeX: denotes whether first byte or second byte of KANJI} @z @x [5.55] l.1519 - pTeX: Initialize the kcode_pos @ @= selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; @y @ @= selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; kcode_pos:=0; @z @x [5.57] l.1538 - pTeX: kcode_pos procedure print_ln; {prints an end-of-line} begin case selector of term_and_log: begin wterm_cr; wlog_cr; term_offset:=0; file_offset:=0; end; log_only: begin wlog_cr; file_offset:=0; end; term_only: begin wterm_cr; term_offset:=0; end; no_print,pseudo,new_string: do_nothing; othercases write_ln(write_file[selector]) endcases;@/ @y procedure print_ln; {prints an end-of-line} begin case selector of term_and_log: begin if kcode_pos=1 then begin wterm(' '); wlog(' '); end; wterm_cr; wlog_cr; term_offset:=0; file_offset:=0; end; log_only: begin if kcode_pos=1 then wlog(' '); wlog_cr; file_offset:=0; end; term_only: begin if kcode_pos=1 then wterm(' '); wterm_cr; term_offset:=0; end; no_print,pseudo,new_string: do_nothing; othercases write_ln(write_file[selector]) endcases;@/ kcode_pos:=0; @z @x [5.58] l.1557 - pTeX: kcode_pos, trick_buf2 procedure print_char(@!s:ASCII_code); {prints a single character} label exit; begin if @ then if selector then if selector=max_print_line-1 then begin wlog_cr; file_offset:=0; end; if (selector=term_and_log)or(selector=term_only) then if term_offset>=max_print_line-1 then begin wterm_cr; term_offset:=0; end; end else kcode_pos:=0; case selector of term_and_log: begin wterm(xchr[s]); incr(term_offset); if term_offset=max_print_line then begin wterm_cr; term_offset:=0; end; wlog(xchr[s]); incr(file_offset); if file_offset=max_print_line then begin wlog_cr; file_offset:=0; end; end; log_only: begin wlog(xchr[s]); incr(file_offset); if file_offset=max_print_line then print_ln; end; term_only: begin wterm(xchr[s]); incr(term_offset); if term_offset=max_print_line then print_ln; end; no_print: do_nothing; pseudo: if tally=str_ptr then s:="???" {this can't happen} @.???@> else if s<256 then if s<0 then s:="???" {can't happen} else begin if (selector>pseudo) and (not special_printing) and (not message_printing) then begin print_char(s); return; {internal strings are not expanded} end; if (@) then if selector0) and (not no_convert) and (mubyte_write[s]>0) then s := mubyte_write[s] else if xprn[s] or special_printing then begin print_char(s); no_convert := false; return; end; no_convert := false; nl:=new_line_char; new_line_char:=-1; {temporarily disable new-line character} j:=str_start[s]; while j=str_ptr then s:="???" {this can't happen} @.???@> else if s<256 then if s<0 then s:="???" {can't happen} else begin if selector>pseudo then begin print_char(s); return; {internal strings are not expanded} end; if (@) then if selector= if src_specials_p or file_line_error_style_p or parse_first_line_p then wterm(banner_k) else wterm(banner); @y @= if src_specials_p or file_line_error_style_p or parse_first_line_p then wterm(banner_k) else wterm(banner); wterm(' ('); case proc_kanji_code of jis_enc: wterm('jis'); euc_enc: wterm('euc'); sjis_enc: wterm('sjis'); othercases wterm('?'); endcases; wterm(')'); @z @x l.1820 - pTeX k:=first; while k < last do begin print_buffer(k) end; @y if last<>first then for k:=first to last-1 do print(buffer[k]); @z @x [8.112] l.2588 - pTeX: @d ho(#)==# {to take a sixteen-bit item from a halfword} @y @d ho(#)==# {to take a sixteen-bit item from a halfword} @d KANJI(#)==# {pTeX: to output an KANJI code into a halfword} @d tokanji(#)==# {pTeX: to take an KANJI code into a halfword} @d tonum(#)==# {pTeX: to put an KANJI code into a halfword} @z @x [10.135] l.3008 - pTeX: box_dir, space_ptr, xspace_ptr @d hlist_node=0 {|type| of hlist nodes} @d box_node_size=7 {number of words to allocate for a box node} @d width_offset=1 {position of |width| field in a box node} @d depth_offset=2 {position of |depth| field in a box node} @d height_offset=3 {position of |height| field in a box node} @d width(#) == mem[#+width_offset].sc {width of the box, in sp} @d depth(#) == mem[#+depth_offset].sc {depth of the box, in sp} @d height(#) == mem[#+height_offset].sc {height of the box, in sp} @d shift_amount(#) == mem[#+4].sc {repositioning distance, in sp} @d list_offset=5 {position of |list_ptr| field in a box node} @d list_ptr(#) == link(#+list_offset) {beginning of the list inside the box} @d glue_order(#) == subtype(#+list_offset) {applicable order of infinity} @d glue_sign(#) == type(#+list_offset) {stretching or shrinking} @d normal=0 {the most common case when several cases are named} @d stretching = 1 {glue setting applies to the stretch components} @d shrinking = 2 {glue setting applies to the shrink components} @d glue_offset = 6 {position of |glue_set| in a box node} @d glue_set(#) == mem[#+glue_offset].gr {a word of type |glue_ratio| for glue setting} @y @d hlist_node=0 {|type| of hlist nodes} @d box_node_size=8 {number of words to allocate for a box node} @# @d box_dir(#) == subtype(#) {direction mode of a box} @d dir_default == qi(0) {direction of the box, default Left to Right} @d dir_dtou == qi(1) {direction of the box, Bottom to Top} @d dir_tate == qi(3) {direction of the box, Top to Bottom} @d dir_yoko == qi(4) {direction of the box, equal default} @d any_dir == dir_yoko,dir_tate,dir_dtou @# @d width_offset=1 {position of |width| field in a box node} @d depth_offset=2 {position of |depth| field in a box node} @d height_offset=3 {position of |height| field in a box node} @d width(#) == mem[#+width_offset].sc {width of the box, in sp} @d depth(#) == mem[#+depth_offset].sc {depth of the box, in sp} @d height(#) == mem[#+height_offset].sc {height of the box, in sp} @d shift_amount(#) == mem[#+4].sc {repositioning distance, in sp} @d list_offset=5 {position of |list_ptr| field in a box node} @d list_ptr(#) == link(#+list_offset) {beginning of the list inside the box} @d glue_order(#) == subtype(#+list_offset) {applicable order of infinity} @d glue_sign(#) == type(#+list_offset) {stretching or shrinking} @d normal=0 {the most common case when several cases are named} @d stretching = 1 {glue setting applies to the stretch components} @d shrinking = 2 {glue setting applies to the shrink components} @d glue_offset = 6 {position of |glue_set| in a box node} @d glue_set(#) == mem[#+glue_offset].gr {a word of type |glue_ratio| for glue setting} @d space_offset = 7 {position of |glue_set| in a box node} @d space_ptr(#) == link(#+space_offset) @d xspace_ptr(#) == info(#+space_offset) @z @x [10.136] l.3037 - pTeX: space_ptr, xspace_ptr width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); @y width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); space_ptr(p):=zero_glue; xspace_ptr(p):=zero_glue; add_glue_ref(zero_glue); add_glue_ref(zero_glue); @z @x [10.137] l.3045 - pTeX: direction change node @d vlist_node=1 {|type| of vlist nodes} @y @d vlist_node=1 {|type| of vlist nodes} @ A |dir_node| stands for direction change. @d dir_node=2 {|type| of dir nodes} @p function new_dir_node(b:pointer; dir:eight_bits):pointer; var p:pointer; {the new node} begin if type(b)>vlist_node then confusion("new_dir_node:not box"); p:=new_null_box; type(p):=dir_node; box_dir(p):=dir; case box_dir(b) of dir_yoko: @; dir_tate: @; dir_dtou: @; othercases confusion("new_dir_node:illegal dir"); endcases; link(b):=null; list_ptr(p):=b; new_dir_node:=p; end; @ @= case dir of dir_tate: begin width(p):=height(b)+depth(b); depth(p):=width(b)/2; height(p):=width(b)-depth(p); end; dir_dtou: begin width(p):=height(b)+depth(b); depth(p):=0; height(p):=width(b); end; othercases confusion("new_dir_node:y->?"); endcases @ @= case dir of dir_yoko: begin width(p):=height(b)+depth(b); depth(p):=0; height(p):=width(b); end; dir_dtou: begin width(p):=width(b); depth(p):=height(b); height(p):=depth(b); end; othercases confusion("new_dir_node:t->?"); endcases @ @= case dir of dir_yoko: begin width(p):=height(b)+depth(b); depth(p):=0; height(p):=width(b); end; dir_tate: begin width(p):=width(b); depth(p):=height(b); height(p):=depth(b); end; othercases confusion("new_dir_node:d->?"); endcases @z @x [10.138] l.3054 - pTeX: renumber rule_node @d rule_node=2 {|type| of rule nodes} @y @d rule_node=3 {|type| of rule nodes} @z @x [10.140] l.3083 - pTeX: renumber ins_node, add ins_dir field @d ins_node=3 {|type| of insertion nodes} @d ins_node_size=5 {number of words to allocate for an insertion} @d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} @d ins_ptr(#)==info(#+4) {the vertical list to be inserted} @d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} @y @d ins_node=4 {|type| of insertion nodes} @d ins_node_size=6 {number of words to allocate for an insertion} @d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} @d ins_ptr(#)==info(#+4) {the vertical list to be inserted} @d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} @d ins_dir(#)==subtype(#+5) {direction of |ins_node|} @z @x [10.141] l.3089 - pTeX: disp_node @ A |mark_node| has a |mark_ptr| field that points to the reference count @y @ A |disp_node| has a |disp_dimen| field that points to the displacement distance of the baselineshift between Latin characters and Kanji chatacters. @d disp_node=5 {|type| of a displace node} @d disp_dimen(#)==mem[#+1].sc @ A |mark_node| has a |mark_ptr| field that points to the reference count @z @x [10.140] l.3095 - pTeX: renumber nodes @d mark_node=4 {|type| of a mark node} @y @d mark_node=6 {|type| of a mark node} @z @x [10.141] l.3105 - pTeX: renumber nodes @d adjust_node=5 {|type| of an adjust node} @y @d adjust_node=7 {|type| of an adjust node} @z @x [10.142] l.3122 - pTeX: renumber nodes @d ligature_node=6 {|type| of a ligature node} @y @d ligature_node=8 {|type| of a ligature node} @z @x [10.145] l.3163 - pTeX: renumber nodes @d disc_node=7 {|type| of a discretionary node} @y @d disc_node=9 {|type| of a discretionary node} @z @x [10.146] l.3191 - pTeX: renumber nodes @d whatsit_node=8 {|type| of special extension nodes} @y @d whatsit_node=10 {|type| of special extension nodes} @z @x [10.147] l.3198 - pTeX: renumber nodes @d math_node=9 {|type| of a math node} @y @d math_node=11 {|type| of a math node} @z @x [10.150] l.3244 - pTeX: renumber nodes @d glue_node=10 {|type| of node that points to a glue specification} @y @d glue_node=12 {|type| of node that points to a glue specification} @z @x [10.155] l.3342 - pTeX: renumber nodes @d kern_node=11 {|type| of a kern node} @d explicit=1 {|subtype| of kern nodes from \.{\\kern} and \.{\\/}} @d acc_kern=2 {|subtype| of kern nodes from accents} @y @d kern_node=13 {|type| of a kern node} @d explicit=1 {|subtype| of kern nodes from \.{\\kern}} @d acc_kern=2 {|subtype| of kern nodes from accents} @d ita_kern=3 {|subtype| of kern nodes from \.{\\/}} @z @x [10.157] l.3363 - pTeX: renumber nodes @d penalty_node=12 {|type| of a penalty node} @y @d penalty_node=14 {|type| of a penalty node} @d widow_pena=1 {|subtype| of penalty nodes from \.{\\jchrwidowpenalty}} @d kinsoku_pena=2 {|subtype| of penalty nodes from kinsoku} @z @x [10.159] l.3392 - pTeX: renumber nodes @d unset_node=13 {|type| for an unset node} @y @d unset_node=15 {|type| for an unset node} @z @x [10.160] l.3397 - pTeX: renumber nodes @ In fact, there are still more types coming. When we get to math formula processing we will see that a |style_node| has |type=14|; and a number of larger type codes will also be defined, for use in math mode only. @y @ In fact, there are still more types coming. When we get to math formula processing we will see that a |style_node| has |type=16|; and a number of larger type codes will also be defined, for use in math mode only. @z @x [12.174] l.3662 - pTeX: print KANJI print_ASCII(qo(character(p))); @y if font_dir[font(p)]<>dir_default then begin p:=link(p); print_kanji(info(p)); end else print_ASCII(qo(character(p))); @z @x [12.175] l.3672 - pTeX: Print a short indication of dir_nodes. hlist_node,vlist_node,ins_node,whatsit_node,mark_node,adjust_node, unset_node: print("[]"); @y hlist_node,vlist_node,dir_node,ins_node,whatsit_node, mark_node,adjust_node,unset_node: print("[]"); @z @x [12.176] l.3698 - pTeX: print KANJI. print_char(" "); print_ASCII(qo(character(p))); @y print_char(" "); if font_dir[font(p)]<>dir_default then begin p:=link(p); print_kanji(info(p)); end else print_ASCII(qo(character(p))); @z @x [12.183] l.3815 - pTeX: display char_node and disp_node. if is_char_node(p) then print_font_and_char(p) else case type(p) of hlist_node,vlist_node,unset_node: @; rule_node: @; ins_node: @; whatsit_node: @; @y if is_char_node(p) then begin print_font_and_char(p); if font_dir[font(p)]<>dir_default then p:=link(p) end else case type(p) of hlist_node,vlist_node,dir_node,unset_node: @; rule_node: @; ins_node: @; whatsit_node: @; disp_node: begin print_esc("displace "); print_scaled(disp_dimen(p)); end; @z @x [12.184] l.3833 - pTeX: display dir_node. @ @= begin if type(p)=hlist_node then print_esc("h") else if type(p)=vlist_node then print_esc("v") else print_esc("unset"); @y @ @= begin case type(p) of hlist_node: print_esc("h"); vlist_node: print_esc("v"); dir_node: print_esc("dir"); othercases print_esc("unset") endcases@/; @z @x [12.184] l.3842 - pTeX: display dir_node. if shift_amount(p)<>0 then begin print(", shifted "); print_scaled(shift_amount(p)); end; @y if shift_amount(p)<>0 then begin print(", shifted "); print_scaled(shift_amount(p)); end; if box_dir(p)<>dir_default then begin print(", "); print_direction(box_dir(p)); end; @z @x [12.188] l.3896 - pTeX: Display insertion and ins_dir. @ @= begin print_esc("insert"); print_int(qo(subtype(p))); print(", natural size "); print_scaled(height(p)); @y @ @= begin print_esc("insert"); print_int(qo(subtype(p))); print_dir(ins_dir(p)); print(", natural size "); print_scaled(height(p)); @z @x [12.194] l.3961 - pTeX: Display penalty usage @ @= begin print_esc("penalty "); print_int(penalty(p)); end @y @ @= begin print_esc("penalty "); print_int(penalty(p)); if subtype(p)=widow_pena then print("(for \jchrwidowpenalty)") else if subtype(p)=kinsoku_pena then print("(for kinsoku)"); end @z @x [13.202] l.4043 - pTeX: dir_node, disp_node hlist_node,vlist_node,unset_node: begin flush_node_list(list_ptr(p)); free_node(p,box_node_size); goto done; end; @y hlist_node,vlist_node,dir_node,unset_node: begin flush_node_list(list_ptr(p)); fast_delete_glue_ref(space_ptr(p)); fast_delete_glue_ref(xspace_ptr(p)); free_node(p,box_node_size); goto done; end; @z @x [13.202] l.4056 - pTeX: kern_node,math_node,penalty_node: do_nothing; @y kern_node,disp_node,math_node,penalty_node: do_nothing; @z @x [14.206] l.4121 - pTeX: space_ptr, xspace_ptr, dir_node, disp_node @ @= case type(p) of hlist_node,vlist_node,unset_node: begin r:=get_node(box_node_size); mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last two words} list_ptr(r):=copy_node_list(list_ptr(p)); {this affects |mem[r+5]|} words:=5; end; rule_node: begin r:=get_node(rule_node_size); words:=rule_node_size; end; ins_node: begin r:=get_node(ins_node_size); mem[r+4]:=mem[p+4]; add_glue_ref(split_top_ptr(p)); ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} words:=ins_node_size-1; end; @y @ @= case type(p) of hlist_node,vlist_node,dir_node,unset_node: begin r:=get_node(box_node_size); mem[r+7]:=mem[p+7]; mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last three words} add_glue_ref(space_ptr(r)); add_glue_ref(xspace_ptr(r)); list_ptr(r):=copy_node_list(list_ptr(p)); {this affects |mem[r+5]|} words:=5; end; rule_node: begin r:=get_node(rule_node_size); words:=rule_node_size; end; ins_node: begin r:=get_node(ins_node_size); mem[r+5]:=mem[p+5]; mem[r+4]:=mem[p+4]; add_glue_ref(split_top_ptr(p)); ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} words:=ins_node_size-2; end; @z @x [14.206] l.4140 - pTeX: disp_node kern_node,math_node,penalty_node: begin r:=get_node(small_node_size); words:=small_node_size; end; @y kern_node,disp_node,math_node,penalty_node: begin r:=get_node(small_node_size); words:=small_node_size; end; @z @x [15.207] l.4201 - pTeX: Add kanji, kana, other_kchar category codes. @d max_char_code=15 {largest catcode for individual characters} @y @d kanji=16 {kanji} @d kana=17 {hiragana, katakana, alphabet} @d other_kchar=18 {kanji codes} @d max_char_code=18 {largest catcode for individual characters} @z @x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. @d char_num=16 {character specified numerically ( \.{\\char} )} @d math_char_num=17 {explicit math code ( \.{\\mathchar} )} @d mark=18 {mark definition ( \.{\\mark} )} @d xray=19 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} @d make_box=20 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} @d hmove=21 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} @d vmove=22 {vertical motion ( \.{\\raise}, \.{\\lower} )} @d un_hbox=23 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} @d un_vbox=24 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} @d remove_item=25 {nullify last item ( \.{\\unpenalty}, \.{\\unkern}, \.{\\unskip} )} @d hskip=26 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} @d vskip=27 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} @d mskip=28 {math glue ( \.{\\mskip} )} @d kern=29 {fixed space ( \.{\\kern})} @d mkern=30 {math kern ( \.{\\mkern} )} @d leader_ship=31 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} @d halign=32 {horizontal table alignment ( \.{\\halign} )} @d valign=33 {vertical table alignment ( \.{\\valign} )} @d no_align=34 {temporary escape from alignment ( \.{\\noalign} )} @d vrule=35 {vertical rule ( \.{\\vrule} )} @d hrule=36 {horizontal rule ( \.{\\hrule} )} @d insert=37 {vlist inserted in box ( \.{\\insert} )} @d vadjust=38 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} @d ignore_spaces=39 {gobble |spacer| tokens ( \.{\\ignorespaces} )} @d after_assignment=40 {save till assignment is done ( \.{\\afterassignment} )} @d after_group=41 {save till group is done ( \.{\\aftergroup} )} @d break_penalty=42 {additional badness ( \.{\\penalty} )} @d start_par=43 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} @d ital_corr=44 {italic correction ( \.{\\/} )} @d accent=45 {attach accent in text ( \.{\\accent} )} @d math_accent=46 {attach accent in math ( \.{\\mathaccent} )} @d discretionary=47 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} @d eq_no=48 {equation number ( \.{\\eqno}, \.{\\leqno} )} @d left_right=49 {variable delimiter ( \.{\\left}, \.{\\right} )} @d math_comp=50 {component of formula ( \.{\\mathbin}, etc.~)} @d limit_switch=51 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} @d above=52 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} @d math_style=53 {style specification ( \.{\\displaystyle}, etc.~)} @d math_choice=54 {choice specification ( \.{\\mathchoice} )} @d non_script=55 {conditional math glue ( \.{\\nonscript} )} @d vcenter=56 {vertically center a vbox ( \.{\\vcenter} )} @d case_shift=57 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} @d message=58 {send to user ( \.{\\message}, \.{\\errmessage} )} @d extension=59 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} @d in_stream=60 {files for reading ( \.{\\openin}, \.{\\closein} )} @d begin_group=61 {begin local grouping ( \.{\\begingroup} )} @d end_group=62 {end local grouping ( \.{\\endgroup} )} @d omit=63 {omit alignment template ( \.{\\omit} )} @d ex_space=64 {explicit space ( \.{\\\ } )} @d no_boundary=65 {suppress boundary ligatures ( \.{\\noboundary} )} @d radical=66 {square root and similar signs ( \.{\\radical} )} @d end_cs_name=67 {end control sequence ( \.{\\endcsname} )} @d min_internal=68 {the smallest code that can follow \.{\\the}} @d char_given=68 {character code defined by \.{\\chardef}} @d math_given=69 {math code defined by \.{\\mathchardef}} @d last_item=70 {most recent item ( \.{\\lastpenalty}, \.{\\lastkern}, \.{\\lastskip} )} @d max_non_prefixed_command=70 {largest command code that can't be \.{\\global}} @y @d char_num=max_char_code+1 {character specified numerically ( \.{\\char} )} @d math_char_num=char_num+1 {explicit math code ( \.{\\mathchar} )} @d mark=math_char_num+1 {mark definition ( \.{\\mark} )} @d xray=mark+1 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} @d make_box=xray+1 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} @d hmove=make_box+1 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} @d vmove=hmove+1 {vertical motion ( \.{\\raise}, \.{\\lower} )} @d un_hbox=vmove+1 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} @d un_vbox=un_hbox+1 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} @d remove_item=un_vbox+1 {nullify last item ( \.{\\unpenalty}, \.{\\unkern}, \.{\\unskip} )} @d hskip=remove_item+1 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} @d vskip=hskip+1 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} @d mskip=vskip+1 {math glue ( \.{\\mskip} )} @d kern=mskip+1 {fixed space ( \.{\\kern})} @d mkern=kern+1 {math kern ( \.{\\mkern} )} @d leader_ship=mkern+1 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} @d halign=leader_ship+1 {horizontal table alignment ( \.{\\halign} )} @d valign=halign+1 {vertical table alignment ( \.{\\valign} )} @d no_align=valign+1 {temporary escape from alignment ( \.{\\noalign} )} @d vrule=no_align+1 {vertical rule ( \.{\\vrule} )} @d hrule=vrule+1 {horizontal rule ( \.{\\hrule} )} @d insert=hrule+1 {vlist inserted in box ( \.{\\insert} )} @d vadjust=insert+1 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} @d ignore_spaces=vadjust+1 {gobble |spacer| tokens ( \.{\\ignorespaces} )} @d after_assignment=ignore_spaces+1 {save till assignment is done ( \.{\\afterassignment} )} @d after_group=after_assignment+1 {save till group is done ( \.{\\aftergroup} )} @d break_penalty=after_group+1 {additional badness ( \.{\\penalty} )} @d start_par=break_penalty+1 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} @d ital_corr=start_par+1 {italic correction ( \.{\\/} )} @d accent=ital_corr+1 {attach accent in text ( \.{\\accent} )} @d math_accent=accent+1 {attach accent in math ( \.{\\mathaccent} )} @d discretionary=math_accent+1 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} @d eq_no=discretionary+1 {equation number ( \.{\\eqno}, \.{\\leqno} )} @d left_right=eq_no+1 {variable delimiter ( \.{\\left}, \.{\\right} )} @d math_comp=left_right+1 {component of formula ( \.{\\mathbin}, etc.~)} @d limit_switch=math_comp+1 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} @d above=limit_switch+1 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} @d math_style=above+1 {style specification ( \.{\\displaystyle}, etc.~)} @d math_choice=math_style+1 {choice specification ( \.{\\mathchoice} )} @d non_script=math_choice+1 {conditional math glue ( \.{\\nonscript} )} @d vcenter=non_script+1 {vertically center a vbox ( \.{\\vcenter} )} @d case_shift=vcenter+1 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} @d message=case_shift+1 {send to user ( \.{\\message}, \.{\\errmessage} )} @d extension=message+1 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} @d in_stream=extension+1 {files for reading ( \.{\\openin}, \.{\\closein} )} @d begin_group=in_stream+1 {begin local grouping ( \.{\\begingroup} )} @d end_group=begin_group+1 {end local grouping ( \.{\\endgroup} )} @d omit=end_group+1 {omit alignment template ( \.{\\omit} )} @d ex_space=omit+1 {explicit space ( \.{\\\ } )} @d no_boundary=ex_space+1 {suppress boundary ligatures ( \.{\\noboundary} )} @d radical=no_boundary+1 {square root and similar signs ( \.{\\radical} )} @d end_cs_name=radical+1 {end control sequence ( \.{\\endcsname} )} @d min_internal=end_cs_name+1 {the smallest code that can follow \.{\\the}} @d char_given=min_internal {character code defined by \.{\\chardef}} @d math_given=char_given+1 {math code defined by \.{\\mathchardef}} @d last_item=math_given+1 {most recent item ( \.{\\lastpenalty}, \.{\\lastkern}, \.{\\lastskip} )} @d inhibit_glue=last_item+1 {inhibit adjust glue ( \.{\\inhibitglue} )} @d chg_dir=inhibit_glue+1 {change dir mode by \.{\\tate}, \.{\\yoko}} @d max_non_prefixed_command=chg_dir {largest command code that can't be \.{\\global}} @z @x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing @d toks_register=71 {token list register ( \.{\\toks} )} @d assign_toks=72 {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} @d assign_int=73 {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} @d assign_dimen=74 {user-defined length ( \.{\\hsize}, etc.~)} @d assign_glue=75 {user-defined glue ( \.{\\baselineskip}, etc.~)} @d assign_mu_glue=76 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} @d assign_font_dimen=77 {user-defined font dimension ( \.{\\fontdimen} )} @d assign_font_int=78 {user-defined font integer ( \.{\\hyphenchar}, \.{\\skewchar} )} @d set_aux=79 {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} @d set_prev_graf=80 {specify state info ( \.{\\prevgraf} )} @d set_page_dimen=81 {specify state info ( \.{\\pagegoal}, etc.~)} @d set_page_int=82 {specify state info ( \.{\\deadcycles}, \.{\\insertpenalties} )} @d set_box_dimen=83 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} @d set_shape=84 {specify fancy paragraph shape ( \.{\\parshape} )} @d def_code=85 {define a character code ( \.{\\catcode}, etc.~)} @d def_family=86 {declare math fonts ( \.{\\textfont}, etc.~)} @d set_font=87 {set current font ( font identifiers )} @d def_font=88 {define a font file ( \.{\\font} )} @d register=89 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} @d max_internal=89 {the largest code that can follow \.{\\the}} @d advance=90 {advance a register or parameter ( \.{\\advance} )} @d multiply=91 {multiply a register or parameter ( \.{\\multiply} )} @d divide=92 {divide a register or parameter ( \.{\\divide} )} @d prefix=93 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} @d let=94 {assign a command code ( \.{\\let}, \.{\\futurelet} )} @d shorthand_def=95 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} {or \.{\\charsubdef}} @d read_to_cs=96 {read into a control sequence ( \.{\\read} )} @d def=97 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} @d set_box=98 {set a box ( \.{\\setbox} )} @d hyph_data=99 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} @d set_interaction=100 {define level of interaction ( \.{\\batchmode}, etc.~)} @d max_command=100 {the largest command code seen at |big_switch|} @y @d toks_register=max_non_prefixed_command+1 {token list register ( \.{\\toks} )} @d assign_toks=toks_register+1 {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} @d assign_int=assign_toks+1 {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} @d assign_dimen=assign_int+1 {user-defined length ( \.{\\hsize}, etc.~)} @d assign_glue=assign_dimen+1 {user-defined glue ( \.{\\baselineskip}, etc.~)} @d assign_mu_glue=assign_glue+1 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} @d assign_font_dimen=assign_mu_glue+1 {user-defined font dimension ( \.{\\fontdimen} )} @d assign_font_int=assign_font_dimen+1 {user-defined font integer ( \.{\\hyphenchar}, \.{\\skewchar} )} @d assign_kinsoku=assign_font_int+1 {user-defined kinsoku character ( \.{\\prebreakpenalty}, \.{\\postbreakpenalty} )} @d assign_inhibit_xsp_code=assign_kinsoku+1 {user-defined inhibit xsp character ( \.{\\inhibitxspcode} )} @d set_kansuji_char=assign_inhibit_xsp_code+1 {user-defined kansuji character ( \.{\\kansujichar} )} @d set_aux=set_kansuji_char+1 {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} @d set_prev_graf=set_aux+1 {specify state info ( \.{\\prevgraf} )} @d set_page_dimen=set_prev_graf+1 {specify state info ( \.{\\pagegoal}, etc.~)} @d set_page_int=set_page_dimen+1 {specify state info ( \.{\\deadcycles}, \.{\\insertpenalties} )} @d set_box_dimen=set_page_int+1 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} @d set_shape=set_box_dimen+1 {specify fancy paragraph shape ( \.{\\parshape} )} @d def_code=set_shape+1 {define a character code ( \.{\\catcode}, etc.~)} @d def_family=def_code+1 {declare math fonts ( \.{\\textfont}, etc.~)} @d set_font=def_family+1 {set current font ( font identifiers )} @d def_font=set_font+1 {define a font file ( \.{\\font} )} @d def_jfont=def_font+1 {define a font file ( \.{\\jfont} )} @d def_tfont=def_jfont+1 {define a font file ( \.{\\tfont} )} @d register=def_tfont+1 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} @d max_internal=register {the largest code that can follow \.{\\the}} @d advance=max_internal+1 {advance a register or parameter ( \.{\\advance} )} @d multiply=advance+1 {multiply a register or parameter ( \.{\\multiply} )} @d divide=multiply+1 {divide a register or parameter ( \.{\\divide} )} @d prefix=divide+1 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} @d let=prefix+1 {assign a command code ( \.{\\let}, \.{\\futurelet} )} @d shorthand_def=let+1 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} @d read_to_cs=shorthand_def+1 {read into a control sequence ( \.{\\read} )} @d def=read_to_cs+1 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} @d set_box=def+1 {set a box ( \.{\\setbox} )} @d hyph_data=set_box+1 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} @d set_interaction=hyph_data+1 {define level of interaction ( \.{\\batchmode}, etc.~)} @d set_auto_spacing=set_interaction+1 {set auto spaceing mode ( \.{\\autospacing}, \.{\\noautospacing}, ( \.{\\autospacing}, \.{\\noautospacing} )} @d max_command=set_auto_spacing {the largest command code seen at |big_switch|} @z @x [16.212] l.4437 - pTeX: last_jchr, direction, adjust direction @= @!list_state_record=record@!mode_field:-mmode..mmode;@+ @!head_field,@!tail_field: pointer; @y @= @!list_state_record=record@!mode_field:-mmode..mmode;@+ @!dir_field,@!adj_dir_field: -dir_dtou..dir_dtou; @!pdisp_field: scaled; @!head_field,@!tail_field,@!pnode_field,@!last_jchr_field: pointer; @z @x [16.213] l.4445 - pTeX: last_jchr, direction, adjust_dir, prev_{node,disp} @d head==cur_list.head_field {header node of current list} @d tail==cur_list.tail_field {final node on current list} @y @d direction==cur_list.dir_field {current direction} @d adjust_dir==cur_list.adj_dir_field {current adjust direction} @d head==cur_list.head_field {header node of current list} @d tail==cur_list.tail_field {final node on current list} @d prev_node==cur_list.pnode_field {previous to last |disp_node|} @d prev_disp==cur_list.pdisp_field {displacemant at |prev_node|} @d last_jchr==cur_list.last_jchr_field {final jchar node on current list} @z @x [16.214] l.4464 - pTeX: prev_append: disp_node @d tail_append(#)==begin link(tail):=#; tail:=link(tail); end @y @d tail_append(#)==begin link(tail):=#; tail:=link(tail); end @d prev_append(#)==begin link(prev_node):=#; link(link(prev_node)):=tail; prev_node:=link(prev_node); end @z @x [16.215] l.4477 - pTeX: last_jchar, direction, adjust_dir, prev_node mode:=vmode; head:=contrib_head; tail:=contrib_head; @y mode:=vmode; head:=contrib_head; tail:=contrib_head; prev_node:=tail; direction:=dir_yoko; adjust_dir:=direction; prev_disp:=0; last_jchr:=null; @z @x [16.216] l.4496 - pTeX: last_jchr, displacement. incr(nest_ptr); head:=get_avail; tail:=head; prev_graf:=0; mode_line:=line; @y incr(nest_ptr); head:=new_null_box; tail:=head; prev_node:=tail; prev_graf:=0; prev_disp:=0; last_jchr:=null; mode_line:=line; @z @x [16.217] l.4504 - pTeX: pop_nest last_jchr @p procedure pop_nest; {leave a semantic level, re-enter the old} begin free_avail(head); decr(nest_ptr); cur_list:=nest[nest_ptr]; end; @y @p procedure pop_nest; {leave a semantic level, re-enter the old} begin fast_delete_glue_ref(space_ptr(head)); fast_delete_glue_ref(xspace_ptr(head)); free_node(head,box_node_size); decr(nest_ptr); cur_list:=nest[nest_ptr]; end; @z @x [16.218] l.4521 - pTeX: show_activities : direction print_nl("### "); print_mode(m); @y print_nl("### "); print_direction(nest[p].dir_field); print(", "); print_mode(m); @z @x [17.224] l.4711 - pTeX: kanji_skip_code xkanji_skip_code, jfm_skip @d thin_mu_skip_code=15 {thin space in math formula} @d med_mu_skip_code=16 {medium space in math formula} @d thick_mu_skip_code=17 {thick space in math formula} @d glue_pars=18 {total number of glue parameters} @y @d kanji_skip_code=15 {between kanji-kanji space} @d xkanji_skip_code=16 {between latin-kanji or kanji-latin space} @d thin_mu_skip_code=17 {thin space in math formula} @d med_mu_skip_code=18 {medium space in math formula} @d thick_mu_skip_code=19 {thick space in math formula} @d jfm_skip=20 {space refer from JFM} @d glue_pars=21 {total number of glue parameters} @z @x [17.224] l.4739 - kanji_skip, xkanji_skip @d thick_mu_skip==glue_par(thick_mu_skip_code) @y @d thick_mu_skip==glue_par(thick_mu_skip_code) @d kanji_skip==glue_par(kanji_skip_code) @d xkanji_skip==glue_par(xkanji_skip_code) @z @x [17.225] l.4767 - pTeX: kanji_skip_code xkanji_skip_code thick_mu_skip_code: print_esc("thickmuskip"); othercases print("[unknown glue parameter!]") @y thick_mu_skip_code: print_esc("thickmuskip"); kanji_skip_code: print_esc("kanjiskip"); xkanji_skip_code: print_esc("xkanjiskip"); jfm_skip: print("refer from jfm"); othercases print("[unknown glue parameter!]") @z @x [17.226] l.4813 - pTeX: kanji_skip_code xkanji_skip_code primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ @!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> @y primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ @!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> primitive("kanjiskip",assign_glue,glue_base+kanji_skip_code);@/ @!@:kanji_skip_}{\.{\\kanjiskip} primitive@> primitive("xkanjiskip",assign_glue,glue_base+xkanji_skip_code);@/ @!@:xkanji_skip_}{\.{\\xkanjiskip} primitive@> @z @x [17.230] l.4867 - pTeX: cat_code_size, cur_jfont_loc, auto_spacing, auto_xspacing, inhibit_xsp_code, cur_tfont_loc @d xord_code_base=cur_font_loc+1 @d xchr_code_base=xord_code_base+1 @d xprn_code_base=xchr_code_base+1 @d math_font_base=xprn_code_base+1 @d cat_code_base=math_font_base+48 {table of 256 command codes (the ``catcodes'')} @d lc_code_base=cat_code_base+256 {table of 256 lowercase mappings} @y @d math_font_base=cur_font_loc+1 {table of 48 math font numbers} @d cur_jfont_loc=math_font_base+48 @d cur_tfont_loc=cur_jfont_loc+1 @d auto_spacing_code=cur_tfont_loc+1 @d auto_xspacing_code=auto_spacing_code+1 @d cat_code_base=auto_xspacing_code+1 {table of 256 command codes (the ``catcodes'')} @d kcat_code_base=cat_code_base+256 {table of 256 command codes for the wchar's catcodes } @d auto_xsp_code_base=kcat_code_base+256 {table of 256 auto spacer flag} @d inhibit_xsp_code_base=auto_xsp_code_base+256 @d kinsoku_base=inhibit_xsp_code_base+256 {table of 256 kinsoku mappings} @d kansuji_base=kinsoku_base+256 {table of 10 kansuji mappings} @d lc_code_base=kansuji_base+10 {table of 256 lowercase mappings} @z @x [17.230] l.4900 - pTeX: @d char_sub_code(#)==equiv(char_sub_code_base+#) {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} @y @d char_sub_code(#)==equiv(char_sub_code_base+#) {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} @# @d cur_jfont==equiv(cur_jfont_loc) {pTeX: } @d cur_tfont==equiv(cur_tfont_loc) @d auto_spacing==equiv(auto_spacing_code) @d auto_xspacing==equiv(auto_xspacing_code) @d kcat_code(#)==equiv(kcat_code_base+#) @d auto_xsp_code(#)==equiv(auto_xsp_code_base+#) @d inhibit_xsp_type(#)==eq_type(inhibit_xsp_code_base+#) @d inhibit_xsp_code(#)==equiv(inhibit_xsp_code_base+#) @d kinsoku_type(#)==eq_type(kinsoku_base+#) @d kinsoku_code(#)==equiv(kinsoku_base+#) @d kansuji_char(#)==equiv(kansuji_base+#) @z @x [17.232] l.4959 - pTeX: initialize cat_code, cur_jfont, cur_tfont cur_font:=null_font; eq_type(cur_font_loc):=data; eq_level(cur_font_loc):=level_one;@/ @y cur_font:=null_font; eq_type(cur_font_loc):=data; eq_level(cur_font_loc):=level_one;@/ cur_jfont:=null_font; eq_type(cur_jfont_loc):=data; eq_level(cur_jfont_loc):=level_one;@/ cur_tfont:=null_font; eq_type(cur_tfont_loc):=data; eq_level(cur_tfont_loc):=level_one;@/ @z @x [17.232] l.4965 - pTeX: initialize cat_code, cur_jfont, cur_tfont for k:=0 to 255 do begin cat_code(k):=other_char; math_code(k):=hi(k); sf_code(k):=1000; end; @y eqtb[auto_spacing_code]:=eqtb[cat_code_base]; eqtb[auto_xspacing_code]:=eqtb[cat_code_base]; for k:=0 to 255 do begin cat_code(k):=other_char; kcat_code(k):=other_kchar; math_code(k):=hi(k); sf_code(k):=1000; auto_xsp_code(k):=0; inhibit_xsp_code(k):=0; inhibit_xsp_type(k):=0; kinsoku_code(k):=0; kinsoku_type(k):=0; end; @z @x [17.232] l.4971 - pTeX: initialize cat_code, cur_jfont, cur_tfont for k:="0" to "9" do math_code(k):=hi(k+var_code); for k:="A" to "Z" do begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ math_code(k):=hi(k+var_code+@"100); math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ sf_code(k):=999; end; @y for k:="0" to "9" do begin math_code(k):=hi(k+var_code); auto_xsp_code(k):=3; end; kansuji_char(0):=@"213B; kansuji_char(1):=@"306C; kansuji_char(2):=@"4673; kansuji_char(3):=@"3B30; kansuji_char(4):=@"3B4D; kansuji_char(5):=@"385E; kansuji_char(6):=@"4F3B; kansuji_char(7):=@"3C37; kansuji_char(8):=@"482C; kansuji_char(9):=@"3665; for k:="A" to "Z" do begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ math_code(k):=hi(k+var_code+@"100); math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ auto_xsp_code(k):=3; auto_xsp_code(k+"a"-"A"):=3;@/ sf_code(k):=999; end; if (proc_kanji_code=sjis_enc) then begin @t\hskip10pt@>kcat_code(129):=other_kchar; @t\hskip10pt@>kcat_code(130):=kana; @t\hskip10pt@>kcat_code(131):=kana; @t\hskip10pt@>kcat_code(132):=other_kchar; @+@t\1@>for k:=136 to 159 do kcat_code(k):=kanji; @+@t\1@>for k:=224 to 234 do kcat_code(k):=kanji; end else begin @t\hskip10pt@>kcat_code(161):=other_kchar; {1 ku} @t\hskip10pt@>kcat_code(162):=other_kchar; {2 ku} @t\hskip10pt@>kcat_code(163):=kana; {3 ku} @t\hskip10pt@>kcat_code(164):=kana; {4 ku} @t\hskip10pt@>kcat_code(165):=kana; {5 ku} @t\hskip10pt@>kcat_code(166):=kana; {6 ku} @t\hskip10pt@>kcat_code(167):=other_kchar; {7 ku} @t\hskip10pt@>kcat_code(168):=other_kchar; {8 ku} @+@t\1@>for k:=176 to 244 do kcat_code(k):=kanji; {16 ku ... 84 ku} end; @z @x [17.236] l.5092 - pTeX: cur_jfam_code, jchr_widow_penalty @d cur_fam_code=44 {current family} @d escape_char_code=45 {escape character for token output} @d default_hyphen_char_code=46 {value of \.{\\hyphenchar} when a font is loaded} @d default_skew_char_code=47 {value of \.{\\skewchar} when a font is loaded} @d end_line_char_code=48 {character placed at the right end of the buffer} @d new_line_char_code=49 {character that prints as |print_ln|} @d language_code=50 {current hyphenation table} @d left_hyphen_min_code=51 {minimum left hyphenation fragment size} @d right_hyphen_min_code=52 {minimum right hyphenation fragment size} @d holding_inserts_code=53 {do not remove insertion nodes from \.{\\box255}} @d error_context_lines_code=54 {maximum intermediate line pairs shown} @d tex_int_pars=55 {total number of \TeX's integer parameters} @# @d web2c_int_base=tex_int_pars {base for web2c's integer parameters} @d char_sub_def_min_code=web2c_int_base {smallest value in the charsubdef list} @d char_sub_def_max_code=web2c_int_base+1 {largest value in the charsubdef list} @d tracing_char_sub_def_code=web2c_int_base+2 {traces changes to a charsubdef def} @d mubyte_in_code=web2c_int_base+3 {if positive then reading mubytes is active} @d mubyte_out_code=web2c_int_base+4 {if positive then printing mubytes is active} @d mubyte_log_code=web2c_int_base+5 {if positive then print mubytes to log and terminal} @d spec_out_code=web2c_int_base+6 {if positive then print specials by mubytes} @d web2c_int_pars=web2c_int_base+7 {total number of web2c's integer parameters} @# @d int_pars=web2c_int_pars {total number of integer parameters} @d count_base=int_base+int_pars {256 user \.{\\count} registers} @y @d cur_fam_code=44 {current family} @d cur_jfam_code=45 {current kanji family} @d escape_char_code=46 {escape character for token output} @d default_hyphen_char_code=47 {value of \.{\\hyphenchar} when a font is loaded} @d default_skew_char_code=48 {value of \.{\\skewchar} when a font is loaded} @d end_line_char_code=49 {character placed at the right end of the buffer} @d new_line_char_code=50 {character that prints as |print_ln|} @d language_code=51 {current hyphenation table} @d left_hyphen_min_code=52 {minimum left hyphenation fragment size} @d right_hyphen_min_code=53 {minimum right hyphenation fragment size} @d holding_inserts_code=54 {do not remove insertion nodes from \.{\\box255}} @d error_context_lines_code=55 {maximum intermediate line pairs shown} @d jchr_widow_penalty_code=56 {penalty for creating a widow KANJI character line} @d char_sub_def_min_code=57 {smallest value in the charsubdef list} @d char_sub_def_max_code=58 {largest value in the charsubdef list} @d tracing_char_sub_def_code=59 {traces changes to a charsubdef def} @d int_pars=60 {total number of integer parameters} @d count_base=int_base+int_pars {256 user \.{\\count} registers} @z @x [17.236] l.5167 - pTeX: cur_jfam, |jchr_widow_penalty| @d cur_fam==int_par(cur_fam_code) @d escape_char==int_par(escape_char_code) @y @d cur_fam==int_par(cur_fam_code) @d cur_jfam==int_par(cur_jfam_code) @d escape_char==int_par(escape_char_code) @d jchr_widow_penalty==int_par(jchr_widow_penalty_code) @z @x l.5181 - pTeX @d tracing_char_sub_def==int_par(tracing_char_sub_def_code) @d mubyte_in==int_par(mubyte_in_code) @d mubyte_out==int_par(mubyte_out_code) @d mubyte_log==int_par(mubyte_log_code) @d spec_out==int_par(spec_out_code) @y @d tracing_char_sub_def==int_par(tracing_char_sub_def_code) @z @x [17.237] l.5244 - pTeX: cur_jfam_code, jchr_window_penalty_code new_line_char_code:print_esc("newlinechar"); @y new_line_char_code:print_esc("newlinechar"); cur_jfam_code:print_esc("jfam"); jchr_widow_penalty_code:print_esc("jcharwidowpenalty"); @z @x l.5252 - pTeX tracing_char_sub_def_code:print_esc("tracingcharsubdef"); mubyte_in_code:print_esc("mubytein"); mubyte_out_code:print_esc("mubyteout"); mubyte_log_code:print_esc("mubytelog"); spec_out_code:print_esc("specialout"); @y tracing_char_sub_def_code:print_esc("tracingcharsubdef"); @z @x [17.238] l.5365 - pTeX: cur_jfam_code, jchr_window_penalty_code primitive("newlinechar",assign_int,int_base+new_line_char_code);@/ @!@:new_line_char_}{\.{\\newlinechar} primitive@> @y primitive("newlinechar",assign_int,int_base+new_line_char_code);@/ @!@:new_line_char_}{\.{\\newlinechar} primitive@> primitive("jfam",assign_int,int_base+cur_jfam_code);@/ @!@:cur_jfam_}{\.{\\jfam} primitive@> primitive("jcharwidowpenalty",assign_int,int_base+jchr_widow_penalty_code);@/ @!@:jchr_widow_penalty}{\.{\\jcharwidowpenalty} primitive@> @z @x l.5387 - pTeX if enctex_p then begin enctex_enabled_p:=true; primitive("mubytein",assign_int,int_base+mubyte_in_code);@/ @!@:mubyte_in_}{\.{\\mubytein} primitive@> primitive("mubyteout",assign_int,int_base+mubyte_out_code);@/ @!@:mubyte_out_}{\.{\\mubyteout} primitive@> primitive("mubytelog",assign_int,int_base+mubyte_log_code);@/ @!@:mubyte_log_}{\.{\\mubytelog} primitive@> primitive("specialout",assign_int,int_base+spec_out_code);@/ @!@:spec_out_}{\.{\\specialout} primitive@> end; @y @z @x [17.247] l.5490 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift @d h_offset_code=18 {amount of horizontal offset when shipping pages out} @d v_offset_code=19 {amount of vertical offset when shipping pages out} @d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} @d dimen_pars=21 {total number of dimension parameters} @d scaled_base=dimen_base+dimen_pars {table of 256 user-defined \.{\\dimen} registers} @d eqtb_size=scaled_base+255 {largest subscript of |eqtb|} @y @d h_offset_code=18 {amount of horizontal offset when shipping pages out} @d v_offset_code=19 {amount of vertical offset when shipping pages out} @d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} @d t_baseline_shift_code=21 {shift amount when mixing TATE-kumi and Alphabet} @d y_baseline_shift_code=22 {shift amount when mixing YOKO-kumi and Alphabet} @d dimen_pars=23 {total number of dimension parameters} @d scaled_base=dimen_base+dimen_pars {table of 256 user-defined \.{\\dimen} registers} @d kinsoku_penalty_base=scaled_base+256 {table of 256 kinsoku registers} @d eqtb_size=kinsoku_penalty_base+255 {largest subscript of |eqtb|} @z @x l.5498 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift @d dimen(#)==eqtb[scaled_base+#].sc @d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} @y @d dimen(#)==eqtb[scaled_base+#].sc @d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} @d kinsoku_penalty(#)==eqtb[kinsoku_penalty_base+#].int @z @x l.5518 - pTeX: @d h_offset==dimen_par(h_offset_code) @d v_offset==dimen_par(v_offset_code) @y @d h_offset==dimen_par(h_offset_code) @d v_offset==dimen_par(v_offset_code) @d t_baseline_shift==dimen_par(t_baseline_shift_code) @d y_baseline_shift==dimen_par(y_baseline_shift_code) @z @x l.5542 - pTeX: h_offset_code:print_esc("hoffset"); v_offset_code:print_esc("voffset"); emergency_stretch_code:print_esc("emergencystretch"); othercases print("[unknown dimen parameter!]") @y h_offset_code:print_esc("hoffset"); v_offset_code:print_esc("voffset"); t_baseline_shift_code:print_esc("tbaselineshift"); y_baseline_shift_code:print_esc("ybaselineshift"); emergency_stretch_code:print_esc("emergencystretch"); othercases print("[unknown dimen parameter!]") @z @x [17.248] l.5588 - pTeX: rotate offset primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ @!@:h_offset_}{\.{\\hoffset} primitive@> primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ @!@:v_offset_}{\.{\\voffset} primitive@> @y primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ @!@:h_offset_}{\.{\\hoffset} primitive@> primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ @!@:v_offset_}{\.{\\voffset} primitive@> primitive("tbaselineshift",assign_dimen,dimen_base+t_baseline_shift_code);@/ @!@:t_baseline_shift_}{\.{\\tbaselineshift} primitive@> primitive("ybaselineshift",assign_dimen,dimen_base+y_baseline_shift_code);@/ @!@:y_baseline_shift_}{\.{\\ybaselineshift} primitive@> @z @x [17.252] l.5622 - pTeX: show eqtb else if n<=eqtb_size then @ else print_char("?"); {this can't happen either} end; tats @y else if n else if n<=eqtb_size then print("kinsoku") else print_char("?"); {this can't happen either} end; tats @z @x l.5777 - pTeX The conversion from control sequence to byte sequence for enc\TeX is implemented here. Of course, the simplest way is to implement an array of string pointers with |hash_size| length, but we assume that only a few control sequences will need to be converted. So |mubyte_cswrite|, an array with only 128 items, is used. The items point to the token lists. First token includes a csname number and the second points the string to be output. The third token includes the number of another csname and fourth token its pointer to the string etc. We need to do the sequential searching in one of the 128 token lists. @y @z @x l.5788 - pTeX procedure print_cs(@!p:integer); {prints a purported control sequence} var q: pointer; s: str_number; begin if active_noconvert and (not no_convert) and (eq_type(p) = let) and (equiv(p) = normal+11) then { noconvert } begin no_convert := true; return; end; s := 0; if cs_converting and (not no_convert) then begin q := mubyte_cswrite [p mod 128] ; while q <> null do if info (q) = p then begin s := info (link(q)); q := null; end else q := link (link (q)); end; no_convert := false; if s > 0 then print (s) else if p end; @y @z @x [18.265] l.5903 - pTeX: \jfont \tfont primitive("font",def_font,0);@/ @!@:font_}{\.{\\font} primitive@> @y primitive("font",def_font,0);@/ @!@:font_}{\.{\\font} primitive@> primitive("jfont",def_jfont,0);@/ @!@:jfont_}{\.{\\jfont} primitive@> primitive("tfont",def_tfont,0);@/ @!@:tfont_}{\.{\\tfont} primitive@> @z @x [18.266] l.5979 - pTeX: \jfont, \tfont def_font: print_esc("font"); @y def_font: print_esc("font"); def_jfont: print_esc("jfont"); def_tfont: print_esc("tfont"); @z @x l.5982 - pTeX end_cs_name: if chr_code = 10 then print_esc("endmubyte") else print_esc("endcsname"); @y end_cs_name: print_esc("endcsname"); @z @x [20.289] l.6387 - pTeX: cs_token_flag @d cs_token_flag==@'7777 {amount added to the |eqtb| location in a token that stands for a control sequence; is a multiple of~256, less~1} @y @d cs_token_flag==@"FFFF {amount added to the |eqtb| location in a token that stands for a control sequence; is a multiple of~256, less~1} @z @x [20.293] l.6496 - pTeX: show_token_list @ @= if (pmem_end) then begin print_esc("CLOBBERED."); return; @.CLOBBERED@> end; if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) else begin m:=info(p) div @'400; c:=info(p) mod @'400; if info(p)<0 then print_esc("BAD.") @.BAD@> else @; end @y @ @= if (pmem_end) then begin print_esc("CLOBBERED."); return; @.CLOBBERED@> end; if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) {wchar_token} else begin if check_kanji(info(p)) then {wchar_token} begin m:=kcat_code(Hi(info(p))); c:=info(p); end else begin m:=info(p) div @'400; c:=info(p) mod @'400; end; if (m256) then print_esc("BAD.") @.BAD@> else @; end @z @x [20.294] l.6512 - pTeX: show_token_list @= case m of left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, letter,other_char: print(c); @y @= case m of kanji,kana,other_kchar: print_kanji(KANJI(c)); left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, letter,other_char: print(c); @z @x [21.298] l.6632 - pTeX: print KANJI other_char: chr_cmd("the character "); @y other_char: chr_cmd("the character "); kanji,kana,other_kchar: begin print("kanji character "); print_kanji(KANJI(chr_code)); end; @z @x [22.303] l.6726 - pTeX: state mid_kanji 1) |state=mid_line| is the normal state.\cr 2) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr 3) |state=new_line| is the state at the beginning of a line.\cr}}$$ @y 1) |state=mid_line| is the normal state.\cr 2) |state=mid_kanji| is like |mid_line|, and internal KANJI string.\cr 3) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr 4) |state=new_line| is the state at the beginning of a line.\cr}}$$ @z @x [22.303] l.6736 - pTeX: state mid_kanji @d mid_line=1 {|state| code when scanning a line of characters} @d skip_blanks=2+max_char_code {|state| code when ignoring blanks} @d new_line=3+max_char_code+max_char_code {|state| code at start of line} @y @d mid_line=1 {|state| code when scanning a line of characters} @d mid_kanji=2+max_char_code {|state| code when scanning a line of characters} @d skip_blanks=3+max_char_code+max_char_code {|state| code when ignoring blanks} @d new_line=4+max_char_code+max_char_code+max_char_code {|state| code at start of line} @z @x [22.311] l.6986 - pTeX: label @p procedure show_context; {prints where the scanner is} label done; var old_setting:0..max_selector; {saved |selector| setting} @y @p procedure show_context; {prints where the scanner is} label done, done1; var old_setting:0..max_selector; {saved |selector| setting} @!s: pointer; {temporary pointer} @z @x [22.316] l.7110 - pTeX: init kcode_pos @d begin_pseudoprint== begin l:=tally; tally:=0; selector:=pseudo; trick_count:=1000000; end @y @d begin_pseudoprint== begin l:=tally; tally:=0; selector:=pseudo; kcode_pos:=0; trick_count:=1000000; end @z @x [22.316] l.7114 - pTeX: kcode_pos @d set_trick_count== begin first_count:=tally; trick_count:=tally+1+error_line-half_error_line; if trick_count0)and(trick_buf2[(first_count-1)mod error_line]=1) then incr(first_count); trick_count:=first_count+1+error_line-half_error_line; if trick_count= begin_pseudoprint; if buffer[limit]=end_line_char then j:=limit else j:=limit+1; {determine the effective end of the line} i := start; mubyte_skeep := mubyte_keep; mubyte_sstart := mubyte_start; mubyte_start := false; if j>0 then while i < j do begin if i=loc then set_trick_count; print_buffer(i); end; mubyte_keep := mubyte_skeep; mubyte_start := mubyte_sstart @y @= begin_pseudoprint; if buffer[limit]=end_line_char then j:=limit else j:=limit+1; {determine the effective end of the line} if j>0 then for i:=start to j-1 do begin if i=loc then set_trick_count; print(buffer[i]); end @z @x [22.319] l.7157 - pTeX: adjust kanji code token @ @= begin_pseudoprint; if token_type= begin_pseudoprint; if token_typenull) then begin if (link(start)=null)and(check_kanji(info(start))) then {wchar_token} begin cur_input:=input_stack[base_ptr-1]; s:=get_avail; info(s):=(buffer[loc] mod @'400); cur_input:=input_stack[base_ptr]; link(start):=s; show_token_list(start,loc,100000); free_avail(s);link(start):=null; goto done1; end; end; show_token_list(start,loc,100000); end else show_token_list(link(start),loc,100000); {avoid reference count} done1: @z @x l.7354 - pTeX Some additional routines used by the enc\TeX extension have to be declared at this point. @p @t\4@>@@/ @y @z @x l.7476 - pTeX @!i,@!j: 0..buf_size; {more indexes for encTeX} @!mubyte_incs: boolean; {control sequence is converted by mubyte} @!p:pointer; {for encTeX test if noexpanding} @y @z @x [24.341] l.7479 - pTeX: set last_chr @!cat:0..15; {|cat_code(cur_chr)|, usually} @y @!cat:escape..max_char_code; {|cat_code(cur_chr)|, usually} @!l:0..buf_size; {temporary index into |buffer|} @z @x [24.343] l.7500 - pTeX: input external file @ @= @^inner loop@> begin switch: if loc<=limit then {current line not yet finished} begin { Use |k| instead of |loc| for type correctness. } k := loc; cur_chr := read_buffer (k); loc := k; incr (loc); if (mubyte_token > 0) then begin state := mid_line; cur_cs := mubyte_token - cs_token_flag; goto found; end; reswitch: cur_cmd:=cat_code(cur_chr); @y @ @= @^inner loop@> begin switch: if loc<=limit then {current line not yet finished} begin cur_chr:=buffer[loc]; incr(loc); if (iskanji1(cur_chr))and(loc<=limit)and(iskanji2(buffer[loc])) then begin cur_cmd:=kcat_code(cur_chr); cur_chr:=cur_chr*@'400+buffer[loc]; incr(loc); end else reswitch: cur_cmd:=cat_code(cur_chr); @z @x [24.344] l.7535 - pTeX: ASCII-KANJI space handling @d any_state_plus(#) == mid_line+#,skip_blanks+#,new_line+# @y @d any_state_plus(#) == mid_line+#,mid_kanji+#,skip_blanks+#,new_line+# @z @x [24.347] l.7569 - pTeX: scaner @ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, #+sub_mark,#+letter,#+other_char @y @ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, #+sub_mark,#+letter,#+other_char @d all_jcode(#)==#+kanji,#+kana,#+other_kchar @z @x [24.347] l.7573 - pTeX: scaner mid_line+spacer:@; mid_line+car_ret:@; skip_blanks+car_ret,any_state_plus(comment): @; new_line+car_ret:@; mid_line+left_brace: incr(align_state); skip_blanks+left_brace,new_line+left_brace: begin state:=mid_line; incr(align_state); end; mid_line+right_brace: decr(align_state); skip_blanks+right_brace,new_line+right_brace: begin state:=mid_line; decr(align_state); end; add_delims_to(skip_blanks),add_delims_to(new_line): state:=mid_line; @y mid_kanji+spacer,mid_line+spacer:@; mid_line+car_ret:@; mid_kanji+car_ret: if skip_mode then @ else @; skip_blanks+car_ret,any_state_plus(comment): @; new_line+car_ret:@; mid_line+left_brace,mid_kanji+left_brace: incr(align_state); skip_blanks+left_brace,new_line+left_brace: begin state:=mid_line; incr(align_state); end; mid_line+right_brace,mid_kanji+right_brace: decr(align_state); skip_blanks+right_brace,new_line+right_brace: begin state:=mid_line; decr(align_state); end; add_delims_to(skip_blanks),add_delims_to(new_line),add_delims_to(mid_kanji): state:=mid_line; all_jcode(skip_blanks),all_jcode(new_line),all_jcode(mid_line): state:=mid_kanji; @ @= skip_mode:boolean; @ @= skip_mode:=true; @z @x [24.354] l.7659 - pTeX: scan control sequence @= begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} else begin start_cs: mubyte_incs := false; k := loc; mubyte_skeep := mubyte_keep; cur_chr := read_buffer (k); cat := cat_code (cur_chr); if (mubyte_in>0) and (not mubyte_incs) and ((mubyte_skip>0) or (cur_chr<>buffer[k])) then mubyte_incs := true; incr (k); if mubyte_token > 0 then begin state := mid_line; cur_cs := mubyte_token - cs_token_flag; goto found; end; if cat=letter then state:=skip_blanks else if cat=spacer then state:=skip_blanks else state:=mid_line; if (cat=letter)and(k<=limit) then @ else @; mubyte_keep := mubyte_skeep; cur_cs:=single_base + read_buffer(loc); incr(loc); end; found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); if cur_cmd>=outer_call then check_outer_validity; if write_noexpanding then begin p := mubyte_cswrite [cur_cs mod 128]; while p <> null do if info (p) = cur_cs then begin cur_cmd := relax; cur_chr := 256; p := null; end else p := link (link (p)); end; end @y @= begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} else begin k:=loc; cur_chr:=buffer[k]; incr(k); if (iskanji1(cur_chr))and(k<=limit)and(iskanji2(buffer[k])) then begin cat:=kcat_code(cur_chr); incr(k); end else cat:=cat_code(cur_chr); start_cs: if (cat=letter)or(cat=kanji)or(cat=kana) then state:=skip_blanks else if cat=spacer then state:=skip_blanks else state:=mid_line; if cat=other_kchar then begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; end else if ((cat=letter)or(cat=kanji)or(cat=kana))and(k<=limit) then @ else @; cur_cs:=single_base+buffer[loc]; incr(loc); end; found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); if cur_cmd>=outer_call then check_outer_validity; end @z @x @= begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then begin hex_to_cur_chr; buffer[k-1]:=cur_chr; end else if c<@'100 then buffer[k-1]:=c+@'100 else buffer[k-1]:=c-@'100; limit:=limit-d; first:=first-d; while k<=limit do begin buffer[k]:=buffer[k+d]; incr(k); end; goto start_cs; end; end; end @y @= begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then begin hex_to_cur_chr; buffer[k-1]:=cur_chr; end else if c<@'100 then buffer[k-1]:=c+@'100 else buffer[k-1]:=c-@'100; limit:=limit-d; first:=first-d; l:=k; cur_chr:=buffer[k-1]; cat:=cat_code(cur_chr); while l<=limit do begin buffer[l]:=buffer[l+d]; incr(l); end; goto start_cs; end; end; end @z @x [24.356] l.7727 - pTeX: scan control sequence (cont) @ @= begin repeat cur_chr := read_buffer (k); cat := cat_code (cur_chr); if mubyte_token>0 then cat := escape; if (mubyte_in>0) and (not mubyte_incs) and (cat=letter) and ((mubyte_skip>0) or (cur_chr<>buffer[k])) then mubyte_incs := true; incr (k); until (cat <> letter) or (k > limit); @; if cat <> letter then begin decr (k); k := k - mubyte_skip; end; if k > loc + 1 then { multiletter control sequence has been scanned } begin if mubyte_incs then { multibyte in csname occurrs } begin i := loc; j := first; mubyte_keep := mubyte_skeep; if j - loc + k > max_buf_stack then begin max_buf_stack := j - loc + k; if max_buf_stack >= buf_size then begin max_buf_stack := buf_size; overflow ("buffer size", buf_size); end; end; while i < k do begin buffer [j] := read_buffer (i); incr (i); incr (j); end; if j = first+1 then cur_cs := single_base + buffer [first] else cur_cs := id_lookup (first, j-first); end else cur_cs := id_lookup (loc, k-loc) ; loc := k; goto found; end; end @y @ @= begin repeat cur_chr:=buffer[k]; incr(k); if (iskanji1(cur_chr))and(k<=limit)and(iskanji2(buffer[k])) then begin cat:=kcat_code(cur_chr); incr(k); end else cat:=cat_code(cur_chr); while (buffer[k]=cur_chr)and(cat=sup_mark)and(k2 then begin hex_to_cur_chr; end else if c<@'100 then cur_chr:=c+@'100 else cur_chr:=c-@'100; cat:=cat_code(cur_chr); if (cat=letter)or(cat=sup_mark) then begin buffer[k-1]:=cur_chr; limit:=limit-d; first:=first-d; l:=k; while l<=limit do begin buffer[l]:=buffer[l+d]; incr(l); end; end; end; end; until not((cat=letter)or(cat=kanji)or(cat=kana))or(k>limit); {@@;} if not((cat=letter)or(cat=kanji)or(cat=kana)) then decr(k); if cat=other_kchar then decr(k); {now |k| points to first nonletter} if k>loc+1 then {multiletter control sequence has been scanned} begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; end; end @z @x [24.357] l.7771 - pTeX: input from token list @= if loc<>null then {list not exhausted} @^inner loop@> begin t:=info(loc); loc:=link(loc); {move to next} if t>=cs_token_flag then {a control sequence token} begin cur_cs:=t-cs_token_flag; cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); if cur_cmd>=outer_call then if cur_cmd=dont_expand then @ else check_outer_validity; if write_noexpanding then begin p := mubyte_cswrite [cur_cs mod 128]; while p <> null do if info (p) = cur_cs then begin cur_cmd := relax; cur_chr := 256; p := null; end else p := link (link (p)); end; end else begin cur_cmd:=t div @'400; cur_chr:=t mod @'400; case cur_cmd of left_brace: incr(align_state); right_brace: decr(align_state); out_param: @; othercases do_nothing endcases; end; end else begin {we are done with this token list} end_token_list; goto restart; {resume previous level} end @y @= if loc<>null then {list not exhausted} @^inner loop@> begin t:=info(loc); loc:=link(loc); {move to next} if t>=cs_token_flag then {a control sequence token} begin cur_cs:=t-cs_token_flag; cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); if cur_cmd>=outer_call then if cur_cmd=dont_expand then @ else check_outer_validity; end else if check_kanji(t) then {wchar_token} begin cur_chr:=t; cur_cmd:=kcat_code(Hi(t)); end else begin cur_cmd:=t div @'400; cur_chr:=t mod @'400; case cur_cmd of left_brace: incr(align_state); right_brace: decr(align_state); out_param: @; othercases do_nothing endcases; end; end else begin {we are done with this token list} end_token_list; goto restart; {resume previous level} end @z @x l.7898 - pTeX k := start; while k < limit do begin print_buffer(k) end; @y if start if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr else cur_tok:=cs_token_flag+cur_cs; end; @y @p procedure get_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|} begin no_new_control_sequence:=false; get_next; no_new_control_sequence:=true; @^inner loop@> if cur_cs=0 then if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {wchar_token} cur_tok:=cur_chr else cur_tok:=(cur_cmd*@'400)+cur_chr else cur_tok:=cs_token_flag+cur_cs; end; @z %@x [25.367] l.8019 - pTeX: expand %@= %begin save_scanner_status:=scanner_status; scanner_status:=normal; %get_token; scanner_status:=save_scanner_status; t:=cur_tok; %back_input; {now |start| and |loc| point to the backed-up token |t|} %if t>=cs_token_flag then % begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; % link(p):=loc; start:=p; loc:=p; % end; %end %@y %@= %begin save_scanner_status:=scanner_status; scanner_status:=normal; %get_token; scanner_status:=save_scanner_status; t:=cur_tok; %back_input; {now |start| and |loc| point to the backed-up token |t|} %if t>=cs_token_flag then % begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; % link(p):=loc; start:=p; loc:=p; % end; %end %@z @x [25.374] l.8073 - pTeX: get_chr @ @= j:=first; p:=link(r); while p<>null do begin if j>=max_buf_stack then begin max_buf_stack:=j+1; if max_buf_stack=buf_size then overflow("buffer size",buf_size); @:TeX capacity exceeded buffer size}{\quad buffer size@> end; buffer[j]:=info(p) mod @'400; incr(j); p:=link(p); end; @y @ @= j:=first; p:=link(r); while p<>null do begin if j>=max_buf_stack then begin max_buf_stack:=j+1; if max_buf_stack=buf_size then overflow("buffer size",buf_size); @:TeX capacity exceeded buffer size}{\quad buffer size@> end; if check_kanji(info(p)) then {wchar_token} begin buffer[j]:=Hi(info(p)); incr(j); buffer[j]:=Lo(info(p)); incr(j); p:=link(p); end else begin buffer[j]:=info(p) mod @'400; incr(j); p:=link(p); end; end; @z @x [25.380] l.8221 - pTeX: get_x_token @p procedure get_x_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|, and expands macros} label restart,done; begin restart: get_next; @^inner loop@> if cur_cmd<=max_command then goto done; if cur_cmd>=call then if cur_cmd if cur_cmd<=max_command then goto done; if cur_cmd>=call then if cur_cmdmax_command do begin expand; get_next; end; if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr else cur_tok:=cs_token_flag+cur_cs; @y @p procedure x_token; {|get_x_token| without the initial |get_next|} begin while cur_cmd>max_command do begin expand; get_next; end; if cur_cs=0 then if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then cur_tok:=cur_chr else cur_tok:=(cur_cmd*@'400)+cur_chr else cur_tok:=cs_token_flag+cur_cs; @z @x [26.413] l.8659 - pTeX: scan_somthing_internal @p procedure scan_something_internal(@!level:small_number;@!negative:boolean); {fetch an internal parameter} var m:halfword; {|chr_code| part of the operand token} @!p:0..nest_size; {index into |nest|} begin m:=cur_chr; case cur_cmd of def_code: @; toks_register,assign_toks,def_family,set_font,def_font: @; @y @p @t\4@>@@t@>@/ procedure scan_something_internal(@!level:small_number;@!negative:boolean); {fetch an internal parameter} var m:halfword; {|chr_code| part of the operand token} @!p:0..nest_size; {index into |nest|} @!q:pointer; begin m:=cur_chr; case cur_cmd of assign_kinsoku: @; assign_inhibit_xsp_code: @; def_code: @; toks_register,assign_toks,def_family,set_font,def_font,def_jfont,def_tfont: @; @z @x [26.414] l.8693 - pTeX: if m=xord_code_base then scanned_result(xord[cur_val])(int_val) else if m=xchr_code_base then scanned_result(xchr[cur_val])(int_val) else if m=xprn_code_base then scanned_result(xprn[cur_val])(int_val) else if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val) else if m0 then scanned_result(equiv(m+Hi(cur_val)))(int_val) else scanned_result(equiv(m+cur_val))(int_val) end else scanned_result(eqtb[m+cur_val].int)(int_val); @z @x [26.420] l.8799 - pTeX: Fetch a box dimension: dir_node if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc; @y if box(cur_val)=null then cur_val:=0 else begin q:=box(cur_val); while (q<>null)and(box_dir(q)<>abs(direction)) do q:=link(q); if q=null then begin q:=new_dir_node(box(cur_val),abs(direction)); cur_val:=mem[q+m].sc; delete_glue_ref(space_ptr(q)); delete_glue_ref(xspace_ptr(q)); free_node(q,box_node_size); end else cur_val:=mem[q+m].sc; end; @z @x [26.435] l.8940 - pTeX: scan_char_num procedure scan_char_num; begin scan_int; if (cur_val<0)or(cur_val>255) then begin print_err("Bad character code"); @.Bad character code@> help2("A character number must be between 0 and 255.")@/ ("I changed this one to zero."); int_error(cur_val); cur_val:=0; end; end; @y procedure scan_char_num; begin scan_int; if ((cur_val<0)or(cur_val>255))and(not check_kanji(cur_val)) then {wchar_token} begin print_err("Bad character code"); @.Bad character code@> help2("A character number must be between 0 and 255, or KANJI code.")@/ ("I changed this one to zero."); int_error(cur_val); cur_val:=0; end; end; @z @x [26.442] l.9045 - pTeX: KANJI character scanning @= begin get_token; {suppress macro expansion} if cur_tok255 then begin print_err("Improper alphabetic constant"); @.Improper alphabetic constant@> help2("A one-character control sequence belongs after a ` mark.")@/ ("So I'm essentially inserting \0 here."); cur_val:="0"; back_error; end else @; end @y @= begin get_token; {suppress macro expansion} if cur_tok255)and(cur_cmd help2("A one-character control sequence belongs after a ` mark.")@/ ("So I'm essentially inserting \0 here."); cur_val:="0"; back_error; end else @; skip_mode:=true; end @z @x [26.455] l.9288 - pTeX: zw, zh: zenkaku width & height if scan_keyword("em") then v:=(@) @.em@> else if scan_keyword("ex") then v:=(@) @.ex@> else goto not_found; @y if scan_keyword("em") then v:=(@) @.em@> else if scan_keyword("ex") then v:=(@) @.ex@> else if scan_keyword("zw") then @ @.ze@> else if scan_keyword("zh") then @ @.zh@> else goto not_found; @z @x [26.458] l.9345 - pTeX: dimension unit: Q, H (1/4 mm) else if scan_keyword("sp") then goto done @.sp@> @y else if scan_keyword("H") then set_conversion(7227)(10160) @.H@> else if scan_keyword("Q") then set_conversion(7227)(10160) @.Q@> else if scan_keyword("sp") then goto done @.sp@> @z @x [27.464] l.9475 - pTeX: str_toks if t=" " then t:=space_token else t:=other_token+t; @y if (iskanji1(t))and(k+1 @y primitive("fontname",convert,font_name_code);@/ @!@:font_name_}{\.{\\fontname} primitive@> primitive("kansuji",convert,kansuji_code); @!@:kansuji_}{\.{\\kansuji} primitive@> primitive("euc",convert,euc_code); @!@:euc_}{\.{\\euc} primitive@> primitive("sjis",convert,sjis_code); @!@:sjis_}{\.{\\sjis} primitive@> primitive("jis",convert,jis_code); @!@:jis_}{\.{\\jis} primitive@> primitive("kuten",convert,kuten_code); @!@:kuten_}{\.{\\kuten} primitive@> @z @x [27.469] l.9558 - pTeX: font_name_code: print_esc("fontname"); @y font_name_code: print_esc("fontname"); kansuji_code: print_esc("kansuji"); euc_code:print_esc("euc"); sjis_code:print_esc("sjis"); jis_code:print_esc("jis"); kuten_code:print_esc("kuten"); @z @x [27.470] l.9566 - pTeX: convert KANJI code continue @p procedure conv_toks; var old_setting:0..max_selector; {holds |selector| setting} @y @p procedure conv_toks; var old_setting:0..max_selector; {holds |selector| setting} @!cx:KANJI_code; {temporary register for KANJI} @z @x [27.471] l.9577 - pTeX: convert KANJI code continue @ @= case c of number_code,roman_numeral_code: scan_int; string_code, meaning_code: begin save_scanner_status:=scanner_status; scanner_status:=normal; get_token; scanner_status:=save_scanner_status; end; @y @ @= KANJI(cx):=0; case c of number_code,roman_numeral_code, kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int; string_code, meaning_code: begin save_scanner_status:=scanner_status; scanner_status:=normal; get_token; if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {wchar_token} KANJI(cx):=cur_tok; scanner_status:=save_scanner_status; end; @z @x [27.471] l.9587 - pTeX: convert KANJI code continue @ @= case c of number_code: print_int(cur_val); roman_numeral_code: print_roman_int(cur_val); string_code:if cur_cs<>0 then sprint_cs(cur_cs) else print_char(cur_chr); @y @ @= case c of number_code: print_int(cur_val); roman_numeral_code: print_roman_int(cur_val); jis_code: begin if (proc_kanji_code=sjis_enc) then cur_val:=JIStoSJIS(cur_val) else cur_val:=JIStoEUC(cur_val); print_int(cur_val); end; euc_code: begin if (proc_kanji_code=sjis_enc) then cur_val:=EUCtoSJIS(cur_val) else do_nothing; print_int(cur_val); end; sjis_code: begin if (proc_kanji_code=sjis_enc) then do_nothing else cur_val:=SJIStoEUC(cur_val); print_int(cur_val); end; kuten_code: begin if (proc_kanji_code=sjis_enc) then cur_val:=KUTENtoSJIS(cur_val) else cur_val:=KUTENtoEUC(cur_val); print_int(cur_val); end; kansuji_code: print_kansuji(cur_val); string_code:if cur_cs<>0 then sprint_cs(cur_cs) else if KANJI(cx)=0 then print_char(cur_chr) else print_kanji(cx); @z @x [28.487] l.9852 - pTeX: iftdir, ifydir, iftbox, ifybox @d if_case_code=16 { `\.{\\ifcase}' } @y @d if_case_code=16 { `\.{\\ifcase}' } @d if_tdir_code=17 { `\.{\\iftdir}' } @d if_ydir_code=18 { `\.{\\ifydir}' } @d if_mdir_code=19 { `\.{\\ifmdir}' } @d if_tbox_code=20 { `\.{\\iftbox}' } @d if_ybox_code=21 { `\.{\\ifybox}' } @z @x [28.487] l.9887 - pTeX: iftdir, ifydir, iftbox, ifybox primitive("ifcase",if_test,if_case_code); @!@:if_case_}{\.{\\ifcase} primitive@> @y primitive("ifcase",if_test,if_case_code); @!@:if_case_}{\.{\\ifcase} primitive@> primitive("iftdir",if_test,if_tdir_code); @!@:if_tdir_}{\.{\\iftdir} primitive@> primitive("ifydir",if_test,if_ydir_code); @!@:if_ydir_}{\.{\\ifydir} primitive@> primitive("ifmdir",if_test,if_mdir_code); @!@:if_mdir_}{\.{\\ifmdir} primitive@> primitive("iftbox",if_test,if_tbox_code); @!@:if_tbox_}{\.{\\iftbox} primitive@> primitive("ifybox",if_test,if_ybox_code); @!@:if_ybox_}{\.{\\ifybox} primitive@> @z @x [28.488] l.9907 - pTeX: iftdir, ifydir, iftbox, ifybox if_case_code:print_esc("ifcase"); @y if_case_code:print_esc("ifcase"); if_tdir_code:print_esc("iftdir"); if_ydir_code:print_esc("ifydir"); if_mdir_code:print_esc("ifmdir"); if_tbox_code:print_esc("iftbox"); if_ybox_code:print_esc("ifybox"); @z @x [28.501] l.10073 - pTeX: iftdir, ifydir, iftbox, ifybox if_void_code, if_hbox_code, if_vbox_code: @; @y if_tdir_code: b:=(abs(direction)=dir_tate); if_ydir_code: b:=(abs(direction)=dir_yoko); if_mdir_code: b:=(direction<0); if_void_code, if_hbox_code, if_vbox_code, if_tbox_code, if_ybox_code: @; @z @x [28.505] l.10118 - pTeX: Test box register status : iftbox, ifybox if this_if=if_void_code then b:=(p=null) else if p=null then b:=false else if this_if=if_hbox_code then b:=(type(p)=hlist_node) else b:=(type(p)=vlist_node); @y if this_if=if_void_code then b:=(p=null) else if p=null then b:=false else begin if type(p)=dir_node then p:=list_ptr(p); if this_if=if_hbox_code then b:=(type(p)=hlist_node) else if this_if=if_vbox_code then b:=(type(p)=vlist_node) else if this_if=if_tbox_code then b:=(box_dir(p)=dir_tate) else b:=(box_dir(p)=dir_yoko); end @z @x [28.502] l.10138 - pTeX: ifx : Test character : KANJI character if (cur_cmd>active_char)or(cur_chr>255) then {not a character} begin m:=relax; n:=256; end else begin m:=cur_cmd; n:=cur_chr; end; get_x_token_or_active_char; if (cur_cmd>active_char)or(cur_chr>255) then begin cur_cmd:=relax; cur_chr:=256; end; @y if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then begin m:=cur_cmd; n:=cur_chr; end else if (cur_cmd>active_char)or(cur_chr>255) then begin m:=relax; n:=256; end else begin m:=cur_cmd; n:=cur_chr; end; get_x_token_or_active_char; if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then begin cur_cmd:=cur_cmd; end {dummy} else if (cur_cmd>active_char)or(cur_chr>255) then begin cur_cmd:=relax; cur_chr:=256; end; @z @x [29.523] l.10571 - pTeX: xord for j:=1 to n do append_to_name(xord[TEX_format_default[j]]); for j:=a to b do append_to_name(buffer[j]); for j:=format_default_length-format_ext_length+1 to format_default_length do append_to_name(xord[TEX_format_default[j]]); @y if name_of_file then libc_free (name_of_file); name_of_file := xmalloc (1 + n + (b - a + 1) + format_ext_length + 1); for j:=1 to n do append_to_name(xord[TEX_format_default[j]]); for j:=a to b do append_to_name(buffer[j]); for j:=format_default_length-format_ext_length+1 to format_default_length do append_to_name(xord[TEX_format_default[j]]); @z @x [29.526] l.10668 - pTeX: scan file name loop@+begin if (cur_cmd>other_char)or(cur_chr>255) then {not a character} begin back_input; goto done; end; {If |cur_chr| is a space and we're not scanning a token list, check whether we're at the end of the buffer. Otherwise we end up adding spurious spaces to file names in some cases.} if (cur_chr=" ") and (state<>token_list) and (loc>limit) then goto done; if not more_name(cur_chr) then goto done; get_x_token; end; done: end_name; name_in_progress:=false; @y skip_mode:=false; loop@+begin if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {is kanji} begin str_room(2); append_char(cur_chr div 256); {kanji upper byte} append_char(cur_chr mod 256); {kanji lower byte} end else if (cur_cmd>other_char)or(cur_chr>255) then {not a alphabet} begin back_input; goto done; end {If |cur_chr| is a space and we're not scanning a token list, check whether we're at the end of the buffer. Otherwise we end up adding spurious spaces to file names in some cases.} else if ((cur_chr=" ") and (state<>token_list) and (loc>limit)) or not more_name(cur_chr) then goto done; get_x_token; end; done: end_name; name_in_progress:=false; skip_mode:=true; @z @x l.10797 - pTeX if enctex_enabled_p then begin wlog_cr; wlog(encTeX_banner); wlog(', reencoding enabled'); if translate_filename then begin wlog_cr; wlog(' (\xordcode, \xchrcode, \xprncode overridden by TCX)'); end; end; @y @z @x [29.536] l.10834 - pTeX: begin if src_specials_p or file_line_error_style_p or parse_first_line_p then wlog(banner_k) else wlog(banner); @y begin if src_specials_p or file_line_error_style_p or parse_first_line_p then wlog(banner_k) else wlog(banner); wlog(' ('); case proc_kanji_code of jis_enc: wlog('jis'); euc_enc: wlog('euc'); sjis_enc: wlog('sjis'); othercases wterm('?'); endcases; wlog(')'); @z @x [30.560] l.10968 - pTeX: This is called BigEndian order. @!@^BigEndian order@> @y This is called BigEndian order. @!@^BigEndian order@> We use to get \TeX\ knowledge about KANJI fonts from \.{JFM} files. The \.{JFM} format holds more two 16-bit integers ,|id| and |nt|, at the top of the file. $$\vbox{\halign{\hfil#&$\null=\null$#\hfil\cr |id|&identification code of the file;\cr |nt|&number of words in the |char_type| table;\cr}}$$ The identification byte, |id| equals~11 or~9. When \TeX read a font file, the |id| equals~11 or~9 then the font is the \.{JFM}, othercases it is the \.{TFM} file. The \.{TFM} holds |lf| at the same postion of |id|, usually it take a larger number than~9 or~11. The |nt| is nonngative and less than $2^{15}$. We must have |ec=0|, $$\hbox{|lf=7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np|.}$$ @d yoko_jfm_id=11 {for `yoko-kumi' fonts} @d tate_jfm_id=9 {for `tate-kumi' fonts} @z @x [30.544] l.11085 - pTeX: gk_tag operation looks for both |list_tag| and |ext_tag|. @y operation looks for both |list_tag| and |ext_tag|. If the \.{JFM}, the |lig_tag| is called |gk_tag|. The |gk_tag| means that this character has a glue/kerning program starting at position |remainder| in the |glue_kern| array. And a \.{JFM} not used |tag=2| and |tag=3|. @z @x [30.544] l.11088 - pTeX: gk_tag @d lig_tag=1 {character has a ligature/kerning program} @y @d lig_tag=1 {character has a ligature/kerning program} @d gk_tag=1 {character has a glue/kerning program} @z @x [30.549] l.11228 - pTeX: @= @!font_info: ^fmemory_word; @y @= @!font_info: ^memory_word; {pTeX: use halfword for |char_type| table.} @!font_dir: ^eight_bits; {pTeX: direction of fonts, 0 is default, 1 is Yoko, 2 is Tate} @!font_num_ext: ^integer; {pTeX: number of the |char_type| table.} @z @x [30.550] l.11270 - pTeX: @!char_base: ^integer; {base addresses for |char_info|} @y @!char_base: ^integer; {base addresses for |char_info|} @!ctype_base: ^integer; {pTeX: base addresses for KANJI character type parameters} @z @x [30.554] l.11373 - pTeX: @d orig_char_info_end(#)==#].qqqq @d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end @y @d orig_char_info_end(#)==#].qqqq @d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end @# @d kchar_code_end(#)==#].hh.rh @d kchar_code(#)==font_info[ctype_base[#]+kchar_code_end @d kchar_type_end(#)==#].hh.lhfield @d kchar_type(#)==font_info[ctype_base[#]+kchar_type_end @z @x [30.557] l.11413 - pTeX: glue_kern_start @d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} @y @d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} @d glue_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of glue/kern program} @z @x [30.560] l.11457 - pTeX: jfm_flag, jfm_id, nt, cx var k:font_index; {index into |font_info|} @y var k:font_index; {index into |font_info|} @!jfm_flag:dir_default..dir_tate; {direction of the \.{JFM}} @!nt:halfword; {number of the |char_type| tables} @!cx:KANJI_code; {kanji code} @z @x [30.565] l.11548 - pTeX: read tfm size @ @= begin read_sixteen(lf); fget; read_sixteen(lh); fget; read_sixteen(bc); fget; read_sixteen(ec); if (bc>ec+1)or(ec>255) then abort; if bc>255 then {|bc=256| and |ec=255|} begin bc:=1; ec:=0; end; fget; read_sixteen(nw); fget; read_sixteen(nh); fget; read_sixteen(nd); fget; read_sixteen(ni); fget; read_sixteen(nl); fget; read_sixteen(nk); fget; read_sixteen(ne); fget; read_sixteen(np); if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; end @y @ @= begin read_sixteen(lf); fget; read_sixteen(lh); if lf=yoko_jfm_id then begin jfm_flag:=dir_yoko; nt:=lh; fget; read_sixteen(lf); fget; read_sixteen(lh); end else if lf=tate_jfm_id then begin jfm_flag:=dir_tate; nt:=lh; fget; read_sixteen(lf); fget; read_sixteen(lh); end else begin jfm_flag:=dir_default; nt:=0; end; fget; read_sixteen(bc); fget; read_sixteen(ec); if (bc>ec+1)or(ec>255) then abort; if bc>255 then {|bc=256| and |ec=255|} begin bc:=1; ec:=0; end; fget; read_sixteen(nw); fget; read_sixteen(nh); fget; read_sixteen(nd); fget; read_sixteen(ni); fget; read_sixteen(nl); fget; read_sixteen(nk); fget; read_sixteen(ne); fget; read_sixteen(np); if jfm_flag<>dir_default then begin if lf<>7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort end else begin if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort end end @z @x [30.566] l.11574 - pTeX: set font_dir & font_num_ext @= lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} if np<7 then lf:=lf+7-np; {at least seven parameters will appear} if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then @; f:=font_ptr+1; char_base[f]:=fmem_ptr-bc; width_base[f]:=char_base[f]+ec+1; height_base[f]:=width_base[f]+nw; depth_base[f]:=height_base[f]+nh; italic_base[f]:=depth_base[f]+nd; lig_kern_base[f]:=italic_base[f]+ni; kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; exten_base[f]:=kern_base[f]+kern_base_offset+nk; param_base[f]:=exten_base[f]+ne @y @= if jfm_flag<>dir_default then lf:=lf-7-lh {If \.{JFM}, |lf| holds more two-16bit records than \.{TFM}} else lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} if np<7 then lf:=lf+7-np; {at least seven parameters will appear} if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then @; f:=font_ptr+1; font_dir[f]:=jfm_flag; font_num_ext[f]:=nt; ctype_base[f]:=fmem_ptr; char_base[f]:=ctype_base[f]+nt-bc; width_base[f]:=char_base[f]+ec+1; height_base[f]:=width_base[f]+nw; depth_base[f]:=height_base[f]+nh; italic_base[f]:=depth_base[f]+nd; lig_kern_base[f]:=italic_base[f]+ni; kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; exten_base[f]:=kern_base[f]+kern_base_offset+nk; param_base[f]:=exten_base[f]+ne; @z @x [30.569] l.11619 - pTeX: read char_type @ @= for k:=fmem_ptr to width_base[f]-1 do begin store_four_quarters(font_info[k].qqqq); @y @ @= if jfm_flag<>dir_default then for k:=ctype_base[f] to ctype_base[f]+nt-1 do begin fget; read_sixteen(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|} fget; read_sixteen(cx); font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|} end; for k:=char_base[f]+bc to width_base[f]-1 do begin store_four_quarters(font_info[k].qqqq); @z @x [30.570] l.11638 - pTeX: @d current_character_being_worked_on==k+bc-fmem_ptr @y @d current_character_being_worked_on==k-char_base[f] @z @x [30.573] l.11704 - pTeX: jfm if a>128 then begin if 256*c+d>=nl then abort; if a=255 then if k=lig_kern_base[f] then bchar:=b; end else begin if b<>bchar then check_existence(b); if c<128 then check_existence(d) {check ligature} else if 256*(c-128)+d>=nk then abort; {check kern} if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; end; end; @y if a>128 then begin if 256*c+d>=nl then abort; if a=255 then if k=lig_kern_base[f] then bchar:=b; end else begin if b<>bchar then check_existence(b); if c<128 then begin if jfm_flag<>dir_default then begin if d>=ne then abort; end else check_existence(d); {check ligature} end else if 256*(c-128)+d>=nk then abort; {check kern} if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; end; end; @z @x [30.574] l.11720 - pTeX: read jfm exten for k:=exten_base[f] to param_base[f]-1 do begin store_four_quarters(font_info[k].qqqq); @y if jfm_flag<>dir_default then for k:=exten_base[f] to param_base[f]-1 do store_scaled(font_info[k].sc) {NOTE: this area subst for glue program} else for k:=exten_base[f] to param_base[f]-1 do begin store_four_quarters(font_info[k].qqqq); @z @x [30.576] l.11765 - pTeX: adjust ctype_base adjust(char_base); adjust(width_base); adjust(lig_kern_base); @y adjust(ctype_base); adjust(char_base); adjust(width_base); adjust(lig_kern_base); @z @x [30.577] l.11778 - pTeX: jfont, tfont if cur_cmd=def_font then f:=cur_font @y if cur_cmd=def_jfont then f:=cur_jfont else if cur_cmd=def_tfont then f:=cur_tfont else if cur_cmd=def_font then f:=cur_font @z @x @p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); begin if tracing_lost_chars>0 then begin begin_diagnostic; print_nl("Missing character: There is no "); @.Missing character@> print_ASCII(c); print(" in font "); slow_print(font_name[f]); print_char("!"); end_diagnostic(false); end; end; @y @d print_lc_hex(#)==l:=#; if l<10 then print_char(l+"0")@+else print_char(l-10+"a") @p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); var @!l:0..255; {small indices or counters} begin if tracing_lost_chars>0 then begin begin_diagnostic; print_nl("Missing character: There is no "); @.Missing character@> if (c<" ")or(c>"~") then begin print_char("^"); print_char("^"); if c<64 then print_char(c+64) else if c<128 then print_char(c-64) else begin print_lc_hex(c div 16); print_lc_hex(c mod 16); end end else print_ASCII(c); print(" in font "); slow_print(font_name[f]); print_char("!"); end_diagnostic(false); end; end; @z @x [31.586] l.12189 - pTeX: define set2 @d set1=128 {typeset a character and move right} @y @d set1=128 {typeset a character and move right} @d set2=129 {typeset a character and move right} @z @x [31.586] l.12214 - pTeX: define dirchg @d post_post=249 {postamble ending} @y @d post_post=249 {postamble ending} @d dirchg=255 {direction change} @z @x [31.587] l.12246 - pTeX: ex_id_byte @d id_byte=2 {identifies the kind of \.{DVI} files described here} @y @d id_byte=2 {identifies the kind of \.{DVI} files described here} @d ex_id_byte=3 {identifies the kind of extended \.{DVI} files} @z @x [32.590] l.12329 - pTeX: ex_id_byte: This dvi is extended! @ The last part of the postamble, following the |post_post| byte that signifies the end of the font definitions, contains |q|, a pointer to the |post| command that started the postamble. An identification byte, |i|, comes next; this currently equals~2, as in the preamble. @y @ The last part of the postamble, following the |post_post| byte that signifies the end of the font definitions, contains |q|, a pointer to the |post| command that started the postamble. An identification byte, |i|, comes next; this equals~2 or~3. If not used p\TeX primitives then the identification byte equals~2, othercase this is set to~3. @z @x [32.592] l.12405 - pTeX: {character and font in current |char_node|} @!c:quarterword; @!f:internal_font_number; @y {character and font in current |char_node|} @!c:quarterword; @!f:internal_font_number; @!dir_used:boolean; {Is this dvi extended?} @z @x [32.593] l.12414 - pTeX: dir_used: Is this dvi extended? doing_leaders:=false; dead_cycles:=0; cur_s:=-1; @y doing_leaders:=false; dead_cycles:=0; cur_s:=-1; dir_used:=false; @z @x [32.617] l.12846 - pTeX: Initialize dvi_dir as shipout begins dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; @y dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; dvi_dir:=dir_yoko; cur_dir:=dvi_dir; @z @x [32.619] l.12892 - pTeX: hlist_out Kanji, disp_node procedure hlist_out; {output an |hlist_node| box} label reswitch, move_past, fin_rule, next_p, continue, found; var base_line: scaled; {the baseline coordinate for this box} @y procedure hlist_out; {output an |hlist_node| box} label reswitch, move_past, fin_rule, next_p, continue, found; var base_line: scaled; {the baseline coordinate for this box} @!disp: scaled; {displacement} @!save_dir:eight_bits; {what |dvi_dir| should pop to} @!jc:KANJI_code; {temporary register for KANJI codes} @!ksp_ptr:pointer; {position of |auto_spacing_glue| in the hlist} @z @x [32.619] l.12913 - pTeX: hlist_out Kanji, disp_node incr(cur_s); if cur_s>0 then dvi_out(push); if cur_s>max_push then max_push:=cur_s; save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; left_edge:=cur_h; @y ksp_ptr:=space_ptr(this_box); incr(cur_s); if cur_s>0 then dvi_out(push); if cur_s>max_push then max_push:=cur_s; save_loc:=dvi_offset+dvi_ptr; synch_dir; base_line:=cur_v; left_edge:=cur_h; disp:=0; @z @x [32.622] l.12945 - pTeX: chain @= reswitch: if is_char_node(p) then begin synch_h; synch_v; repeat f:=font(p); c:=character(p); if f<>dvi_f then @; if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} begin if c>=qi(128) then dvi_out(set1); dvi_out(qo(c));@/ cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); goto continue; end; if mltex_enabled_p then @; continue: p:=link(p); until not is_char_node(p); dvi_h:=cur_h; end else @ @y @= reswitch: if is_char_node(p) then begin synch_h; synch_v; chain:=false; repeat f:=font(p); c:=character(p); if f<>dvi_f then @; if font_dir[f]=dir_default then begin chain:=false; if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} begin if c>=qi(128) then dvi_out(set1); dvi_out(qo(c));@/ cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); goto continue; end; if mltex_enabled_p then @; continue: end else begin if chain=false then chain:=true else begin cur_h:=cur_h+width(ksp_ptr); if g_sign<>normal then begin if g_sign=stretching then begin if stretch_order(ksp_ptr)=g_order then cur_h:=cur_h+round(float(glue_set(this_box))*stretch(ksp_ptr)); @^real multiplication@> end else begin if shrink_order(ksp_ptr)=g_order then cur_h:=cur_h-round(float(glue_set(this_box))*shrink(ksp_ptr)); @^real multiplication@> end; end; synch_h; end; p:=link(p); if (proc_kanji_code=sjis_enc) then jc:=SJIStoJIS(KANJI(info(p))) else jc:=EUCtoJIS(KANJI(info(p))); dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc)); cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); {not |jc|} end; dvi_h:=cur_h; p:=link(p); until not is_char_node(p); chain:=false; end else @ @z @x [32.623] l.12982 - pTeX: disp_node, dir_node @ @= begin case type(p) of hlist_node,vlist_node:@; rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); goto fin_rule; end; whatsit_node: @; @y @ @= begin case type(p) of hlist_node,vlist_node,dir_node:@; rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); goto fin_rule; end; whatsit_node: @; disp_node: begin disp:=disp_dimen(p); cur_v:=base_line+disp; end; @z @x [32.624] l.13000 - pTeX: output a box(and dir_node) with disp @ @= if list_ptr(p)=null then cur_h:=cur_h+width(p) else begin save_h:=dvi_h; save_v:=dvi_v; cur_v:=base_line+shift_amount(p); {shift the box down} temp_ptr:=p; edge:=cur_h; if type(p)=vlist_node then vlist_out@+else hlist_out; dvi_h:=save_h; dvi_v:=save_v; cur_h:=edge+width(p); cur_v:=base_line; end @y @ @= if list_ptr(p)=null then cur_h:=cur_h+width(p) else begin save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; cur_v:=base_line+disp+shift_amount(p); {shift the box down} temp_ptr:=p; edge:=cur_h; case type(p) of hlist_node:hlist_out; vlist_node:vlist_out; dir_node:dir_out; endcases; dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; cur_h:=edge+width(p); cur_v:=base_line+disp; cur_dir:=save_dir; end @z @x [32.625] l.13010 - pTeX: Output a rule with disp @ @= if is_running(rule_ht) then rule_ht:=height(this_box); if is_running(rule_dp) then rule_dp:=depth(this_box); @y @ @= if is_running(rule_ht) then rule_ht:=height(this_box)+disp; if is_running(rule_dp) then rule_dp:=depth(this_box)-disp; @z @x [32.629] l.13103 - pTeX: Output a leader box(and dir_node) with disp @= begin cur_v:=base_line+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ synch_h; save_h:=dvi_h; temp_ptr:=leader_box; outer_doing_leaders:=doing_leaders; doing_leaders:=true; if type(leader_box)=vlist_node then vlist_out@+else hlist_out; doing_leaders:=outer_doing_leaders; dvi_v:=save_v; dvi_h:=save_h; cur_v:=base_line; cur_h:=save_h+leader_wd+lx; end @y @= begin cur_v:=base_line+disp+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ synch_h; save_h:=dvi_h; save_dir:=dvi_dir; temp_ptr:=leader_box; outer_doing_leaders:=doing_leaders; doing_leaders:=true; case type(leader_box) of hlist_node:hlist_out; vlist_node:vlist_out; dir_node:dir_out; endcases; doing_leaders:=outer_doing_leaders; dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; cur_v:=base_line; cur_h:=save_h+leader_wd+lx; cur_dir:=save_dir; end @z @x [32.630] l.13133 - pTeX: vlist_out begin cur_g:=0; cur_glue:=float_constant(0); this_box:=temp_ptr; g_order:=glue_order(this_box); g_sign:=glue_sign(this_box); p:=list_ptr(this_box); incr(cur_s); if cur_s>0 then dvi_out(push); if cur_s>max_push then max_push:=cur_s; save_loc:=dvi_offset+dvi_ptr; left_edge:=cur_h; cur_v:=cur_v-height(this_box); @y @!save_dir:integer; {what |dvi_dir| should pop to} begin cur_g:=0; cur_glue:=float_constant(0); this_box:=temp_ptr; g_order:=glue_order(this_box); g_sign:=glue_sign(this_box); p:=list_ptr(this_box); incr(cur_s); if cur_s>0 then dvi_out(push); if cur_s>max_push then max_push:=cur_s; save_loc:=dvi_offset+dvi_ptr; synch_dir; left_edge:=cur_h; cur_v:=cur_v-height(this_box); @z @x [32.632] l.13155 - pTeX: output non-char-node @ @= begin case type(p) of hlist_node,vlist_node:@; rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); goto fin_rule; end; @y @ @= begin case type(p) of hlist_node,vlist_node,dir_node: @; rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); goto fin_rule; end; @z @x [32.633] l.13175 - pTeX: Output a box in a vlist @= if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) else begin cur_v:=cur_v+height(p); synch_v; save_h:=dvi_h; save_v:=dvi_v; cur_h:=left_edge+shift_amount(p); {shift the box right} temp_ptr:=p; if type(p)=vlist_node then vlist_out@+else hlist_out; dvi_h:=save_h; dvi_v:=save_v; cur_v:=save_v+depth(p); cur_h:=left_edge; end @y @= if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) else begin cur_v:=cur_v+height(p); synch_v; save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; cur_h:=left_edge+shift_amount(p); {shift the box right} temp_ptr:=p; case type(p) of hlist_node:hlist_out; vlist_node:vlist_out; dir_node:dir_out; endcases; dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; cur_v:=save_v+depth(p); cur_h:=left_edge; cur_dir:=save_dir; end @z @x [32.637] l.13256 - pTeX: Output a leader in a vlist @= begin cur_h:=left_edge+shift_amount(leader_box); synch_h; save_h:=dvi_h;@/ cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; temp_ptr:=leader_box; outer_doing_leaders:=doing_leaders; doing_leaders:=true; if type(leader_box)=vlist_node then vlist_out@+else hlist_out; doing_leaders:=outer_doing_leaders; dvi_v:=save_v; dvi_h:=save_h; cur_h:=left_edge; cur_v:=save_v-height(leader_box)+leader_ht+lx; end @y @= begin cur_h:=left_edge+shift_amount(leader_box); synch_h; save_h:=dvi_h;@/ cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; save_dir:=dvi_dir; temp_ptr:=leader_box; outer_doing_leaders:=doing_leaders; doing_leaders:=true; case type(leader_box) of hlist_node:hlist_out; vlist_node:vlist_out; dir_node:dir_out; endcases; doing_leaders:=outer_doing_leaders; dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; cur_h:=left_edge; cur_v:=save_v-height(leader_box)+leader_ht+lx; cur_dir:=save_dir; end @z @x [32.638] l.13270 - pTeX: ship out @p procedure ship_out(@!p:pointer); {output the box |p|} label done; var page_loc:integer; {location of the current |bop|} @y @p procedure ship_out(@!p:pointer); {output the box |p|} label done; var page_loc:integer; {location of the current |bop|} @!del_node:pointer; {used when delete the |dir_node| continued box} @z @x [32.640] l.13294 - pTeX: ship out @; @y if type(p)=dir_node then begin del_node:=p; p:=list_ptr(p); delete_glue_ref(space_ptr(del_node)); delete_glue_ref(xspace_ptr(del_node)); free_node(del_node,box_node_size); end; flush_node_list(link(p)); link(p):=null; if box_dir(p)<>dir_yoko then p:=new_dir_node(p,dir_yoko); @; @z @x [32.641] l.13327 - pTeX: dir_node if type(p)=vlist_node then vlist_out@+else hlist_out; @y case type(p) of hlist_node:hlist_out; vlist_node:vlist_out; dir_node:dir_out; endcases; @z @x [33.642] l.13394 - pTeX: postamble's id_byte @; dvi_out(post_post); dvi_four(last_bop); dvi_out(id_byte);@/ @y @; dvi_out(post_post); dvi_four(last_bop); if dir_used then dvi_out(ex_id_byte) else dvi_out(id_byte);@/ @z @x [33.647] l.13515 - pTeX: cur_kanji_skip, cur_xkanji_skip, last_disp @< Glob...@>= @!adjust_tail:pointer; {tail of adjustment list} @y @< Glob...@>= @!adjust_tail:pointer; {tail of adjustment list} @!last_disp:scaled; {displacement at end of list} @!cur_kanji_skip:pointer; @!cur_xkanji_skip:pointer; @z @x [33.648] l.13518 - pTeX: cur_kanji_skip, cur_xkanji_skip @ @=adjust_tail:=null; last_badness:=0; @y @ @=adjust_tail:=null; last_badness:=0; cur_kanji_skip:=zero_glue; cur_xkanji_skip:=zero_glue; { koko |incr(glue_ref_count(cur_kanji_skip));| |incr(glue_ref_count(cur_xkanji_skip));| } @z @x [33.649] l.13522 - pTeX: hpack @p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; label reswitch, common_ending, exit; var r:pointer; {the box node that will be returned} @y @p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; label reswitch, common_ending, exit; var r:pointer; {the box node that will be returned} @!k:pointer; {points to a |kanji_space| specification} @!disp:scaled; {displacement} @z @x [33.649] l.13533 - pTeX: hpack begin last_badness:=0; r:=get_node(box_node_size); type(r):=hlist_node; subtype(r):=min_quarterword; shift_amount(r):=0; q:=r+list_offset; link(q):=p;@/ h:=0; @; while p<>null do @; if adjust_tail<>null then link(adjust_tail):=null; height(r):=h; depth(r):=d;@/ @; common_ending: @; exit: hpack:=r; end; @y begin last_badness:=0; r:=get_node(box_node_size); type(r):=hlist_node; subtype(r):=min_quarterword; shift_amount(r):=0; space_ptr(r):=cur_kanji_skip; xspace_ptr(r):=cur_xkanji_skip; add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); k:=cur_kanji_skip; q:=r+list_offset; link(q):=p;@/ h:=0; @; disp:=0; while p<>null do @; if adjust_tail<>null then link(adjust_tail):=null; height(r):=h; depth(r):=d;@/ @; common_ending: @; exit: last_disp:=disp; hpack:=r; end; @z @x [33.651] l.13556 - pTeX: dir_node, disp_node, reset chain @ @= @^inner loop@> begin reswitch: while is_char_node(p) do @; if p<>null then begin case type(p) of hlist_node,vlist_node,rule_node,unset_node: @; ins_node,mark_node,adjust_node: if adjust_tail<>null then @; whatsit_node:@; glue_node:@; kern_node,math_node: x:=x+width(p); ligature_node: @; othercases do_nothing endcases;@/ p:=link(p); end; end @y @ @= @^inner loop@> begin reswitch: chain:=false; while is_char_node(p) do @; if p<>null then begin case type(p) of hlist_node,vlist_node,dir_node,rule_node,unset_node: @; ins_node,mark_node,adjust_node: if adjust_tail<>null then @; whatsit_node:@; disp_node:disp:=disp_dimen(p); glue_node:@; kern_node,math_node:x:=x+width(p); ligature_node:@; othercases do_nothing endcases;@/ p:=link(p); end; end @z @x [33.653] l.13589 - pTeX: displacement @= begin x:=x+width(p); if type(p)>=rule_node then s:=0 @+else s:=shift_amount(p); if height(p)-s>h then h:=height(p)-s; if depth(p)+s>d then d:=depth(p)+s; end @y @= begin x:=x+width(p); if type(p)>=rule_node then s:=disp @+else s:=shift_amount(p)+disp; if height(p)-s>h then h:=height(p)-s; if depth(p)+s>d then d:=depth(p)+s; end @z @x [33.654] l.13601 - pTeX: auto spacing, displacement @= begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); x:=x+char_width(f)(i);@/ s:=char_height(f)(hd);@+if s>h then h:=s; s:=char_depth(f)(hd);@+if s>d then d:=s; p:=link(p); end @y @= begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); x:=x+char_width(f)(i);@/ s:=char_height(f)(hd)-disp; if s>h then h:=s; s:=char_depth(f)(hd)+disp; if s>d then d:=s; if font_dir[f]<>dir_default then begin p:=link(p); if chain then begin x:=x+width(k);@/ o:=stretch_order(k); total_stretch[o]:=total_stretch[o]+stretch(k); o:=shrink_order(k); total_shrink[o]:=total_shrink[o]+shrink(k); end else chain:=true; end else chain:=false; p:=link(p); end @z @x [33.668] l.13779 - pTeX: vpackage begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; subtype(r):=min_quarterword; shift_amount(r):=0; @y begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; subtype(r):=min_quarterword; shift_amount(r):=0; space_ptr(r):=zero_glue; xspace_ptr(r):=zero_glue; add_glue_ref(zero_glue); add_glue_ref(zero_glue); @z @x [33.669] l.13797 - pTeX: dir_node @ @= begin if is_char_node(p) then confusion("vpack") @:this can't happen vpack}{\quad vpack@> else case type(p) of hlist_node,vlist_node,rule_node,unset_node: @; @y @ @= begin if is_char_node(p) then confusion("vpack") @:this can't happen vpack}{\quad vpack@> else case type(p) of hlist_node,vlist_node,dir_node,rule_node,unset_node: @; @z @x [34.681] l.14026 - pTeX: math noad @d noad_size=4 {number of words in a normal noad} @d nucleus(#)==#+1 {the |nucleus| field of a noad} @d supscr(#)==#+2 {the |supscr| field of a noad} @d subscr(#)==#+3 {the |subscr| field of a noad} @y \yskip\hang In Japanese, |math_type(q)=math_jchar| means that |fam(q)| refers to one of the sixteen kanji font families, and |KANJI(q)| is the internal kanji code number. @^Japanese extentions@> @d noad_size=5 {number of words in a normal noad} @d nucleus(#)==#+1 {the |nucleus| field of a noad} @d supscr(#)==#+2 {the |supscr| field of a noad} @d subscr(#)==#+3 {the |subscr| field of a noad} @d kcode_noad(#)==#+4 @d math_kcode(#)==info(#+4) {the |kanji character| field of a noad} @d kcode_noad_nucleus(#)==#+3 @d math_kcode_nucleus(#)==info(#+3) {the |kanji character| field offset from nucleus} @# @d math_jchar=5 @d math_text_jchar=6 @z @x [34.686] l.14129 - pTeX: new_noad mem[supscr(p)].hh:=empty_field; new_noad:=p; @y mem[supscr(p)].hh:=empty_field; mem[kcode_noad(p)].hh:=empty_field; new_noad:=p; @z @x [34.691] l.14236 - pTeX: print_fam_and_char procedure print_fam_and_char(@!p:pointer); {prints family and character} begin print_esc("fam"); print_int(fam(p)); print_char(" "); print_ASCII(qo(character(p))); @y procedure print_fam_and_char(@!p:pointer;@!t:small_number); {prints family and character} var @!cx:KANJI_code; {temporary register for KANJI} begin print_esc("fam"); print_int(fam(p)); print_char(" "); if t=math_char then print_ASCII(qo(character(p))) else begin KANJI(cx):=math_kcode_nucleus(p); print_kanji(cx); end; @z @x [34.692] l.14266 - pTeX: print_subsidiary_data math_char: begin print_ln; print_current_string; print_fam_and_char(p); @y math_char, math_jchar: begin print_ln; print_current_string; print_fam_and_char(p,math_type(p)); @z @x [34.696] l.14327 - pTeX: print_fam_and_char accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p)); @y accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p),math_char); @z @x [35.715] l.14687 - pTeX: rebox begin if type(b)=vlist_node then b:=hpack(b,natural); p:=list_ptr(b); if (is_char_node(p))and(link(p)=null) then begin f:=font(p); v:=char_width(f)(char_info(f)(character(p))); if v<>width(b) then link(p):=new_kern(width(b)-v); end; @y begin if type(b)<>hlist_node then b:=hpack(b,natural); p:=list_ptr(b); if is_char_node(p) then if font_dir[font(p)]<>dir_default then begin if link(link(p))=null then begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); if v<>width(b) then link(link(p)):=new_kern(width(b)-v); end end else if link(p)=null then begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); if v<>width(b) then link(p):=new_kern(width(b)-v); end; delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); @z @x [36.720] l.14783 - pTeX: clean_box function clean_box(@!p:pointer;@!s:small_number):pointer; @y function clean_box(@!p:pointer;@!s:small_number;@!jc:halfword):pointer; @z @x [36.720] l.14790 - pTeX: clean_box math_char: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; end; @y math_char: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; end; math_jchar: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; math_kcode(cur_mlist):=jc; end; @z @x [36.720] l.14802 - pTeX: clean_box found: if is_char_node(q)or(q=null) then x:=hpack(q,natural) else if (link(q)=null)and(type(q)<=vlist_node)and(shift_amount(q)=0) then x:=q {it's already clean} else x:=hpack(q,natural); @y found: if is_char_node(q)or(q=null) then x:=hpack(q,natural) else if (link(q)=null)and(type(q)<=dir_node)and(shift_amount(q)=0) then x:=q {it's already clean} else x:=hpack(q,natural); @z @x [36.721] l.14814 - pTeX: skip 2nd kanji node if is_char_node(q) then begin r:=link(q); @y if is_char_node(q) then begin if font_dir[font(q)]<>dir_default then q:=link(q); r:=link(q); @z @x [36.722] l.14833 - pTeX: fetch else begin if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then cur_i:=orig_char_info(cur_f)(cur_c) else cur_i:=null_character; if not(char_exists(cur_i)) then begin char_warning(cur_f,qo(cur_c)); math_type(a):=empty; end; end; @y else begin if font_dir[cur_f]<>dir_default then cur_c:=qi(get_jfm_pos(KANJI(math_kcode_nucleus(a)),cur_f)); if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then cur_i:=orig_char_info(cur_f)(cur_c) else cur_i:=null_character; if not(char_exists(cur_i)) then begin char_warning(cur_f,qo(cur_c)); math_type(a):=empty; end; end; @z @x [36.726] l.14892 - pTeX: mlist_to_hlist var mlist:pointer; {beginning of the given list} @!penalties:boolean; {should penalty nodes be inserted?} @!style:small_number; {the given style} @y var mlist:pointer; {beginning of the given list} @!penalties:boolean; {should penalty nodes be inserted?} @!style:small_number; {the given style} @!u:pointer; {temporary register} @z @x [36.726] l.14913 - pTeX: mlist_to_hlist @