tex.ch 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. @x tex.web:193:
  2. @d banner=='This is TeX, Version 3.141592653' {printed when \TeX\ starts}
  3. @y
  4. @d banner=='This is TeX, Version 3.141592653 (gotex v0.0-prerelease)' {printed when \TeX\ starts}
  5. @z
  6. @x tex.web:287:
  7. start_of_TEX@t\hskip-2pt@>, end_of_TEX@t\hskip-2pt@>,@,final_end;
  8. @y
  9. start_of_TEX;
  10. @z
  11. @x tex.web:378:
  12. @d othercases == others: {default for cases not listed explicitly}
  13. @y
  14. @d othercases == else {default for cases not listed explicitly}
  15. @d write_ln(#)==writeln(#)
  16. @d read_ln(#)==readln(#)
  17. @z
  18. @x tex.web:948:
  19. @p function input_ln(var f:alpha_file;@!bypass_eoln:boolean):boolean;
  20. {inputs the next line or returns |false|}
  21. var last_nonblank:0..buf_size; {|last| with trailing blanks removed}
  22. begin if bypass_eoln then if not eof(f) then get(f);
  23. @y
  24. @p function input_ln(var f:alpha_file;@!bypass_eoln:boolean):boolean;
  25. {inputs the next line or returns |false|}
  26. var last_nonblank:0..buf_size; {|last| with trailing blanks removed}
  27. begin if bypass_eoln then if not eof(f) and eoln(f) then get(f);
  28. @z
  29. @x tex.web:1002:
  30. @d update_terminal == break(term_out) {empty the terminal output buffer}
  31. @d clear_terminal == break_in(term_in,true) {clear the terminal input buffer}
  32. @d wake_up_terminal == do_nothing {cancel the user's cancellation of output}
  33. @y
  34. @d update_terminal == {empty the terminal output buffer}
  35. @d clear_terminal == {clear the terminal input buffer}
  36. @d wake_up_terminal == do_nothing {cancel the user's cancellation of output}
  37. @z
  38. @x tex.web:1035:
  39. if format_ident=0 then
  40. begin write_ln(term_out,'Buffer size exceeded!'); goto final_end;
  41. @y
  42. if format_ident=0 then
  43. begin write_ln(term_out,'Buffer size exceeded!'); panic(final_end);
  44. @z
  45. @x tex.web:1078:
  46. @p function init_terminal:boolean; {gets the terminal input started}
  47. label exit;
  48. begin t_open_in;
  49. loop@+begin wake_up_terminal; write(term_out,'**'); update_terminal;
  50. @.**@>
  51. if not input_ln(term_in,true) then {this shouldn't happen}
  52. begin write_ln(term_out);
  53. write(term_out,'! End of file on the terminal... why?');
  54. @y
  55. @p function init_terminal:boolean; {gets the terminal input started}
  56. label exit;
  57. begin t_open_in;
  58. loop@+begin wake_up_terminal; write(term_out,'**'); update_terminal;
  59. @.**@>
  60. if not input_ln(term_in,true) then {this shouldn't happen}
  61. begin write_ln(term_out);
  62. write_ln(term_out,'! End of file on the terminal... why?');
  63. @z
  64. @x tex.web:1255:
  65. @p @!init function get_strings_started:boolean; {initializes the string pool,
  66. but returns |false| if something goes wrong}
  67. label done,exit;
  68. var k,@!l:0..255; {small indices or counters}
  69. @!m,@!n:text_char; {characters input from |pool_file|}
  70. @!g:str_number; {garbage}
  71. @!a:integer; {accumulator for check sum}
  72. @!c:boolean; {check sum has been checked}
  73. begin pool_ptr:=0; str_ptr:=0; str_start[0]:=0;
  74. @y
  75. @p @!init function get_strings_started:boolean; {initializes the string pool,
  76. but returns |false| if something goes wrong}
  77. label done,exit;
  78. var k,@!l:0..255; {small indices or counters}
  79. @!m,@!n:text_char; {characters input from |pool_file|}
  80. @!g:str_number; {garbage}
  81. @!a:integer; {accumulator for check sum}
  82. @!c:boolean; {check sum has been checked}
  83. begin
  84. if g=0 then;
  85. pool_ptr:=0; str_ptr:=0; str_start[0]:=0;
  86. @z
  87. @x tex.web:1871:
  88. procedure jump_out;
  89. begin goto end_of_TEX;
  90. end;
  91. @y
  92. procedure jump_out;
  93. begin panic(end_of_TEX);
  94. end;
  95. @z
  96. @x tex.web:10431:
  97. @!tfm_file:byte_file;
  98. @y
  99. @!tfm_file:byte_file;
  100. buf:eight_bits;
  101. @z
  102. @x tex.web:16389:
  103. @ @<Other local variables for |try_break|@>=
  104. @!prev_prev_r:pointer; {a step behind |prev_r|, if |type(prev_r)=delta_node|}
  105. @!s:pointer; {runs through nodes ahead of |cur_p|}
  106. @!q:pointer; {points to a new node being created}
  107. @!v:pointer; {points to a glue specification or a node ahead of |cur_p|}
  108. @!t:integer; {node count, if |cur_p| is a discretionary node}
  109. @!f:internal_font_number; {used in character width calculation}
  110. @!l:halfword; {line number of current active node}
  111. @!node_r_stays_active:boolean; {should node |r| remain in the active list?}
  112. @!line_width:scaled; {the current line will be justified to this width}
  113. @!fit_class:very_loose_fit..tight_fit; {possible fitness class of test line}
  114. @!b:halfword; {badness of test line}
  115. @!d:integer; {demerits of test line}
  116. @!artificial_demerits:boolean; {has |d| been forced to zero?}
  117. @!save_link:pointer; {temporarily holds value of |link(cur_p)|}
  118. @!shortfall:scaled; {used in badness calculations}
  119. @y
  120. @ @<Other local variables for |try_break|@>=
  121. @!prev_prev_r:pointer; {a step behind |prev_r|, if |type(prev_r)=delta_node|}
  122. @!s:pointer; {runs through nodes ahead of |cur_p|}
  123. @!q:pointer; {points to a new node being created}
  124. @!v:pointer; {points to a glue specification or a node ahead of |cur_p|}
  125. @!t:integer; {node count, if |cur_p| is a discretionary node}
  126. @!f:internal_font_number; {used in character width calculation}
  127. @!l:halfword; {line number of current active node}
  128. @!node_r_stays_active:boolean; {should node |r| remain in the active list?}
  129. @!line_width:scaled; {the current line will be justified to this width}
  130. @!fit_class:very_loose_fit..tight_fit; {possible fitness class of test line}
  131. @!b:halfword; {badness of test line}
  132. @!d:integer; {demerits of test line}
  133. @!artificial_demerits:boolean; {has |d| been forced to zero?}
  134. @!shortfall:scaled; {used in badness calculations}
  135. @z
  136. @x tex.web:23664:
  137. procedure show_whatever;
  138. label common_ending;
  139. var p:pointer; {tail of a token list to show}
  140. begin case cur_chr of
  141. @y
  142. procedure show_whatever;
  143. label common_ending;
  144. var p:pointer; {tail of a token list to show}
  145. begin
  146. if p=0 then;
  147. case cur_chr of
  148. @z
  149. @x tex.web:24303:
  150. main_control; {come to life}
  151. final_cleanup; {prepare for death}
  152. end_of_TEX: close_files_and_terminate;
  153. final_end: ready_already:=0;
  154. end.
  155. @y
  156. main_control; {come to life}
  157. final_cleanup; {prepare for death}
  158. close_files_and_terminate;
  159. final_end: ready_already:=0;
  160. end.
  161. @z
  162. @x tex.web:24324:
  163. procedure close_files_and_terminate;
  164. var k:integer; {all-purpose index}
  165. begin @<Finish the extensions@>; new_line_char:=-1;
  166. @!stat if tracing_stats>0 then @<Output statistics about this job@>;@;@+tats@/
  167. wake_up_terminal; @<Finish the \.{DVI} file@>;
  168. if log_opened then
  169. begin wlog_cr; a_close(log_file); selector:=selector-2;
  170. if selector=term_only then
  171. begin print_nl("Transcript written on ");
  172. @.Transcript written...@>
  173. slow_print(log_name); print_char(".");
  174. end;
  175. end;
  176. end;
  177. @y
  178. procedure close_files_and_terminate;
  179. var k:integer; {all-purpose index}
  180. begin @<Finish the extensions@>; new_line_char:=-1;
  181. @!stat if tracing_stats>0 then @<Output statistics about this job@>;@;@+tats@/
  182. wake_up_terminal; @<Finish the \.{DVI} file@>;
  183. if log_opened then
  184. begin wlog_cr; a_close(log_file); selector:=selector-2;
  185. if selector=term_only then
  186. begin print_nl("Transcript written on ");
  187. @.Transcript written...@>
  188. slow_print(log_name); print_char(".");
  189. end;
  190. end;
  191. write_ln(term_out);
  192. end;
  193. @z
  194. @x tex.web:24656:
  195. procedure do_extension;
  196. var i,@!j,@!k:integer; {all-purpose integers}
  197. @!p,@!q,@!r:pointer; {all-purpose pointers}
  198. begin case cur_chr of
  199. @y
  200. procedure do_extension;
  201. var k:integer; {all-purpose integers}
  202. @!p:pointer; {all-purpose pointers}
  203. begin case cur_chr of
  204. @z