Changes for MF.CH by Andreas Scherer, February 23, 1995. Please excuse my not editing the commentary sections of the code modified in the following changes. We add some more values to the runtime memory configuration. For this, they must be able to vary, although `constants are not and variables will not'. @x l.180 @!mem_top=262140; {largest index in the |mem| array dumped by \.{INIMF}; must be substantially larger than |mem_min| and not greater than |mem_max|} @y @!mem_top=262140; {largest index in the |mem| array dumped by \.{INIMF}; must be substantially larger than |mem_min| and not greater than |mem_max|} @!hash_size=9500; {maximum number of symbolic tokens, must be less than |max_halfword-3*param_size|} @!hash_prime=7919; {a prime number equal to about 85\pct! of |hash_size|} @!max_in_open=15; {maximum number of input files and error insertions that can be going on simultaneously} @!param_size=150; {maximum number of simultaneous macro parameters} @z Their macro definitions are eliminated. @x l.204 @d hash_size=9500 {maximum number of symbolic tokens, must be less than |max_halfword-3*param_size|} @d hash_prime=7919 {a prime number equal to about 85\pct! of |hash_size|} @d max_in_open=15 {maximum number of input files and error insertions that can be going on simultaneously} @d param_size=150 {maximum number of simultaneous macro parameters} @y @z We're making a really BIG version of MetaFont. @x l.666 @d min_quarterword=0 {smallest allowable value in a |quarterword|} @d max_quarterword=255 {largest allowable value in a |quarterword|} @d min_halfword==0 {smallest allowable value in a |halfword|} @d max_halfword==262143 {largest allowable value in a |halfword|} @y @d min_quarterword=0 {smallest allowable value in a |quarterword|} @d max_quarterword=32767 {largest allowable value in a |quarterword|} @d min_halfword==0 {smallest allowable value in a |halfword|} @d max_halfword==1073741823 {largest allowable value in a |halfword|} @z `269' is a dummy value to satisfy TANGLE and WEB2C respectively. The array definition will be replaced by a pointer reference anyway. The actual `hash_end' value is `257 + hash_size + 12' (+ 1 for C). @x l.4433 of MF.WEB @!hash: array[1..hash_end] of two_halves; {the hash table} @!eqtb: array[1..hash_end] of two_halves; {the equivalents} @y @!hash: array[1..269] of two_halves; {the hash table} @!eqtb: array[1..269] of two_halves; {the equivalents} @z `6' stands for `max_in_open'. @x l.13341 of MF.WEB @!in_open : 0..max_in_open; {the number of lines in the buffer, less one} @!open_parens : 0..max_in_open; {the number of open text files} @!input_file : array[1..max_in_open] of alpha_file; @!line : integer; {current line number in the current source file} @!line_stack : array[1..max_in_open] of integer; @y @!in_open : 0..6; {the number of lines in the buffer, less one} @!open_parens : 0..6; {the number of open text files} @!input_file : array[1..6] of alpha_file; @!line : integer; {current line number in the current source file} @!line_stack : array[1..6] of integer; @z These macros are no longer `numeric'. @x l.13403 of MF.WEB @d forever_text=max_in_open+1 {|token_type| code for loop texts} @d loop_text=max_in_open+2 {|token_type| code for loop texts} @d parameter=max_in_open+3 {|token_type| code for parameter texts} @d backed_up=max_in_open+4 {|token_type| code for texts to be reread} @d inserted=max_in_open+5 {|token_type| code for inserted texts} @d macro=max_in_open+6 {|token_type| code for macro replacement texts} @y @d forever_text==(max_in_open+1) {|token_type| code for loop texts} @d loop_text==(max_in_open+2) {|token_type| code for loop texts} @d parameter==(max_in_open+3) {|token_type| code for parameter texts} @d backed_up==(max_in_open+4) {|token_type| code for texts to be reread} @d inserted==(max_in_open+5) {|token_type| code for inserted texts} @d macro==(max_in_open+6) {|token_type| code for macro replacement texts} @z `150' stands for `param_size'. @x l.13415 of MF.WEB @!param_stack:array [0..param_size] of pointer; {token list pointers for parameters} @!param_ptr:0..param_size; {first unused entry in |param_stack|} @y @!param_stack:array [0..150] of pointer; {token list pointers for parameters} @!param_ptr:0..150; {first unused entry in |param_stack|} @z The formerly `numeric macros' represented legal constants. Now that these values are variables, a different construction is necessary. Be careful not to destroy the original Pascal construction! @x l.13485 of MF.WEB @ @= case token_type of forever_text: print_nl(" "); loop_text: @; parameter: print_nl(" "); backed_up: if loc=null then print_nl(" ") else print_nl(" "); inserted: print_nl(" "); macro: begin print_ln; if name<>null then slow_print(text(name)) else @; print("->"); end; othercases print_nl("?") {this should never happen} @.?\relax@> endcases @y @ @=begin if token_type = forever_text then begin print_nl(" "); end else if token_type = loop_text then begin @; end else if token_type = parameter then begin print_nl(" "); end else if token_type = backed_up then begin if loc=null then print_nl(" ") else print_nl(" "); end else if token_type = inserted then begin print_nl(" "); end else if token_type = macro then begin print_ln; if name<>null then slow_print(text(name)) else @; print("->"); end else {othercases} begin print_nl("?") {this should never happen} end @.?\relax@> end @z Again, `150 == param_size'. @x l.14433 of MF.WEB @!k:0..param_size; {the total number of parameters} @y @!k:0..150; {the total number of parameters} @z Again, `269' stands for `257 + hash_size + 12 (+ 1)', aka `integer'. @x l.14467 of MF.WEB @!bg_loc,@!eg_loc:1..hash_end; @y @!bg_loc,@!eg_loc:1..269; @z This will already be done earlier. @x l.1355 set_paths (MF_BASE_PATH_BIT + MF_INPUT_PATH_BIT + MF_POOL_PATH_BIT); @y @z