|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 24801 (0x60e1) Types: TextFile Names: »cxet.patch«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦23cd347d5⟧ »unix3.0/babel.tar.Z« └─⟦2fb9f645a⟧ └─⟦this⟧ »babel/semitics/cxet.patch«
*** ctex.ch Fri Jun 15 15:19:27 1990 --- cxet.ch Fri Jun 15 16:25:11 1990 *************** *** 45,51 **** @x @d banner=='This is TeX, Version 3.0' {printed when \TeX\ starts} @y ! @d banner=='This is TeX, C Version 3.0' {printed when \TeX\ starts} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 45,51 ---- @x @d banner=='This is TeX, Version 3.0' {printed when \TeX\ starts} @y ! @d banner=='This is TeX-Xet, C Version 3.0' {printed when \TeX\ starts} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 71,77 **** @f type==true {but `|type|' will not be treated as a reserved word} @p @t\4@>@<Compiler directives@>@/ ! program TEX; {all file names are defined dynamically} @z @x --- 71,77 ---- @f type==true {but `|type|' will not be treated as a reserved word} @p @t\4@>@<Compiler directives@>@/ ! program TEXXET; {all file names are defined dynamically} @z @x *************** *** 209,215 **** @!trie_op_size=500; {space for ``opcodes'' in the hyphenation patterns} @!neg_trie_op_size=-500; {for lower trie_op_hash array bound} @!dvi_buf_size=16384; {size of the output buffer; must be a multiple of 8} ! @!pool_name='tex.pool'; {string of length |file_name_size|; tells where the string pool appears} @!mem_top=262140; {largest index in the |mem| array dumped by \.{INITEX}; must be substantially larger than |mem_bot| --- 209,215 ---- @!trie_op_size=500; {space for ``opcodes'' in the hyphenation patterns} @!neg_trie_op_size=-500; {for lower trie_op_hash array bound} @!dvi_buf_size=16384; {size of the output buffer; must be a multiple of 8} ! @!pool_name='texxet.pool'; {string of length |file_name_size|; tells where the string pool appears} @!mem_top=262140; {largest index in the |mem| array dumped by \.{INITEX}; must be substantially larger than |mem_bot| *************** *** 621,627 **** @y else begin {Like |bad_pool|, but must not close file if we never opened it} ! wake_up_terminal; write_ln(term_out, '! I can''t read tex.pool.'); get_strings_started:= false; return; end @z --- 621,627 ---- @y else begin {Like |bad_pool|, but must not close file if we never opened it} ! wake_up_terminal; write_ln(term_out, '! I can''t read texxet.pool.'); get_strings_started:= false; return; end @z *************** *** 630,636 **** @.TEX.POOL has no check sum@> read(pool_file,m,n); {read two digits of string length} @y ! begin if eof(pool_file) then bad_pool('! tex.pool has no check sum.'); @.TEX.POOL has no check sum@> read(pool_file,m); read(pool_file,n); {read two digits of string length} @z --- 630,636 ---- @.TEX.POOL has no check sum@> read(pool_file,m,n); {read two digits of string length} @y ! begin if eof(pool_file) then bad_pool('! texxet.pool has no check sum.'); @.TEX.POOL has no check sum@> read(pool_file,m); read(pool_file,n); {read two digits of string length} @z *************** *** 637,653 **** @x bad_pool('! TEX.POOL line doesn''t begin with two digits.'); @y ! bad_pool('! tex.pool line doesn''t begin with two digits.'); @z @x bad_pool('! TEX.POOL check sum doesn''t have nine digits.'); @y ! bad_pool('! tex.pool check sum doesn''t have nine digits.'); @z @x done: if a<>@$ then bad_pool('! TEX.POOL doesn''t match; TANGLE me again.'); @y ! done: if a<>@$ then bad_pool('! tex.pool doesn''t match; tangle me again.'); @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 637,653 ---- @x bad_pool('! TEX.POOL line doesn''t begin with two digits.'); @y ! bad_pool('! texxet.pool line doesn''t begin with two digits.'); @z @x bad_pool('! TEX.POOL check sum doesn''t have nine digits.'); @y ! bad_pool('! texxet.pool check sum doesn''t have nine digits.'); @z @x done: if a<>@$ then bad_pool('! TEX.POOL doesn''t match; TANGLE me again.'); @y ! done: if a<>@$ then bad_pool('! texxet.pool doesn''t match; tangle me again.'); @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 850,855 **** --- 850,867 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [10.161] make room for a new creation procedure (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + \TeX's other algorithms intact. + @^system dependencies@> + @y + \TeX's other algorithms intact. + @^system dependencies@> + @p@<Declare functions needed for special kinds of nodes@> + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [11.165] Fix the word `free' so that it doesn't conflict with the % standard C library routine of the same name. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 937,942 **** --- 949,1044 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [15.208,209] New command code (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + @d max_non_prefixed_command=70 {largest command code that can't be \.{\\global}} + + @ The next codes are special; they all relate to mode-independent + assignment of values to \TeX's internal registers or tables. + Codes that are |max_internal| or less represent internal quantities + that might be expanded by `\.{\\the}'. + + @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.~)} + @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 LR=71 {text direction ( \.{\\beginL}, \.{\\beginR}, \.{\\endL}, \.{\\endR} )} + @d max_non_prefixed_command=71 {largest command code that can't be \.{\\global}} + + @ The next codes are special; they all relate to mode-independent + assignment of values to \TeX's internal registers or tables. + Codes that are |max_internal| or less represent internal quantities + that might be expanded by `\.{\\the}'. + + @d toks_register=72 {token list register ( \.{\\toks} )} + @d assign_toks=73 {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} + @d assign_int=74 {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} + @d assign_dimen=75 {user-defined length ( \.{\\hsize}, etc.~)} + @d assign_glue=76 {user-defined glue ( \.{\\baselineskip}, etc.~)} + @d assign_mu_glue=77 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} + @d assign_font_dimen=78 {user-defined font dimension ( \.{\\fontdimen} )} + @d assign_font_int=79 {user-defined font integer ( \.{\\hyphenchar}, + \.{\\skewchar} )} + @d set_aux=80 {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} + @d set_prev_graf=81 {specify state info ( \.{\\prevgraf} )} + @d set_page_dimen=82 {specify state info ( \.{\\pagegoal}, etc.~)} + @d set_page_int=83 {specify state info ( \.{\\deadcycles}, + \.{\\insertpenalties} )} + @d set_box_dimen=84 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} + @d set_shape=85 {specify fancy paragraph shape ( \.{\\parshape} )} + @d def_code=86 {define a character code ( \.{\\catcode}, etc.~)} + @d def_family=87 {declare math fonts ( \.{\\textfont}, etc.~)} + @d set_font=88 {set current font ( font identifiers )} + @d def_font=89 {define a font file ( \.{\\font} )} + @d register=90 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} + @d max_internal=90 {the largest code that can follow \.{\\the}} + @d advance=91 {advance a register or parameter ( \.{\\advance} )} + @d multiply=92 {multiply a register or parameter ( \.{\\multiply} )} + @d divide=93 {divide a register or parameter ( \.{\\divide} )} + @d prefix=94 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} + @d let=95 {assign a command code ( \.{\\let}, \.{\\futurelet} )} + @d shorthand_def=96 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} + @d read_to_cs=97 {read into a control sequence ( \.{\\read} )} + @d def=98 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} + @d set_box=99 {set a box ( \.{\\setbox} )} + @d hyph_data=100 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} + @d set_interaction=101 {define level of interaction ( \.{\\batchmode}, etc.~)} + @d max_command=101 {the largest command code seen at |big_switch|} + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [17.241] fix_date_and_time %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x *************** *** 1263,1268 **** --- 1365,1391 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [31.585-586] new DVI opcodes (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + \yskip\noindent Commands 250--255 are undefined at the present time. + + @ @d set_char_0=0 {typeset character 0 and move right} + @y + \yskip\hang|begin_reflect| 250. Begin a (possibly recursive) reflected segment. + + \yskip\hang|end_reflect| 251. End a (possibly recursive) reflected segment. + + \yskip\noindent Commands 250--255 are undefined in normal \.{DVI} files, + but 250 and 251 are permitted in the special `\.{DVI-IVD}' files + produced by this variant of \TeX. + + @ @d begin_reflect=250 {begin a reflected segment (not normally allowed)} + @d end_reflect=251 {end a reflected segment (not normally allowed)} + @d set_char_0=0 {typeset character 0 and move right} + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [32.597] write_dvi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x *************** *** 1291,1296 **** --- 1414,1452 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [32.638] changes to ship_out (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + begin if tracing_output>0 then + @y + begin LR_ptr:=get_avail; info(LR_ptr):=0; {|begin_L_code| at outer level} + if tracing_output>0 then + @z + @x (module 639) + flush_node_list(p); + @y + flush_node_list(p); @<Flush the LR stack@>; + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [33.649] hpack changes (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + begin last_badness:=0; r:=get_node(box_node_size); type(r):=hlist_node; + @y + @!LR_ptr,@!LR_tmp:pointer; {for LR stack maintenance} + @!LR_problems:integer; {counts missing begins and ends} + begin LR_ptr:=null; LR_problems:=0; last_badness:=0; + r:=get_node(box_node_size); type(r):=hlist_node; + @z + @x (module 649, continued) + exit: hpack:=r; + @y + exit: @<Check for LR anomalies at the end of |hpack|@>; + hpack:=r; + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [38.859] Fix a C casting/expression evaluation problem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x *************** *** 1311,1316 **** --- 1467,1503 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [39.877] post_line_break stuff (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + begin @<Reverse the links of the relevant passive nodes, setting |cur_p| to the + @y + @!LR_ptr,@!LR_tmp:pointer; {for LR stack maintenance} + begin LR_ptr:=null; + @<Reverse the links of the relevant passive nodes, setting |cur_p| to the + @z + @x (module 877, continued) + prev_graf:=best_line-1; + @y + prev_graf:=best_line-1; + @<Flush the LR stack@>; + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [39.880] post_line_break stuff continued(TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x (module 880) + @<Modify the end of the line to reflect the nature of the break and to include + \.{\\rightskip}; also set the proper value of |disc_break|@>; + @y + @<Insert LR nodes at the beginning of the current line@>; + @<Adjust the LR stack based on LR nodes in this line@>; + @<Modify the end of the line to reflect the nature of the break and to include + \.{\\rightskip}; also set the proper value of |disc_break|@>; + @<Insert LR nodes at the end of the current line@>; + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [43.?] Hack around the negative lower bound here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x *************** *** 1355,1360 **** --- 1542,1572 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [47.1090] new horizontal command (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + vmode+ex_space,vmode+no_boundary:@t@>@;@/ + @y + vmode+ex_space,vmode+no_boundary,vmode+LR:@t@>@;@/ + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % [48.1196] math in text is L-text (TeX-XeT extension) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + @x + begin tail_append(new_math(math_surround,before)); + @y + begin tail_append(new_math(math_surround,before)); + @<Append a |begin_L| to the tail of the current list@>; + @z + @x (module 1196, continued) + tail_append(new_math(math_surround,after)); + @y + @<Append an |end_L| to the tail of the current list@>; + tail_append(new_math(math_surround,after)); + @z + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [49.1275] a_open_in of \read file needs path specifier %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x *************** *** 1801,1809 **** @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [54.1376] Add editor-switch variables to globals. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x This section should be replaced, if necessary, by any special modifications of the program that are necessary to make \TeX\ work at a particular installation. --- 2013,2127 ---- @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1341] whatsit processing (TeX-XeT extension) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x ! @d special_node=3 {|subtype| in whatsits that represent \.{\\special} things} ! @y ! @d special_node=3 {|subtype| in whatsits that represent \.{\\special} things} ! @d LR_node=4 {|subtype| in whatsits that represent \.{\\beginL}, etc.} ! @d LR_type(#)==mem[#+1].int {the sub-subtype} ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1344] whatsit processing continued (TeX-XeT extension) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x ! @d immediate_code=4 {command modifier for \.{\\immediate}} ! @d set_language_code=5 {command modifier for \.{\\setlanguage}} ! ! @<Put each...@>= ! @y ! @d immediate_code=4 {command modifier for \.{\\immediate}} ! @d set_language_code=5 {command modifier for \.{\\setlanguage}} ! @d begin_L_code=0 {command modifier for \.{\\beginL}} ! @d begin_R_code=1 {command modifier for \.{\\beginR}} ! @d end_L_code=2 {command modifier for \.{\\endL}} ! @d end_R_code=3 {command modifier for \.{\\endR}} ! @d begin_LR(#)==(LR_type(#)<end_L_code) ! @d begin_LR_type(#)==(LR_type(#)-end_L_code) ! ! @<Put each...@>= ! primitive("beginL",LR,begin_L_code);@/ ! @!@:begin_L_}{\.{\\beginL} primitive@> ! primitive("beginR",LR,begin_R_code);@/ ! @!@:begin_R_}{\.{\\beginR} primitive@> ! primitive("endL",LR,end_L_code);@/ ! @!@:end_L_}{\.{\\endL} primitive@> ! primitive("endR",LR,end_R_code);@/ ! @!@:end_R_}{\.{\\endR} primitive@> ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1346] whatsit processing continued (TeX-XeT extension) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x (module 1346) ! @ @<Cases of |print_cmd_chr|...@>= ! @y ! @ @<Cases of |print_cmd_chr|...@>= ! LR: case chr_code of ! begin_L_code: print_esc("beginL"); ! begin_R_code: print_esc("beginR"); ! end_L_code: print_esc("endL"); ! othercases print_esc("endR") ! endcases; ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1356] whatsit processing continued (TeX-XeT extension) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x (module 1356) ! othercases print("whatsit?") ! @y ! LR_node: case LR_type(p) of ! begin_L_code: print_esc("beginL"); ! begin_R_code: print_esc("beginR"); ! end_L_code: print_esc("endL"); ! othercases print_esc("endR") ! endcases; ! othercases print("whatsit?") ! @z ! @x (module 1357) ! close_node,language_node: begin r:=get_node(small_node_size); ! words:=small_node_size; ! end; ! @y ! close_node,language_node,LR_node: begin r:=get_node(small_node_size); ! words:=small_node_size; ! end; ! @z ! @x (module 1358) ! close_node,language_node: free_node(p,small_node_size); ! @y ! close_node,language_node,LR_node: free_node(p,small_node_size); ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1360] whatsit processing continued (TeX-XeT extension) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x (module 1360) ! @ @<Incorporate a whatsit node into an hbox@>=do_nothing ! @y ! @ @<Incorporate a whatsit node into an hbox@>= ! if subtype(p)=LR_node then @<Adjust the LR stack for the |hpack| routine@> ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [53.1366] whatsit processing continued (TeX-XeT extension) ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x (module 1366) ! @ @<Output the whatsit node |p| in an hlist@>= ! out_what(p) ! @y ! @ @<Output the whatsit node |p| in an hlist@>= ! if subtype(p)<>LR_node then out_what(p) ! else @<Output a reflection instruction if the direction has changed@> ! @z ! ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! % [54.1376] add TeX-XeT extensions ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! @x Final system-dependent changes: [1376] This section should be replaced, if necessary, by any special modifications of the program that are necessary to make \TeX\ work at a particular installation. *************** *** 1814,1819 **** --- 2132,2251 ---- itself will get a new section number. @^system dependencies@> @y + Now we do the main work required for mixed-direction texts. + + @<Cases of |main_control| that build...@>= + hmode+LR: begin new_whatsit(LR_node,small_node_size); LR_type(tail):=cur_chr; + end; + mmode+LR: report_illegal_case; + + @ @<Glob...@>= + @!LR_ptr,@!LR_tmp:pointer; {stack of LR codes and temp for manipulation} + + @ @<Declare functions needed for special kinds of nodes@>= + function new_LR(@!s:small_number): pointer; + var p: pointer; {the new node} + begin p:=get_node(small_node_size); type(p):=whatsit_node; subtype(p):=LR_node; + LR_type(p):=s; new_LR:=p; + end; + + @ @<Declare functions needed for special kinds of nodes@>= + function safe_info(@!p:pointer): integer; + begin if p=null then safe_info:=-1@+else safe_info:=info(p); + end; + + @ @<Append a |begin_L| to the tail of the current list@>= + tail_append(new_LR(begin_L_code)) + + @ @<Append an |end_L| to the tail of the current list@>= + tail_append(new_LR(end_L_code)) + + @ A number of routines are based on a stack of one-word nodes whose |info| + fields contain either |begin_L_code| or |begin_R_code|. The top of the + stack is pointed to by |LR_ptr|, and an auxiliary variable |LR_tmp| is + available for stack manipulation. + + @d push_LR(#)==begin LR_tmp:=get_avail; info(LR_tmp):=LR_type(#); + link(LR_tmp):=LR_ptr; LR_ptr:=LR_tmp; + end + @d pop_LR==begin LR_tmp:=LR_ptr; LR_ptr:=link(LR_tmp); free_avail(LR_tmp); + end + + @<Flush the LR stack@>=while LR_ptr<>null do pop_LR + + @ @<Insert LR nodes at the beginning of the current line@>= + while LR_ptr<>null do + begin LR_tmp:=new_LR(info(LR_ptr)); link(LR_tmp):=link(temp_head); + link(temp_head):=LR_tmp; pop_LR; + end + + @ @<Adjust the LR stack based on LR nodes in this line@>= + q:=link(temp_head); + while q<>cur_break(cur_p) do + begin if not is_char_node(q) then if type(q)=whatsit_node then + if subtype(q)=LR_node then + if begin_LR(q) then push_LR(q) + else if LR_ptr<>null then + if info(LR_ptr)=begin_LR_type(q) then pop_LR; + q:=link(q); + end + + @ We use the fact that |q| now points to the node with \.{\\rightskip} glue. + + @<Insert LR nodes at the end of the current line@>= + if LR_ptr<>null then + begin s:=temp_head; r:=link(s); + while r<>q do + begin s:=r; r:=link(s); + end; + r:=LR_ptr; + while r<>null do + begin LR_tmp:=new_LR(info(r)+end_L_code); + link(s):=LR_tmp; s:=LR_tmp; r:=link(r); + end; + link(s):=q; + end + + @ @<Adjust the LR stack for the |hpack| routine@>= + if begin_LR(p) then push_LR(p) + else if safe_info(LR_ptr)=begin_LR_type(p) then pop_LR + else begin incr(LR_problems); + while link(q)<>p do q:=link(q); + link(q):=link(p); free_node(p,small_node_size); p:=q; + end + + @ @<Check for LR anomalies at the end of |hpack|@>= + if LR_ptr<>null then + begin while link(q)<>null do q:=link(q); + repeat link(q):=new_LR(info(LR_ptr)+end_L_code); q:=link(q); + LR_problems:=LR_problems+10000; pop_LR; + until LR_ptr=null; + end; + if LR_problems>0 then + begin print_ln; print_nl("\endL or \endR problem (");@/ + print_int(LR_problems div 10000); print(" missing, ");@/ + print_int(LR_problems mod 10000); print(" extra");@/ + LR_problems:=0; goto common_ending; + end + + @ @<Output a reflection instruction if the direction has changed@>= + if begin_LR(p) then + begin if safe_info(LR_ptr)<>LR_type(p) then + begin synch_h; synch_v; dvi_out(begin_reflect); + end; + push_LR(p); + end + else if safe_info(LR_ptr)=begin_LR_type(p) then + begin pop_LR; + if info(LR_ptr)+end_L_code<>LR_type(p) then + begin synch_h; synch_v; dvi_out(end_reflect); + end; + end + else confusion("LR") + @:this can't happen LR}{\quad LR@> + + @ Finally we get to a small addition that has nothing to do with LR nodes. + Here is a temporary integer, used as a holder during reading and writing of TFM files, and a temporary memory_word, used in reading/writing format files.