diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2020-05-04 09:24:50 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2020-05-04 09:24:50 +0000 |
commit | 7e856ed3c574392e629b309f939f4306f45255a3 (patch) | |
tree | 967d9dd2d00254b3b697e6a2ead7e3e11dfc2c07 | |
parent | 124f8f40aba1a7ba62f5498895c0cbd5a47961b3 (diff) |
Restore section numbering in TeX.
Move new material from §366 and §526 to the end. Sections with
"System-dependent changes" start at §1379 again.
Fix xetex.ch for modified/amended material. One change in 'xetex.ch'
referred to the modified stuff for §526, now in §1407 (tex.web+tex.ch).
git-svn-id: svn://tug.org/texlive/trunk@54999 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/tex.ch | 141 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.ch | 24 |
2 files changed, 82 insertions, 83 deletions
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch index df6866a4385..ec383698fbd 100644 --- a/Build/source/texk/web2c/tex.ch +++ b/Build/source/texk/web2c/tex.ch @@ -1493,30 +1493,6 @@ aligning:begin print(" while scanning preamble"); info(p):=right_brace_token+"}" absorbing:begin print(" while scanning text"); info(p):=right_brace_token+"}"; @z -@x [25.366] expansion depth check -The |expand| subroutine is used when |cur_cmd>max_command|. It removes a -@y -@ Sometimes, recursive calls to the following |expand| routine may -cause exhaustion of the run-time calling stack, resulting in -forced execution stops by the operating system. To diminish the chance -of this happening, a counter is used to keep track of the recursion -depth, in conjunction with a constant called |expand_depth|. - -This does not catch all possible infinite recursion loops, just the ones -that exhaust the application calling stack. The actual maximum value of -|expand_depth| is outside of our control, but the initial setting of -|10000| should be enough to prevent problems. -@^system dependencies@> - -@<Global...@>= -expand_depth_count:integer; - -@ @<Set init...@>= -expand_depth_count:=0; - -@ The |expand| subroutine is used when |cur_cmd>max_command|. It removes a -@z - @x [25.366] begin cv_backup:=cur_val; cvl_backup:=cur_val_level; radix_backup:=radix; @y @@ -1931,53 +1907,6 @@ end; done: end_name; name_in_progress:=false; warning_index := save_warning_index; {restore |warning_index|} end; - -@ When |scan_file_name| starts it looks for a |left_brace| -(skipping \.{\\relax}es, as other \.{\\toks}-like primitives). -If a |left_brace| is found, then the procedure scans a file -name contained in a balanced token list, expanding tokens as -it goes. When the scanner finds the balanced token list, it -is converted into a string and fed character-by-character to -|more_name| to do its job the same as in the ``normal'' file -name scanning. - -@p procedure scan_file_name_braced; -var - @!save_scanner_status: small_number; {|scanner_status| upon entry} - @!save_def_ref: pointer; {|def_ref| upon entry, important if inside `\.{\\message}} - @!save_cur_cs: pointer; - @!s: str_number; {temp string} - @!p: pointer; {temp pointer} - @!i: integer; {loop tally} - @!save_stop_at_space: boolean; {this should be in tex.ch} - @!dummy: boolean; - {Initialising} -begin save_scanner_status := scanner_status; {|scan_toks| sets |scanner_status| to |absorbing|} - save_def_ref := def_ref; {|scan_toks| uses |def_ref| to point to the token list just read} - save_cur_cs := cur_cs; {we set |cur_cs| back a few tokens to use in runaway errors} - {Scanning a token list} - cur_cs := warning_index; {for possible runaway error} - {mimick |call_func| from pdfTeX} - if scan_toks(false, true) <> 0 then do_nothing; {actually do the scanning} - {|s := tokens_to_string(def_ref);|} - old_setting := selector; selector:=new_string; - show_token_list(link(def_ref),null,pool_size-pool_ptr); - selector := old_setting; - s := make_string; - {turns the token list read in a string to input} - {Restoring some variables} - delete_token_ref(def_ref); {remove the token list from memory} - def_ref := save_def_ref; {and restore |def_ref|} - cur_cs := save_cur_cs; {restore |cur_cs|} - scanner_status := save_scanner_status; {restore |scanner_status|} - {Passing the read string to the input machinery} - save_stop_at_space := stop_at_space; {save |stop_at_space|} - stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} - begin_name; - for i:=str_start[s] to str_start[s+1]-1 do - dummy := more_name(str_pool[i]); {add each read character to the current file name} - stop_at_space := save_stop_at_space; {restore |stop_at_space|} -end; @z @x [29.530] l.10245 - prompt_file_name: prevent empty filenames. @@ -4991,5 +4920,75 @@ begin get_nullstr := ""; end; + +@* \[54/web2c] More changes for Web2c. +% Related to [25.366] expansion depth check +Sometimes, recursive calls to the |expand| routine may +cause exhaustion of the run-time calling stack, resulting in +forced execution stops by the operating system. To diminish the chance +of this happening, a counter is used to keep track of the recursion +depth, in conjunction with a constant called |expand_depth|. + +This does not catch all possible infinite recursion loops, just the ones +that exhaust the application calling stack. The actual maximum value of +|expand_depth| is outside of our control, but the initial setting of +|10000| should be enough to prevent problems. +@^system dependencies@> + +@<Global...@>= +expand_depth_count:integer; + +@ @<Set init...@>= +expand_depth_count:=0; + +@ % Related to [29.526] expansion depth check +When |scan_file_name| starts it looks for a |left_brace| +(skipping \.{\\relax}es, as other \.{\\toks}-like primitives). +If a |left_brace| is found, then the procedure scans a file +name contained in a balanced token list, expanding tokens as +it goes. When the scanner finds the balanced token list, it +is converted into a string and fed character-by-character to +|more_name| to do its job the same as in the ``normal'' file +name scanning. + +@p procedure scan_file_name_braced; +var + @!save_scanner_status: small_number; {|scanner_status| upon entry} + @!save_def_ref: pointer; {|def_ref| upon entry, important if inside `\.{\\message}} + @!save_cur_cs: pointer; + @!s: str_number; {temp string} + @!p: pointer; {temp pointer} + @!i: integer; {loop tally} + @!save_stop_at_space: boolean; {this should be in tex.ch} + @!dummy: boolean; + {Initialising} +begin save_scanner_status := scanner_status; {|scan_toks| sets |scanner_status| to |absorbing|} + save_def_ref := def_ref; {|scan_toks| uses |def_ref| to point to the token list just read} + save_cur_cs := cur_cs; {we set |cur_cs| back a few tokens to use in runaway errors} + {Scanning a token list} + cur_cs := warning_index; {for possible runaway error} + {mimick |call_func| from pdfTeX} + if scan_toks(false, true) <> 0 then do_nothing; {actually do the scanning} + {|s := tokens_to_string(def_ref);|} + old_setting := selector; selector:=new_string; + show_token_list(link(def_ref),null,pool_size-pool_ptr); + selector := old_setting; + s := make_string; + {turns the token list read in a string to input} + {Restoring some variables} + delete_token_ref(def_ref); {remove the token list from memory} + def_ref := save_def_ref; {and restore |def_ref|} + cur_cs := save_cur_cs; {restore |cur_cs|} + scanner_status := save_scanner_status; {restore |scanner_status|} + {Passing the read string to the input machinery} + save_stop_at_space := stop_at_space; {save |stop_at_space|} + stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} + begin_name; + for i:=str_start[s] to str_start[s+1]-1 do + dummy := more_name(str_pool[i]); {add each read character to the current file name} + stop_at_space := save_stop_at_space; {restore |stop_at_space|} +end; + + @* \[55] Index. @z diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch index d718f798602..19294829d60 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.ch +++ b/Build/source/texk/web2c/xetexdir/xetex.ch @@ -415,18 +415,6 @@ for j:=1 to n do append_to_name(TEX_format_default[j]); @y @z -@x [29.526] - scan a bgroup/egroup-delimited file name - stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} - begin_name; - for i:=str_start[s] to str_start[s+1]-1 do - dummy := more_name(str_pool[i]); {add each read character to the current file name} -@y - stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} - begin_name; - for i:=str_start_macro(s) to str_start_macro(s+1)-1 do - dummy := more_name(str_pool[i]); {add each read character to the current file name} -@z - @x [29.536] l.10331 wlog(' ('); fputs(translate_filename, log_file); @@ -952,3 +940,15 @@ exit:end; @# @<Declare subroutines for |new_character|@>@; @z + +@x [54/web2c.1407] - scan a bgroup/egroup-delimited file name + stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} + begin_name; + for i:=str_start[s] to str_start[s+1]-1 do + dummy := more_name(str_pool[i]); {add each read character to the current file name} +@y + stop_at_space := false; {set |stop_at_space| to false to allow spaces in file names} + begin_name; + for i:=str_start_macro(s) to str_start_macro(s+1)-1 do + dummy := more_name(str_pool[i]); {add each read character to the current file name} +@z |