texlive[67618] Build/source/texk/web2c: [CWEB] Merge 'cur_state' into

commits+ascherer at tug.org commits+ascherer at tug.org
Thu Jul 13 17:11:14 CEST 2023


Revision: 67618
          http://tug.org/svn/texlive?view=revision&revision=67618
Author:   ascherer
Date:     2023-07-13 17:11:14 +0200 (Thu, 13 Jul 2023)
Log Message:
-----------
[CWEB] Merge 'cur_state' into 'stack'.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ctangleboot.cin
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch
    trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
    trunk/Build/source/texk/web2c/cwebdir/ctangle.c
    trunk/Build/source/texk/web2c/cwebdir/ctangle.w
    trunk/Build/source/texk/web2c/cwebdir/cweave.w

Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin	2023-07-13 15:11:14 UTC (rev 67618)
@@ -121,11 +121,13 @@
 #define output_defs_flag (2*024000-1)  \
 
 #define stack_size 50
-#define cur_end cur_state.end_field
+#define cur_state stack[stack_size+1] \
+
 #define cur_byte cur_state.byte_field
 #define cur_name cur_state.name_field
 #define cur_repl cur_state.repl_field
-#define cur_section cur_state.section_field \
+#define cur_section cur_state.section_field
+#define cur_end (cur_repl+1) ->tok_start \
 
 #define section_number 0201
 #define identifier 0202 \
@@ -140,6 +142,8 @@
 #define C_printf(c,a) fprintf(C_file,c,a) 
 #define C_putc(c) putc((int) (c) ,C_file)  \
 
+#define macro_end (cur_text+1) ->tok_start \
+
 #define translit_length 10 \
 
 #define transliterate_utf_eight flags['u'] \
@@ -277,7 +281,7 @@
 extern FILE*check_file;
 
 /*:15*//*116:*/
-#line 555 "cwebdir/ctang-w2c.ch"
+#line 553 "cwebdir/ctang-w2c.ch"
 
 extern char cb_banner[];
 
@@ -295,10 +299,9 @@
 
 #line 66 "cwebdir/ctang-w2c.ch"
 /*:19*//*31:*/
-#line 274 "cwebdir/ctangle.w"
+#line 271 "cwebdir/ctangle.w"
 
 typedef struct{
-eight_bits*end_field;
 eight_bits*byte_field;
 name_pointer name_field;
 text_pointer repl_field;
@@ -325,27 +328,25 @@
 static text_pointer last_unnamed;
 
 /*:26*//*32:*/
-#line 291 "cwebdir/ctangle.w"
+#line 289 "cwebdir/ctangle.w"
 
-static output_state cur_state;
-
-static output_state stack[stack_size+1];
+static output_state stack[stack_size+2];
 static stack_pointer stack_end= stack+stack_size;
 static stack_pointer stack_ptr;
 
 /*:32*//*37:*/
-#line 367 "cwebdir/ctangle.w"
+#line 361 "cwebdir/ctangle.w"
 
 static int cur_val;
 
 /*:37*//*42:*/
-#line 459 "cwebdir/ctangle.w"
+#line 453 "cwebdir/ctangle.w"
 
 static eight_bits out_state;
 static boolean protect;
 
 /*:42*//*45:*/
-#line 490 "cwebdir/ctangle.w"
+#line 484 "cwebdir/ctangle.w"
 
 static name_pointer output_files[max_files];
 static name_pointer*cur_out_file,*end_output_files,*an_output_file;
@@ -353,33 +354,33 @@
 static char output_file_name[longest_name+1];
 
 /*:45*//*52:*/
-#line 590 "cwebdir/ctangle.w"
+#line 583 "cwebdir/ctangle.w"
 
 static boolean output_defs_seen= false;
 
 /*:52*//*57:*/
-#line 703 "cwebdir/ctangle.w"
+#line 697 "cwebdir/ctangle.w"
 
 static char translit[0200][translit_length];
 
 /*:57*//*62:*/
-#line 779 "cwebdir/ctangle.w"
+#line 773 "cwebdir/ctangle.w"
 
 static eight_bits ccode[256];
 
 /*:62*//*66:*/
-#line 839 "cwebdir/ctangle.w"
+#line 833 "cwebdir/ctangle.w"
 
 static boolean comment_continues= false;
 
 /*:66*//*68:*/
-#line 876 "cwebdir/ctangle.w"
+#line 870 "cwebdir/ctangle.w"
 
 static name_pointer cur_section_name;
 static boolean no_where;
 
 /*:68*//*82:*/
-#line 1193 "cwebdir/ctangle.w"
+#line 1187 "cwebdir/ctangle.w"
 
 static text_pointer cur_text;
 static eight_bits next_control;
@@ -427,53 +428,53 @@
 static void store_two_bytes(sixteen_bits);
 
 /*:30*//*35:*/
-#line 330 "cwebdir/ctangle.w"
+#line 325 "cwebdir/ctangle.w"
 
 static void push_level(name_pointer);
 static void pop_level(boolean);
 
 /*:35*//*39:*/
-#line 404 "cwebdir/ctangle.w"
+#line 398 "cwebdir/ctangle.w"
 static void get_output(void);
 
 /*:39*//*44:*/
-#line 480 "cwebdir/ctangle.w"
+#line 474 "cwebdir/ctangle.w"
 static void flush_buffer(void);
 
 /*:44*//*49:*/
-#line 557 "cwebdir/ctangle.w"
+#line 551 "cwebdir/ctangle.w"
 static void phase_two(void);
 
 /*:49*//*53:*/
-#line 593 "cwebdir/ctangle.w"
+#line 586 "cwebdir/ctangle.w"
 
 static void output_defs(void);
 static void out_char(eight_bits);
 
 /*:53*//*65:*/
-#line 819 "cwebdir/ctangle.w"
+#line 813 "cwebdir/ctangle.w"
 
 static eight_bits skip_ahead(void);
 static boolean skip_comment(boolean);
 
 /*:65*//*70:*/
-#line 926 "cwebdir/ctangle.w"
+#line 920 "cwebdir/ctangle.w"
 static eight_bits get_next(void);
 
 /*:70*//*84:*/
-#line 1219 "cwebdir/ctangle.w"
+#line 1213 "cwebdir/ctangle.w"
 static void scan_repl(eight_bits);
 
 /*:84*//*91:*/
-#line 1411 "cwebdir/ctangle.w"
+#line 1405 "cwebdir/ctangle.w"
 static void scan_section(void);
 
 /*:91*//*99:*/
-#line 1488 "cwebdir/ctangle.w"
+#line 1482 "cwebdir/ctangle.w"
 static void phase_one(void);
 
 /*:99*//*101:*/
-#line 1521 "cwebdir/ctangle.w"
+#line 1515 "cwebdir/ctangle.w"
 static void skip_limbo(void);
 
 /*:101*/
@@ -506,12 +507,12 @@
 last_unnamed= text_info;text_info->text_link= macro;
 
 /*:27*//*46:*/
-#line 500 "cwebdir/ctangle.w"
+#line 494 "cwebdir/ctangle.w"
 
 cur_out_file= end_output_files= output_files+max_files;
 
 /*:46*//*58:*/
-#line 706 "cwebdir/ctangle.w"
+#line 700 "cwebdir/ctangle.w"
 
 {
 int i;
@@ -518,9 +519,9 @@
 for(i= 0;i<0200;i++)sprintf(translit[i],"X%02X",(unsigned int)(0200+i));
 }
 
-#line 180 "cwebdir/ctang-w2c.ch"
+#line 178 "cwebdir/ctang-w2c.ch"
 /*:58*//*63:*/
-#line 782 "cwebdir/ctangle.w"
+#line 776 "cwebdir/ctangle.w"
 {
 int c;
 for(c= 0;c<256;c++)ccode[c]= ignore;
@@ -540,11 +541,11 @@
 ccode['\'']= ord;
 
 /*:63*//*78:*/
-#line 1114 "cwebdir/ctangle.w"
+#line 1108 "cwebdir/ctangle.w"
 section_text[0]= ' ';
 
 /*:78*//*117:*/
-#line 558 "cwebdir/ctang-w2c.ch"
+#line 556 "cwebdir/ctang-w2c.ch"
 
 strncpy(cb_banner,banner,max_banner-1);
 
@@ -599,7 +600,7 @@
 }
 
 /*:29*//*34:*/
-#line 315 "cwebdir/ctangle.w"
+#line 311 "cwebdir/ctangle.w"
 
 static void
 push_level(
@@ -607,18 +608,17 @@
 {
 #line 79 "cwebdir/ctang-w2c.ch"
 if(stack_ptr==stack_end)overflow(_("stack"));
-#line 321 "cwebdir/ctangle.w"
+#line 317 "cwebdir/ctangle.w"
 *stack_ptr= cur_state;
 stack_ptr++;
 if(p!=NULL){
 cur_name= p;cur_repl= (text_pointer)p->equiv;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
-cur_section= 0;
+cur_byte= cur_repl->tok_start;cur_section= 0;
 }
 }
 
 /*:34*//*36:*/
-#line 338 "cwebdir/ctangle.w"
+#line 333 "cwebdir/ctangle.w"
 
 static void
 pop_level(
@@ -626,8 +626,7 @@
 {
 if(flag&&cur_repl->text_link<section_flag){
 cur_repl= cur_repl->text_link+text_info;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
-return;
+cur_byte= cur_repl->tok_start;return;
 }
 stack_ptr--;
 if(stack_ptr> stack)cur_state= *stack_ptr;
@@ -634,7 +633,7 @@
 }
 
 /*:36*//*38:*/
-#line 374 "cwebdir/ctangle.w"
+#line 368 "cwebdir/ctangle.w"
 
 static void
 get_output(void)
@@ -657,7 +656,7 @@
 case 0:cur_val= (int)a;out_char(identifier);break;
 case 1:if(a==output_defs_flag)output_defs();
 else/*40:*/
-#line 409 "cwebdir/ctangle.w"
+#line 403 "cwebdir/ctangle.w"
 
 {
 a-= 024000;
@@ -665,7 +664,7 @@
 else if(a!=0){
 #line 85 "cwebdir/ctang-w2c.ch"
 fputs(_("\n! Not present: <"),stdout);
-#line 415 "cwebdir/ctangle.w"
+#line 409 "cwebdir/ctangle.w"
 print_section_name(a+name_dir);err_print(">");
 
 }
@@ -673,7 +672,7 @@
 }
 
 /*:40*/
-#line 395 "cwebdir/ctangle.w"
+#line 389 "cwebdir/ctangle.w"
 
 break;
 default:cur_val= (int)a-050000;
@@ -684,7 +683,7 @@
 }
 
 /*:38*//*43:*/
-#line 467 "cwebdir/ctangle.w"
+#line 461 "cwebdir/ctangle.w"
 
 static void
 flush_buffer(void)
@@ -699,7 +698,7 @@
 }
 
 /*:43*//*48:*/
-#line 519 "cwebdir/ctangle.w"
+#line 513 "cwebdir/ctangle.w"
 
 static void
 phase_two(void){
@@ -707,27 +706,27 @@
 web_file_open= false;
 cur_line= 1;
 /*33:*/
-#line 304 "cwebdir/ctangle.w"
+#line 300 "cwebdir/ctangle.w"
 
 stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;cur_section= 0;
+cur_byte= cur_repl->tok_start;cur_section= 0;
 
 /*:33*/
-#line 525 "cwebdir/ctangle.w"
+#line 519 "cwebdir/ctangle.w"
 
 /*51:*/
-#line 586 "cwebdir/ctangle.w"
+#line 579 "cwebdir/ctangle.w"
 
 if(!output_defs_seen)
 output_defs();
 
 /*:51*/
-#line 526 "cwebdir/ctangle.w"
+#line 520 "cwebdir/ctangle.w"
 
 if(text_info->text_link==macro&&cur_out_file==end_output_files){
 #line 97 "cwebdir/ctang-w2c.ch"
 fputs(_("\n! No program text was specified."),stdout);mark_harmless;
-#line 529 "cwebdir/ctangle.w"
+#line 523 "cwebdir/ctangle.w"
 
 }
 else{
@@ -735,7 +734,7 @@
 if(show_progress){
 #line 103 "cwebdir/ctang-w2c.ch"
 printf(_("\nWriting the output file (%s):"),C_file_name);
-#line 535 "cwebdir/ctangle.w"
+#line 529 "cwebdir/ctangle.w"
 update_terminal;
 }
 }
@@ -743,7 +742,7 @@
 if(show_progress){
 #line 109 "cwebdir/ctang-w2c.ch"
 fputs(_("\nWriting the output files:"),stdout);
-#line 541 "cwebdir/ctangle.w"
+#line 535 "cwebdir/ctangle.w"
 
 printf(" (%s)",C_file_name);
 update_terminal;
@@ -753,16 +752,16 @@
 while(stack_ptr> stack)get_output();
 flush_buffer();
 writeloop:/*50:*/
-#line 138 "cwebdir/ctang-w2c.ch"
+#line 137 "cwebdir/ctang-w2c.ch"
 
 if(check_for_change){
 fclose(C_file);C_file= NULL;
 /*106:*/
-#line 438 "cwebdir/ctang-w2c.ch"
+#line 436 "cwebdir/ctang-w2c.ch"
 
 if((C_file= fopen(C_file_name,"r"))!=NULL){
 /*107:*/
-#line 445 "cwebdir/ctang-w2c.ch"
+#line 443 "cwebdir/ctang-w2c.ch"
 
 boolean comparison= false;
 
@@ -771,7 +770,7 @@
 
 
 /*108:*/
-#line 459 "cwebdir/ctang-w2c.ch"
+#line 457 "cwebdir/ctang-w2c.ch"
 
 do{
 char x[BUFSIZ],y[BUFSIZ];
@@ -781,7 +780,7 @@
 }while(comparison&&!feof(C_file)&&!feof(check_file));
 
 /*:108*/
-#line 452 "cwebdir/ctang-w2c.ch"
+#line 450 "cwebdir/ctang-w2c.ch"
 
 
 fclose(C_file);C_file= NULL;
@@ -788,10 +787,10 @@
 fclose(check_file);check_file= NULL;
 
 /*:107*/
-#line 440 "cwebdir/ctang-w2c.ch"
+#line 438 "cwebdir/ctang-w2c.ch"
 
 /*109:*/
-#line 470 "cwebdir/ctang-w2c.ch"
+#line 468 "cwebdir/ctang-w2c.ch"
 
 if(comparison)
 remove(check_file_name);
@@ -801,13 +800,13 @@
 }
 
 /*:109*/
-#line 441 "cwebdir/ctang-w2c.ch"
+#line 439 "cwebdir/ctang-w2c.ch"
 
 }else
 rename(check_file_name,C_file_name);
 
 /*:106*/
-#line 141 "cwebdir/ctang-w2c.ch"
+#line 140 "cwebdir/ctang-w2c.ch"
 
 }
 for(an_output_file= end_output_files;an_output_file> cur_out_file;){
@@ -814,7 +813,7 @@
 an_output_file--;
 sprint_section_name(output_file_name,*an_output_file);
 if(check_for_change)/*105:*/
-#line 429 "cwebdir/ctang-w2c.ch"
+#line 427 "cwebdir/ctang-w2c.ch"
 {
 if((C_file= fopen(output_file_name,"a"))==NULL)
 fatal(_("! Cannot open output file "),output_file_name);
@@ -825,7 +824,7 @@
 }
 
 /*:105*/
-#line 146 "cwebdir/ctang-w2c.ch"
+#line 145 "cwebdir/ctang-w2c.ch"
 
 else{
 fclose(C_file);
@@ -839,20 +838,19 @@
 cur_name= *an_output_file;
 cur_repl= (text_pointer)cur_name->equiv;
 cur_byte= cur_repl->tok_start;
-cur_end= (cur_repl+1)->tok_start;
 while(stack_ptr> stack)get_output();
 flush_buffer();
 if(check_for_change){
 fclose(C_file);C_file= NULL;
 /*110:*/
-#line 483 "cwebdir/ctang-w2c.ch"
+#line 481 "cwebdir/ctang-w2c.ch"
 
 if(0==strcmp("/dev/stdout",output_file_name))
 /*112:*/
-#line 510 "cwebdir/ctang-w2c.ch"
+#line 508 "cwebdir/ctang-w2c.ch"
 {
 /*115:*/
-#line 541 "cwebdir/ctang-w2c.ch"
+#line 539 "cwebdir/ctang-w2c.ch"
 
 char in_buf[BUFSIZ+1];
 int in_size;
@@ -862,7 +860,7 @@
 
 
 /*:115*/
-#line 511 "cwebdir/ctang-w2c.ch"
+#line 509 "cwebdir/ctang-w2c.ch"
 
 do{
 in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -871,7 +869,7 @@
 }while(!feof(check_file));
 fclose(check_file);check_file= NULL;
 /*111:*/
-#line 500 "cwebdir/ctang-w2c.ch"
+#line 498 "cwebdir/ctang-w2c.ch"
 
 if(comparison)
 remove(check_file_name);
@@ -881,19 +879,19 @@
 }
 
 /*:111*/
-#line 518 "cwebdir/ctang-w2c.ch"
+#line 516 "cwebdir/ctang-w2c.ch"
 
 }
 
 /*:112*/
-#line 485 "cwebdir/ctang-w2c.ch"
+#line 483 "cwebdir/ctang-w2c.ch"
 
 else if(0==strcmp("/dev/stderr",output_file_name))
 /*113:*/
-#line 523 "cwebdir/ctang-w2c.ch"
+#line 521 "cwebdir/ctang-w2c.ch"
 {
 /*115:*/
-#line 541 "cwebdir/ctang-w2c.ch"
+#line 539 "cwebdir/ctang-w2c.ch"
 
 char in_buf[BUFSIZ+1];
 int in_size;
@@ -903,7 +901,7 @@
 
 
 /*:115*/
-#line 524 "cwebdir/ctang-w2c.ch"
+#line 522 "cwebdir/ctang-w2c.ch"
 
 do{
 in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -912,7 +910,7 @@
 }while(!feof(check_file));
 fclose(check_file);check_file= NULL;
 /*111:*/
-#line 500 "cwebdir/ctang-w2c.ch"
+#line 498 "cwebdir/ctang-w2c.ch"
 
 if(comparison)
 remove(check_file_name);
@@ -922,20 +920,20 @@
 }
 
 /*:111*/
-#line 531 "cwebdir/ctang-w2c.ch"
+#line 529 "cwebdir/ctang-w2c.ch"
 
 }
 
 /*:113*/
-#line 487 "cwebdir/ctang-w2c.ch"
+#line 485 "cwebdir/ctang-w2c.ch"
 
 else if(0==strcmp("/dev/null",output_file_name))
 /*114:*/
-#line 536 "cwebdir/ctang-w2c.ch"
+#line 534 "cwebdir/ctang-w2c.ch"
 {
 boolean comparison= true;
 /*111:*/
-#line 500 "cwebdir/ctang-w2c.ch"
+#line 498 "cwebdir/ctang-w2c.ch"
 
 if(comparison)
 remove(check_file_name);
@@ -945,17 +943,17 @@
 }
 
 /*:111*/
-#line 538 "cwebdir/ctang-w2c.ch"
+#line 536 "cwebdir/ctang-w2c.ch"
 
 }
 
 /*:114*/
-#line 489 "cwebdir/ctang-w2c.ch"
+#line 487 "cwebdir/ctang-w2c.ch"
 
 else{
 if((C_file= fopen(output_file_name,"r"))!=NULL){
 /*107:*/
-#line 445 "cwebdir/ctang-w2c.ch"
+#line 443 "cwebdir/ctang-w2c.ch"
 
 boolean comparison= false;
 
@@ -964,7 +962,7 @@
 
 
 /*108:*/
-#line 459 "cwebdir/ctang-w2c.ch"
+#line 457 "cwebdir/ctang-w2c.ch"
 
 do{
 char x[BUFSIZ],y[BUFSIZ];
@@ -974,7 +972,7 @@
 }while(comparison&&!feof(C_file)&&!feof(check_file));
 
 /*:108*/
-#line 452 "cwebdir/ctang-w2c.ch"
+#line 450 "cwebdir/ctang-w2c.ch"
 
 
 fclose(C_file);C_file= NULL;
@@ -981,10 +979,10 @@
 fclose(check_file);check_file= NULL;
 
 /*:107*/
-#line 492 "cwebdir/ctang-w2c.ch"
+#line 490 "cwebdir/ctang-w2c.ch"
 
 /*111:*/
-#line 500 "cwebdir/ctang-w2c.ch"
+#line 498 "cwebdir/ctang-w2c.ch"
 
 if(comparison)
 remove(check_file_name);
@@ -994,7 +992,7 @@
 }
 
 /*:111*/
-#line 493 "cwebdir/ctang-w2c.ch"
+#line 491 "cwebdir/ctang-w2c.ch"
 
 }else
 rename(check_file_name,output_file_name);
@@ -1001,28 +999,28 @@
 }
 
 /*:110*/
-#line 164 "cwebdir/ctang-w2c.ch"
+#line 162 "cwebdir/ctang-w2c.ch"
 
 }
 }
 if(check_for_change)
 strcpy(check_file_name,"");
-#line 581 "cwebdir/ctangle.w"
+#line 574 "cwebdir/ctangle.w"
 
 /*:50*/
-#line 549 "cwebdir/ctangle.w"
+#line 543 "cwebdir/ctangle.w"
 
 if(show_happiness){
 if(show_progress)new_line;
 #line 115 "cwebdir/ctang-w2c.ch"
 fputs(_("Done."),stdout);
-#line 553 "cwebdir/ctangle.w"
+#line 547 "cwebdir/ctangle.w"
 }
 }
 }
 
 /*:48*//*54:*/
-#line 600 "cwebdir/ctangle.w"
+#line 595 "cwebdir/ctangle.w"
 
 static void
 output_defs(void)
@@ -1032,13 +1030,12 @@
 for(cur_text= text_info+1;cur_text<text_ptr;cur_text++)
 if(cur_text->text_link==macro){
 cur_byte= cur_text->tok_start;
-cur_end= (cur_text+1)->tok_start;
 C_printf("%s","#define ");
 out_state= normal;
 protect= true;
-while(cur_byte<cur_end){
+while(cur_byte<macro_end){
 a= *cur_byte++;
-if(cur_byte==cur_end&&a=='\n')break;
+if(cur_byte==macro_end&&a=='\n')break;
 if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
 C_putc(a);
 
@@ -1048,9 +1045,9 @@
 if(a<024000){
 cur_val= (int)a;out_char(identifier);
 }
-#line 174 "cwebdir/ctang-w2c.ch"
+#line 172 "cwebdir/ctang-w2c.ch"
 else if(a<050000)confusion(_("macro defs have strange char"));
-#line 626 "cwebdir/ctangle.w"
+#line 620 "cwebdir/ctangle.w"
 else{
 cur_val= (int)a-050000;cur_section= (sixteen_bits)cur_val;
 out_char(section_number);
@@ -1065,7 +1062,7 @@
 }
 
 /*:54*//*55:*/
-#line 644 "cwebdir/ctangle.w"
+#line 638 "cwebdir/ctangle.w"
 
 static void
 out_char(
@@ -1078,14 +1075,14 @@
 if(protect||out_state==verbatim)C_putc('\\');
 flush_buffer();if(out_state!=verbatim)out_state= normal;break;
 /*59:*/
-#line 206 "cwebdir/ctang-w2c.ch"
+#line 204 "cwebdir/ctang-w2c.ch"
 
-#line 713 "cwebdir/ctangle.w"
+#line 707 "cwebdir/ctangle.w"
 case identifier:
 if(out_state==num_or_id)C_putc(' ');
 for(j= (cur_val+name_dir)->byte_start,k= (cur_val+name_dir+1)->byte_start;
 j<k;j++)
-#line 214 "cwebdir/ctang-w2c.ch"
+#line 212 "cwebdir/ctang-w2c.ch"
 if(ishigh(*j)){
 
 if(transliterate_utf_eight){
@@ -1096,14 +1093,14 @@
 C_printf("%s",translit[(eight_bits)(*j)-0200]);
 }
 else C_putc(*j);
-#line 720 "cwebdir/ctangle.w"
+#line 714 "cwebdir/ctangle.w"
 out_state= num_or_id;break;
 
 /*:59*/
-#line 655 "cwebdir/ctangle.w"
+#line 649 "cwebdir/ctangle.w"
 
 /*60:*/
-#line 722 "cwebdir/ctangle.w"
+#line 716 "cwebdir/ctangle.w"
 
 case section_number:
 if(cur_val> 0)C_printf("/*%d:*/",cur_val);
@@ -1130,10 +1127,10 @@
 break;
 
 /*:60*/
-#line 656 "cwebdir/ctangle.w"
+#line 650 "cwebdir/ctangle.w"
 
 /*56:*/
-#line 674 "cwebdir/ctangle.w"
+#line 668 "cwebdir/ctangle.w"
 
 case plus_plus:C_putc('+');C_putc('+');out_state= normal;break;
 case minus_minus:C_putc('-');C_putc('-');out_state= normal;break;
@@ -1154,7 +1151,7 @@
 break;
 
 /*:56*/
-#line 657 "cwebdir/ctangle.w"
+#line 651 "cwebdir/ctangle.w"
 
 case'=':case'>':C_putc(cur_char);C_putc(' ');
 out_state= normal;break;
@@ -1173,7 +1170,7 @@
 }
 
 /*:55*//*64:*/
-#line 803 "cwebdir/ctangle.w"
+#line 797 "cwebdir/ctangle.w"
 
 static eight_bits
 skip_ahead(void)
@@ -1191,7 +1188,7 @@
 }
 
 /*:64*//*67:*/
-#line 842 "cwebdir/ctangle.w"
+#line 836 "cwebdir/ctangle.w"
 
 static boolean skip_comment(
 boolean is_long_comment)
@@ -1202,9 +1199,9 @@
 if(is_long_comment){
 if(get_line())return comment_continues= true;
 else{
-#line 229 "cwebdir/ctang-w2c.ch"
+#line 227 "cwebdir/ctang-w2c.ch"
 err_print(_("! Input ended in mid-comment"));
-#line 853 "cwebdir/ctangle.w"
+#line 847 "cwebdir/ctangle.w"
 
 return comment_continues= false;
 }
@@ -1217,9 +1214,9 @@
 }
 if(c=='@'){
 if(ccode[(eight_bits)*loc]==new_section){
-#line 235 "cwebdir/ctang-w2c.ch"
+#line 233 "cwebdir/ctang-w2c.ch"
 err_print(_("! Section name ended in mid-comment"));loc--;
-#line 866 "cwebdir/ctangle.w"
+#line 860 "cwebdir/ctangle.w"
 
 return comment_continues= false;
 }
@@ -1229,7 +1226,7 @@
 }
 
 /*:67*//*69:*/
-#line 883 "cwebdir/ctangle.w"
+#line 877 "cwebdir/ctangle.w"
 
 static eight_bits
 get_next(void)
@@ -1243,7 +1240,7 @@
 else if(print_where&&!no_where){
 print_where= false;
 /*85:*/
-#line 1229 "cwebdir/ctangle.w"
+#line 1223 "cwebdir/ctangle.w"
 
 {
 eight_bits a;
@@ -1260,7 +1257,7 @@
 }
 
 /*:85*/
-#line 895 "cwebdir/ctangle.w"
+#line 889 "cwebdir/ctangle.w"
 
 }
 else return(eight_bits)'\n';
@@ -1273,7 +1270,7 @@
 }
 loc++;
 if(xisdigit(c)||c=='.')/*73:*/
-#line 967 "cwebdir/ctangle.w"
+#line 961 "cwebdir/ctangle.w"
 {
 boolean hex_flag= false;
 id_first= loc-1;
@@ -1307,13 +1304,13 @@
 }
 
 /*:73*/
-#line 906 "cwebdir/ctangle.w"
+#line 900 "cwebdir/ctangle.w"
 
 else if(c=='\''||c=='"'
 ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"'))
 ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"')))
 /*74:*/
-#line 1004 "cwebdir/ctangle.w"
+#line 998 "cwebdir/ctangle.w"
 {
 char delim= (char)c;
 id_first= section_text+1;
@@ -1325,15 +1322,15 @@
 while(true){
 if(loc>=limit){
 if(*(limit-1)!='\\'){
-#line 241 "cwebdir/ctang-w2c.ch"
+#line 239 "cwebdir/ctang-w2c.ch"
 err_print(_("! String didn't end"));loc= limit;break;
-#line 1016 "cwebdir/ctangle.w"
+#line 1010 "cwebdir/ctangle.w"
 
 }
 if(get_line()==false){
-#line 247 "cwebdir/ctang-w2c.ch"
+#line 245 "cwebdir/ctang-w2c.ch"
 err_print(_("! Input ended in middle of string"));loc= buffer;break;
-#line 1020 "cwebdir/ctangle.w"
+#line 1014 "cwebdir/ctangle.w"
 
 }
 else if(++id_loc<=section_text_end)*id_loc= '\n';
@@ -1351,9 +1348,9 @@
 if(++id_loc<=section_text_end)*id_loc= (char)c;
 }
 if(id_loc>=section_text_end){
-#line 253 "cwebdir/ctang-w2c.ch"
+#line 251 "cwebdir/ctang-w2c.ch"
 fputs(_("\n! String too long: "),stdout);
-#line 1038 "cwebdir/ctangle.w"
+#line 1032 "cwebdir/ctangle.w"
 
 term_write(section_text+1,25);
 err_print("...");
@@ -1363,11 +1360,11 @@
 }
 
 /*:74*/
-#line 910 "cwebdir/ctangle.w"
+#line 904 "cwebdir/ctangle.w"
 
 else if(isalpha((int)c)||isxalpha(c)||ishigh(c))
 /*72:*/
-#line 958 "cwebdir/ctangle.w"
+#line 952 "cwebdir/ctangle.w"
 {
 id_first= --loc;
 do
@@ -1378,45 +1375,45 @@
 }
 
 /*:72*/
-#line 912 "cwebdir/ctangle.w"
+#line 906 "cwebdir/ctangle.w"
 
 else if(c=='@')/*75:*/
-#line 1049 "cwebdir/ctangle.w"
+#line 1043 "cwebdir/ctangle.w"
 
 switch(c= ccode[(eight_bits)*loc++]){
 case ignore:continue;
-#line 259 "cwebdir/ctang-w2c.ch"
+#line 257 "cwebdir/ctang-w2c.ch"
 case translit_code:err_print(_("! Use @l in limbo only"));continue;
-#line 1053 "cwebdir/ctangle.w"
+#line 1047 "cwebdir/ctangle.w"
 
 case control_text:while((c= skip_ahead())=='@');
 
 if(*(loc-1)!='>')
-#line 265 "cwebdir/ctang-w2c.ch"
+#line 263 "cwebdir/ctang-w2c.ch"
 err_print(_("! Double @ should be used in control text"));
-#line 1058 "cwebdir/ctangle.w"
+#line 1052 "cwebdir/ctangle.w"
 
 continue;
 case section_name:
 cur_section_name_char= *(loc-1);
 /*77:*/
-#line 1094 "cwebdir/ctangle.w"
+#line 1088 "cwebdir/ctangle.w"
 {
 char*k= section_text;
 /*79:*/
-#line 1116 "cwebdir/ctangle.w"
+#line 1110 "cwebdir/ctangle.w"
 
 while(true){
 if(loc> limit&&get_line()==false){
-#line 283 "cwebdir/ctang-w2c.ch"
+#line 281 "cwebdir/ctang-w2c.ch"
 err_print(_("! Input ended in section name"));
-#line 1120 "cwebdir/ctangle.w"
+#line 1114 "cwebdir/ctangle.w"
 
 loc= buffer+1;break;
 }
 c= (eight_bits)*loc;
 /*80:*/
-#line 1139 "cwebdir/ctangle.w"
+#line 1133 "cwebdir/ctangle.w"
 
 if(c=='@'){
 c= (eight_bits)*(loc+1);
@@ -1424,15 +1421,15 @@
 loc+= 2;break;
 }
 if(ccode[(eight_bits)c]==new_section){
-#line 295 "cwebdir/ctang-w2c.ch"
+#line 293 "cwebdir/ctang-w2c.ch"
 err_print(_("! Section name didn't end"));break;
-#line 1147 "cwebdir/ctangle.w"
+#line 1141 "cwebdir/ctangle.w"
 
 }
 if(ccode[(eight_bits)c]==section_name){
-#line 301 "cwebdir/ctang-w2c.ch"
+#line 299 "cwebdir/ctang-w2c.ch"
 err_print(_("! Nesting of section names not allowed"));break;
-#line 1151 "cwebdir/ctangle.w"
+#line 1145 "cwebdir/ctangle.w"
 
 }
 *(++k)= '@';loc++;
@@ -1439,7 +1436,7 @@
 }
 
 /*:80*/
-#line 1124 "cwebdir/ctangle.w"
+#line 1118 "cwebdir/ctangle.w"
 
 loc++;if(k<section_text_end)k++;
 if(xisspace(c)){
@@ -1448,9 +1445,9 @@
 *k= (char)c;
 }
 if(k>=section_text_end){
-#line 289 "cwebdir/ctang-w2c.ch"
+#line 287 "cwebdir/ctang-w2c.ch"
 fputs(_("\n! Section name too long: "),stdout);
-#line 1133 "cwebdir/ctangle.w"
+#line 1127 "cwebdir/ctangle.w"
 
 term_write(section_text+1,25);
 printf("...");mark_harmless;
@@ -1458,7 +1455,7 @@
 if(*k==' '&&k> section_text)k--;
 
 /*:79*/
-#line 1096 "cwebdir/ctangle.w"
+#line 1090 "cwebdir/ctangle.w"
 
 if(k-section_text> 3&&strncmp(k-2,"...",3)==0)
 cur_section_name= section_lookup(section_text+1,k-3,true);
@@ -1467,7 +1464,7 @@
 
 if(cur_section_name_char=='(')
 /*47:*/
-#line 504 "cwebdir/ctangle.w"
+#line 498 "cwebdir/ctangle.w"
 
 {
 for(an_output_file= cur_out_file;
@@ -1478,36 +1475,36 @@
 *--cur_out_file= cur_section_name;
 #line 91 "cwebdir/ctang-w2c.ch"
 else overflow(_("output files"));
-#line 513 "cwebdir/ctangle.w"
+#line 507 "cwebdir/ctangle.w"
 }
 }
 
 /*:47*/
-#line 1104 "cwebdir/ctangle.w"
+#line 1098 "cwebdir/ctangle.w"
 
 return section_name;
 }
 
 /*:77*/
-#line 1062 "cwebdir/ctangle.w"
+#line 1056 "cwebdir/ctangle.w"
 
 case string:/*81:*/
-#line 1161 "cwebdir/ctangle.w"
+#line 1155 "cwebdir/ctangle.w"
 
 id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
 while(*loc!='@'||*(loc+1)!='>')loc++;
-#line 307 "cwebdir/ctang-w2c.ch"
+#line 305 "cwebdir/ctang-w2c.ch"
 if(loc>=limit)err_print(_("! Verbatim string didn't end"));
-#line 1165 "cwebdir/ctangle.w"
+#line 1159 "cwebdir/ctangle.w"
 
 id_loc= loc;loc+= 2;
 return string;
 
 /*:81*/
-#line 1063 "cwebdir/ctangle.w"
+#line 1057 "cwebdir/ctangle.w"
 
 case ord:/*76:*/
-#line 1074 "cwebdir/ctangle.w"
+#line 1068 "cwebdir/ctangle.w"
 
 id_first= loc;
 if(*loc=='\\')
@@ -1515,17 +1512,17 @@
 while(*loc!='\''){
 if(*loc=='@'){
 if(*(loc+1)!='@')
-#line 271 "cwebdir/ctang-w2c.ch"
+#line 269 "cwebdir/ctang-w2c.ch"
 err_print(_("! Double @ should be used in ASCII constant"));
-#line 1082 "cwebdir/ctangle.w"
+#line 1076 "cwebdir/ctangle.w"
 
 else loc++;
 }
 loc++;
 if(loc> limit){
-#line 277 "cwebdir/ctang-w2c.ch"
+#line 275 "cwebdir/ctang-w2c.ch"
 err_print(_("! String didn't end"));loc= limit-1;break;
-#line 1088 "cwebdir/ctangle.w"
+#line 1082 "cwebdir/ctangle.w"
 
 }
 }
@@ -1533,13 +1530,13 @@
 return ord;
 
 /*:76*/
-#line 1064 "cwebdir/ctangle.w"
+#line 1058 "cwebdir/ctangle.w"
 
 default:return c;
 }
 
 /*:75*/
-#line 913 "cwebdir/ctangle.w"
+#line 907 "cwebdir/ctangle.w"
 
 else if(xisspace(c)){
 if(!preprocessing||loc> limit)continue;
@@ -1549,7 +1546,7 @@
 }
 else if(c=='#'&&loc==buffer+1)preprocessing= true;
 mistake:/*71:*/
-#line 935 "cwebdir/ctangle.w"
+#line 929 "cwebdir/ctangle.w"
 
 switch(c){
 case'+':if(*loc=='+')compress(plus_plus);break;
@@ -1574,7 +1571,7 @@
 }
 
 /*:71*/
-#line 921 "cwebdir/ctangle.w"
+#line 915 "cwebdir/ctangle.w"
 
 return c;
 }
@@ -1581,7 +1578,7 @@
 }
 
 /*:69*//*83:*/
-#line 1197 "cwebdir/ctangle.w"
+#line 1191 "cwebdir/ctangle.w"
 
 static void
 scan_repl(
@@ -1589,7 +1586,7 @@
 {
 sixteen_bits a;
 if(t==section_name)/*85:*/
-#line 1229 "cwebdir/ctangle.w"
+#line 1223 "cwebdir/ctangle.w"
 
 {
 eight_bits a;
@@ -1606,11 +1603,11 @@
 }
 
 /*:85*/
-#line 1203 "cwebdir/ctangle.w"
+#line 1197 "cwebdir/ctangle.w"
 
 while(true)switch(a= get_next()){
 /*86:*/
-#line 1244 "cwebdir/ctangle.w"
+#line 1238 "cwebdir/ctangle.w"
 
 case identifier:store_id(a);
 if(*buffer=='#'&&(
@@ -1623,15 +1620,15 @@
 case section_name:if(t!=section_name)goto done;
 else{
 /*87:*/
-#line 1285 "cwebdir/ctangle.w"
+#line 1279 "cwebdir/ctangle.w"
 {
 char*try_loc= loc;
 while(*try_loc==' '&&try_loc<limit)try_loc++;
 if(*try_loc=='+'&&try_loc<limit)try_loc++;
 while(*try_loc==' '&&try_loc<limit)try_loc++;
-#line 343 "cwebdir/ctang-w2c.ch"
+#line 341 "cwebdir/ctang-w2c.ch"
 if(*try_loc=='=')err_print(_("! Missing `@ ' before a named section"));
-#line 1291 "cwebdir/ctangle.w"
+#line 1285 "cwebdir/ctangle.w"
 
 
 
@@ -1638,13 +1635,13 @@
 }
 
 /*:87*/
-#line 1255 "cwebdir/ctangle.w"
+#line 1249 "cwebdir/ctangle.w"
 
 a= cur_section_name-name_dir;
 app_repl((a/0400)+0250);
 app_repl(a%0400);
 /*85:*/
-#line 1229 "cwebdir/ctangle.w"
+#line 1223 "cwebdir/ctangle.w"
 
 {
 eight_bits a;
@@ -1661,13 +1658,13 @@
 }
 
 /*:85*/
-#line 1259 "cwebdir/ctangle.w"
+#line 1253 "cwebdir/ctangle.w"
 
 }
 break;
-#line 331 "cwebdir/ctang-w2c.ch"
+#line 329 "cwebdir/ctang-w2c.ch"
 case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h"));
-#line 1263 "cwebdir/ctangle.w"
+#line 1257 "cwebdir/ctangle.w"
 
 else{
 output_defs_seen= true;
@@ -1675,7 +1672,7 @@
 app_repl((a/0400)+0200);
 app_repl(a%0400);
 /*85:*/
-#line 1229 "cwebdir/ctangle.w"
+#line 1223 "cwebdir/ctangle.w"
 
 {
 eight_bits a;
@@ -1692,21 +1689,21 @@
 }
 
 /*:85*/
-#line 1269 "cwebdir/ctangle.w"
+#line 1263 "cwebdir/ctangle.w"
 
 }
 break;
 case constant:case string:
 /*88:*/
-#line 1302 "cwebdir/ctangle.w"
+#line 1296 "cwebdir/ctangle.w"
 
 app_repl(a);
 while(id_first<id_loc){
 if(*id_first=='@'){
 if(*(id_first+1)=='@')id_first++;
-#line 349 "cwebdir/ctang-w2c.ch"
+#line 347 "cwebdir/ctang-w2c.ch"
 else err_print(_("! Double @ should be used in string"));
-#line 1308 "cwebdir/ctangle.w"
+#line 1302 "cwebdir/ctangle.w"
 
 }
 else if(a==constant&&*id_first=='\''&&!keep_digit_separators)
@@ -1716,12 +1713,12 @@
 app_repl(a);
 
 /*:88*/
-#line 1273 "cwebdir/ctangle.w"
+#line 1267 "cwebdir/ctangle.w"
 
 break;
 case ord:
 /*89:*/
-#line 1320 "cwebdir/ctangle.w"
+#line 1314 "cwebdir/ctangle.w"
 {
 int c= (int)((eight_bits)*id_first);
 if(c=='\\'){
@@ -1758,9 +1755,9 @@
 case'\\':c= '\\';break;
 case'\'':c= '\'';break;
 case'\"':c= '\"';break;
-#line 355 "cwebdir/ctang-w2c.ch"
+#line 353 "cwebdir/ctang-w2c.ch"
 default:err_print(_("! Unrecognized escape sequence"));
-#line 1357 "cwebdir/ctangle.w"
+#line 1351 "cwebdir/ctangle.w"
 
 }
 }
@@ -1773,20 +1770,20 @@
 }
 
 /*:89*/
-#line 1276 "cwebdir/ctangle.w"
+#line 1270 "cwebdir/ctangle.w"
 
 break;
 case definition:case format_code:case begin_C:if(t!=section_name)goto done;
 else{
-#line 337 "cwebdir/ctang-w2c.ch"
+#line 335 "cwebdir/ctang-w2c.ch"
 err_print(_("! @d, @f and @c are ignored in C text"));continue;
-#line 1281 "cwebdir/ctangle.w"
+#line 1275 "cwebdir/ctangle.w"
 
 }
 case new_section:goto done;
 
 /*:86*/
-#line 1208 "cwebdir/ctangle.w"
+#line 1202 "cwebdir/ctangle.w"
 
 case')':app_repl(a);
 if(t==macro)app_repl(' ');
@@ -1794,14 +1791,14 @@
 default:app_repl(a);
 }
 done:next_control= (eight_bits)a;
-#line 325 "cwebdir/ctang-w2c.ch"
+#line 323 "cwebdir/ctang-w2c.ch"
 if(text_ptr> text_info_end)overflow(_("text"));
-#line 1216 "cwebdir/ctangle.w"
+#line 1210 "cwebdir/ctangle.w"
 cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr;
 }
 
 /*:83*//*90:*/
-#line 1378 "cwebdir/ctangle.w"
+#line 1372 "cwebdir/ctangle.w"
 
 static void
 scan_section(void)
@@ -1816,7 +1813,7 @@
 next_control= ignore;
 while(true){
 /*92:*/
-#line 1419 "cwebdir/ctangle.w"
+#line 1413 "cwebdir/ctangle.w"
 
 while(next_control<definition)
 
@@ -1825,17 +1822,17 @@
 }
 
 /*:92*/
-#line 1392 "cwebdir/ctangle.w"
+#line 1386 "cwebdir/ctangle.w"
 
 if(next_control==definition){
 /*93:*/
-#line 1426 "cwebdir/ctangle.w"
+#line 1420 "cwebdir/ctangle.w"
 
 while((next_control= get_next())=='\n');
 if(next_control!=identifier){
-#line 361 "cwebdir/ctang-w2c.ch"
+#line 359 "cwebdir/ctang-w2c.ch"
 err_print(_("! Definition flushed, must start with identifier"));
-#line 1430 "cwebdir/ctangle.w"
+#line 1424 "cwebdir/ctangle.w"
 
 continue;
 }
@@ -1847,7 +1844,7 @@
 cur_text->text_link= macro;
 
 /*:93*/
-#line 1394 "cwebdir/ctangle.w"
+#line 1388 "cwebdir/ctangle.w"
 
 continue;
 }
@@ -1857,7 +1854,7 @@
 if(next_control==section_name){
 p= cur_section_name;
 /*94:*/
-#line 1448 "cwebdir/ctangle.w"
+#line 1442 "cwebdir/ctangle.w"
 
 while((next_control= get_next())=='+');
 if(next_control!='='&&next_control!=eq_eq)
@@ -1864,7 +1861,7 @@
 continue;
 
 /*:94*/
-#line 1402 "cwebdir/ctangle.w"
+#line 1396 "cwebdir/ctangle.w"
 
 break;
 }
@@ -1872,20 +1869,20 @@
 }
 no_where= print_where= false;
 /*95:*/
-#line 1453 "cwebdir/ctangle.w"
+#line 1447 "cwebdir/ctangle.w"
 
 /*96:*/
-#line 1458 "cwebdir/ctangle.w"
+#line 1452 "cwebdir/ctangle.w"
 
 store_two_bytes((sixteen_bits)(0150000+section_count));
 
 
 /*:96*/
-#line 1454 "cwebdir/ctangle.w"
+#line 1448 "cwebdir/ctangle.w"
 
 scan_repl(section_name);
 /*97:*/
-#line 1462 "cwebdir/ctangle.w"
+#line 1456 "cwebdir/ctangle.w"
 
 if(p==name_dir||p==NULL){
 last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text;
@@ -1902,16 +1899,16 @@
 
 
 /*:97*/
-#line 1456 "cwebdir/ctangle.w"
+#line 1450 "cwebdir/ctangle.w"
 
 
 /*:95*/
-#line 1408 "cwebdir/ctangle.w"
+#line 1402 "cwebdir/ctangle.w"
 
 }
 
 /*:90*//*98:*/
-#line 1477 "cwebdir/ctangle.w"
+#line 1471 "cwebdir/ctangle.w"
 
 static void
 phase_one(void){
@@ -1924,7 +1921,7 @@
 }
 
 /*:98*//*100:*/
-#line 1493 "cwebdir/ctangle.w"
+#line 1487 "cwebdir/ctangle.w"
 
 static void
 skip_limbo(void)
@@ -1938,15 +1935,15 @@
 switch(ccode[(eight_bits)c]){
 case new_section:return;
 case translit_code:/*102:*/
-#line 1523 "cwebdir/ctangle.w"
+#line 1517 "cwebdir/ctangle.w"
 
 while(xisspace(*loc)&&loc<limit)loc++;
 loc+= 3;
 if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
 ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
-#line 381 "cwebdir/ctang-w2c.ch"
+#line 379 "cwebdir/ctang-w2c.ch"
 err_print(_("! Improper hex number following @l"));
-#line 1529 "cwebdir/ctangle.w"
+#line 1523 "cwebdir/ctangle.w"
 
 else{
 unsigned int i;
@@ -1956,9 +1953,9 @@
 beg= loc;
 while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||isxalpha(*loc)))loc++;
 if(loc-beg>=translit_length)
-#line 387 "cwebdir/ctang-w2c.ch"
+#line 385 "cwebdir/ctang-w2c.ch"
 err_print(_("! Replacement string in @l too long"));
-#line 1539 "cwebdir/ctangle.w"
+#line 1533 "cwebdir/ctangle.w"
 
 else{
 strncpy(translit[i-0200],beg,(size_t)(loc-beg));
@@ -1967,21 +1964,21 @@
 }
 
 /*:102*/
-#line 1505 "cwebdir/ctangle.w"
+#line 1499 "cwebdir/ctangle.w"
 break;
 case format_code:case'@':break;
 case control_text:if(c=='q'||c=='Q'){
 while((c= (char)skip_ahead())=='@');
 if(*(loc-1)!='>')
-#line 367 "cwebdir/ctang-w2c.ch"
+#line 365 "cwebdir/ctang-w2c.ch"
 err_print(_("! Double @ should be used in control text"));
-#line 1511 "cwebdir/ctangle.w"
+#line 1505 "cwebdir/ctangle.w"
 
 break;
-#line 374 "cwebdir/ctang-w2c.ch"
+#line 372 "cwebdir/ctang-w2c.ch"
 }/* otherwise fall through */
 default:err_print(_("! Double @ should be used in limbo"));
-#line 1515 "cwebdir/ctangle.w"
+#line 1509 "cwebdir/ctangle.w"
 
 }
 }
@@ -1989,11 +1986,11 @@
 }
 
 /*:100*//*103:*/
-#line 1549 "cwebdir/ctangle.w"
+#line 1543 "cwebdir/ctangle.w"
 
 void
 print_stats(void){
-#line 400 "cwebdir/ctang-w2c.ch"
+#line 398 "cwebdir/ctang-w2c.ch"
 puts(_("\nMemory usage statistics:"));
 printf(_("%td names (out of %ld)\n"),
 (ptrdiff_t)(name_ptr-name_dir),(long)max_names);
@@ -2002,9 +1999,9 @@
 printf(_("%td bytes (out of %ld)\n"),
 (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes);
 printf(_("%td tokens (out of %ld)\n"),
-#line 1560 "cwebdir/ctangle.w"
+#line 1554 "cwebdir/ctangle.w"
 (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks);
 }
 
-#line 413 "cwebdir/ctang-w2c.ch"
+#line 411 "cwebdir/ctang-w2c.ch"
 /*:103*/

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2023-07-13 15:11:14 UTC (rev 67618)
@@ -1,3 +1,10 @@
+2023-07-13  Andreas Scherer  <https://ascherer.github.io>
+
+	* ctang-{bs,w2c}.ch,
+	* ctangle.c,
+	+ ctangle.w,
+	* cweave.w: Merge 'cur_state' into 'stack'.
+
 2023-07-09  Andreas Scherer  <https://ascherer.github.io>
 
 	* comm-ql.ch,

Modified: trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch	2023-07-13 15:11:14 UTC (rev 67618)
@@ -144,10 +144,8 @@
 
 
 @x Section 31.
-  eight_bits *end_field; /* ending location of replacement text */
   eight_bits *byte_field; /* present location within replacement text */
 @y
-  eight_bits huge* end_field; /* ending location of replacement text */
   eight_bits huge* byte_field; /* present location within replacement text */
 @z
 

Modified: trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch	2023-07-13 15:11:14 UTC (rev 67618)
@@ -130,7 +130,6 @@
     cur_name=*an_output_file;
     cur_repl=(text_pointer)cur_name->equiv;
     cur_byte=cur_repl->tok_start;
-    cur_end=(cur_repl+1)->tok_start;
     while (stack_ptr > stack) get_output();
     flush_buffer();
 }
@@ -156,7 +155,6 @@
   cur_name=*an_output_file;
   cur_repl=(text_pointer)cur_name->equiv;
   cur_byte=cur_repl->tok_start;
-  cur_end=(cur_repl+1)->tok_start;
   while (stack_ptr > stack) get_output();
   flush_buffer();
   if (check_for_change) {

Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.c	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.c	2023-07-13 15:11:14 UTC (rev 67618)
@@ -107,11 +107,13 @@
 #define output_defs_flag (2*024000-1)  \
 
 #define stack_size 50
-#define cur_end cur_state.end_field
+#define cur_state stack[stack_size+1] \
+
 #define cur_byte cur_state.byte_field
 #define cur_name cur_state.name_field
 #define cur_repl cur_state.repl_field
-#define cur_section cur_state.section_field \
+#define cur_section cur_state.section_field
+#define cur_end (cur_repl+1) ->tok_start \
 
 #define section_number 0201
 #define identifier 0202 \
@@ -126,6 +128,8 @@
 #define C_printf(c,a) fprintf(C_file,c,a) 
 #define C_putc(c) putc((int) (c) ,C_file)  \
 
+#define macro_end (cur_text+1) ->tok_start \
+
 #define translit_length 10 \
 
 #define ignore 00
@@ -265,10 +269,9 @@
 typedef text*text_pointer;
 
 /*:19*//*31:*/
-#line 274 "ctangle.w"
+#line 271 "ctangle.w"
 
 typedef struct{
-eight_bits*end_field;
 eight_bits*byte_field;
 name_pointer name_field;
 text_pointer repl_field;
@@ -295,27 +298,25 @@
 static text_pointer last_unnamed;
 
 /*:26*//*32:*/
-#line 291 "ctangle.w"
+#line 289 "ctangle.w"
 
-static output_state cur_state;
-
-static output_state stack[stack_size+1];
+static output_state stack[stack_size+2];
 static stack_pointer stack_end= stack+stack_size;
 static stack_pointer stack_ptr;
 
 /*:32*//*37:*/
-#line 367 "ctangle.w"
+#line 361 "ctangle.w"
 
 static int cur_val;
 
 /*:37*//*42:*/
-#line 459 "ctangle.w"
+#line 453 "ctangle.w"
 
 static eight_bits out_state;
 static boolean protect;
 
 /*:42*//*45:*/
-#line 490 "ctangle.w"
+#line 484 "ctangle.w"
 
 static name_pointer output_files[max_files];
 static name_pointer*cur_out_file,*end_output_files,*an_output_file;
@@ -323,33 +324,33 @@
 static char output_file_name[longest_name+1];
 
 /*:45*//*52:*/
-#line 590 "ctangle.w"
+#line 583 "ctangle.w"
 
 static boolean output_defs_seen= false;
 
 /*:52*//*57:*/
-#line 703 "ctangle.w"
+#line 697 "ctangle.w"
 
 static char translit[0200][translit_length];
 
 /*:57*//*62:*/
-#line 779 "ctangle.w"
+#line 773 "ctangle.w"
 
 static eight_bits ccode[256];
 
 /*:62*//*66:*/
-#line 839 "ctangle.w"
+#line 833 "ctangle.w"
 
 static boolean comment_continues= false;
 
 /*:66*//*68:*/
-#line 876 "ctangle.w"
+#line 870 "ctangle.w"
 
 static name_pointer cur_section_name;
 static boolean no_where;
 
 /*:68*//*82:*/
-#line 1193 "ctangle.w"
+#line 1187 "ctangle.w"
 
 static text_pointer cur_text;
 static eight_bits next_control;
@@ -396,53 +397,53 @@
 static void store_two_bytes(sixteen_bits);
 
 /*:30*//*35:*/
-#line 330 "ctangle.w"
+#line 325 "ctangle.w"
 
 static void push_level(name_pointer);
 static void pop_level(boolean);
 
 /*:35*//*39:*/
-#line 404 "ctangle.w"
+#line 398 "ctangle.w"
 static void get_output(void);
 
 /*:39*//*44:*/
-#line 480 "ctangle.w"
+#line 474 "ctangle.w"
 static void flush_buffer(void);
 
 /*:44*//*49:*/
-#line 557 "ctangle.w"
+#line 551 "ctangle.w"
 static void phase_two(void);
 
 /*:49*//*53:*/
-#line 593 "ctangle.w"
+#line 586 "ctangle.w"
 
 static void output_defs(void);
 static void out_char(eight_bits);
 
 /*:53*//*65:*/
-#line 819 "ctangle.w"
+#line 813 "ctangle.w"
 
 static eight_bits skip_ahead(void);
 static boolean skip_comment(boolean);
 
 /*:65*//*70:*/
-#line 926 "ctangle.w"
+#line 920 "ctangle.w"
 static eight_bits get_next(void);
 
 /*:70*//*84:*/
-#line 1219 "ctangle.w"
+#line 1213 "ctangle.w"
 static void scan_repl(eight_bits);
 
 /*:84*//*91:*/
-#line 1411 "ctangle.w"
+#line 1405 "ctangle.w"
 static void scan_section(void);
 
 /*:91*//*99:*/
-#line 1488 "ctangle.w"
+#line 1482 "ctangle.w"
 static void phase_one(void);
 
 /*:99*//*101:*/
-#line 1521 "ctangle.w"
+#line 1515 "ctangle.w"
 static void skip_limbo(void);
 
 /*:101*/
@@ -475,12 +476,12 @@
 last_unnamed= text_info;text_info->text_link= macro;
 
 /*:27*//*46:*/
-#line 500 "ctangle.w"
+#line 494 "ctangle.w"
 
 cur_out_file= end_output_files= output_files+max_files;
 
 /*:46*//*58:*/
-#line 706 "ctangle.w"
+#line 700 "ctangle.w"
 
 {
 int i;
@@ -488,7 +489,7 @@
 }
 
 /*:58*//*63:*/
-#line 782 "ctangle.w"
+#line 776 "ctangle.w"
 {
 int c;
 for(c= 0;c<256;c++)ccode[c]= ignore;
@@ -508,7 +509,7 @@
 ccode['\'']= ord;
 
 /*:63*//*78:*/
-#line 1114 "ctangle.w"
+#line 1108 "ctangle.w"
 section_text[0]= ' ';
 
 /*:78*/
@@ -558,7 +559,7 @@
 }
 
 /*:29*//*34:*/
-#line 315 "ctangle.w"
+#line 311 "ctangle.w"
 
 static void
 push_level(
@@ -569,13 +570,12 @@
 stack_ptr++;
 if(p!=NULL){
 cur_name= p;cur_repl= (text_pointer)p->equiv;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
-cur_section= 0;
+cur_byte= cur_repl->tok_start;cur_section= 0;
 }
 }
 
 /*:34*//*36:*/
-#line 338 "ctangle.w"
+#line 333 "ctangle.w"
 
 static void
 pop_level(
@@ -583,8 +583,7 @@
 {
 if(flag&&cur_repl->text_link<section_flag){
 cur_repl= cur_repl->text_link+text_info;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
-return;
+cur_byte= cur_repl->tok_start;return;
 }
 stack_ptr--;
 if(stack_ptr> stack)cur_state= *stack_ptr;
@@ -591,7 +590,7 @@
 }
 
 /*:36*//*38:*/
-#line 374 "ctangle.w"
+#line 368 "ctangle.w"
 
 static void
 get_output(void)
@@ -614,7 +613,7 @@
 case 0:cur_val= (int)a;out_char(identifier);break;
 case 1:if(a==output_defs_flag)output_defs();
 else/*40:*/
-#line 409 "ctangle.w"
+#line 403 "ctangle.w"
 
 {
 a-= 024000;
@@ -628,7 +627,7 @@
 }
 
 /*:40*/
-#line 395 "ctangle.w"
+#line 389 "ctangle.w"
 
 break;
 default:cur_val= (int)a-050000;
@@ -639,7 +638,7 @@
 }
 
 /*:38*//*43:*/
-#line 467 "ctangle.w"
+#line 461 "ctangle.w"
 
 static void
 flush_buffer(void)
@@ -654,7 +653,7 @@
 }
 
 /*:43*//*48:*/
-#line 519 "ctangle.w"
+#line 513 "ctangle.w"
 
 static void
 phase_two(void){
@@ -662,22 +661,22 @@
 web_file_open= false;
 cur_line= 1;
 /*33:*/
-#line 304 "ctangle.w"
+#line 300 "ctangle.w"
 
 stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info;
-cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;cur_section= 0;
+cur_byte= cur_repl->tok_start;cur_section= 0;
 
 /*:33*/
-#line 525 "ctangle.w"
+#line 519 "ctangle.w"
 
 /*51:*/
-#line 586 "ctangle.w"
+#line 579 "ctangle.w"
 
 if(!output_defs_seen)
 output_defs();
 
 /*:51*/
-#line 526 "ctangle.w"
+#line 520 "ctangle.w"
 
 if(text_info->text_link==macro&&cur_out_file==end_output_files){
 fputs("\n! No program text was specified.",stdout);mark_harmless;
@@ -702,7 +701,7 @@
 while(stack_ptr> stack)get_output();
 flush_buffer();
 writeloop:/*50:*/
-#line 563 "ctangle.w"
+#line 557 "ctangle.w"
 
 for(an_output_file= end_output_files;an_output_file> cur_out_file;){
 an_output_file--;
@@ -717,13 +716,12 @@
 cur_name= *an_output_file;
 cur_repl= (text_pointer)cur_name->equiv;
 cur_byte= cur_repl->tok_start;
-cur_end= (cur_repl+1)->tok_start;
 while(stack_ptr> stack)get_output();
 flush_buffer();
 }
 
 /*:50*/
-#line 549 "ctangle.w"
+#line 543 "ctangle.w"
 
 if(show_happiness){
 if(show_progress)new_line;
@@ -733,7 +731,7 @@
 }
 
 /*:48*//*54:*/
-#line 600 "ctangle.w"
+#line 595 "ctangle.w"
 
 static void
 output_defs(void)
@@ -743,13 +741,12 @@
 for(cur_text= text_info+1;cur_text<text_ptr;cur_text++)
 if(cur_text->text_link==macro){
 cur_byte= cur_text->tok_start;
-cur_end= (cur_text+1)->tok_start;
 C_printf("%s","#define ");
 out_state= normal;
 protect= true;
-while(cur_byte<cur_end){
+while(cur_byte<macro_end){
 a= *cur_byte++;
-if(cur_byte==cur_end&&a=='\n')break;
+if(cur_byte==macro_end&&a=='\n')break;
 if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
 C_putc(a);
 
@@ -774,7 +771,7 @@
 }
 
 /*:54*//*55:*/
-#line 644 "ctangle.w"
+#line 638 "ctangle.w"
 
 static void
 out_char(
@@ -787,7 +784,7 @@
 if(protect||out_state==verbatim)C_putc('\\');
 flush_buffer();if(out_state!=verbatim)out_state= normal;break;
 /*59:*/
-#line 712 "ctangle.w"
+#line 706 "ctangle.w"
 
 case identifier:
 if(out_state==num_or_id)C_putc(' ');
@@ -799,10 +796,10 @@
 out_state= num_or_id;break;
 
 /*:59*/
-#line 655 "ctangle.w"
+#line 649 "ctangle.w"
 
 /*60:*/
-#line 722 "ctangle.w"
+#line 716 "ctangle.w"
 
 case section_number:
 if(cur_val> 0)C_printf("/*%d:*/",cur_val);
@@ -829,10 +826,10 @@
 break;
 
 /*:60*/
-#line 656 "ctangle.w"
+#line 650 "ctangle.w"
 
 /*56:*/
-#line 674 "ctangle.w"
+#line 668 "ctangle.w"
 
 case plus_plus:C_putc('+');C_putc('+');out_state= normal;break;
 case minus_minus:C_putc('-');C_putc('-');out_state= normal;break;
@@ -853,7 +850,7 @@
 break;
 
 /*:56*/
-#line 657 "ctangle.w"
+#line 651 "ctangle.w"
 
 case'=':case'>':C_putc(cur_char);C_putc(' ');
 out_state= normal;break;
@@ -872,7 +869,7 @@
 }
 
 /*:55*//*64:*/
-#line 803 "ctangle.w"
+#line 797 "ctangle.w"
 
 static eight_bits
 skip_ahead(void)
@@ -890,7 +887,7 @@
 }
 
 /*:64*//*67:*/
-#line 842 "ctangle.w"
+#line 836 "ctangle.w"
 
 static boolean skip_comment(
 boolean is_long_comment)
@@ -924,7 +921,7 @@
 }
 
 /*:67*//*69:*/
-#line 883 "ctangle.w"
+#line 877 "ctangle.w"
 
 static eight_bits
 get_next(void)
@@ -938,7 +935,7 @@
 else if(print_where&&!no_where){
 print_where= false;
 /*85:*/
-#line 1229 "ctangle.w"
+#line 1223 "ctangle.w"
 
 {
 eight_bits a;
@@ -955,7 +952,7 @@
 }
 
 /*:85*/
-#line 895 "ctangle.w"
+#line 889 "ctangle.w"
 
 }
 else return(eight_bits)'\n';
@@ -968,7 +965,7 @@
 }
 loc++;
 if(xisdigit(c)||c=='.')/*73:*/
-#line 967 "ctangle.w"
+#line 961 "ctangle.w"
 {
 boolean hex_flag= false;
 id_first= loc-1;
@@ -1002,13 +999,13 @@
 }
 
 /*:73*/
-#line 906 "ctangle.w"
+#line 900 "ctangle.w"
 
 else if(c=='\''||c=='"'
 ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"'))
 ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"')))
 /*74:*/
-#line 1004 "ctangle.w"
+#line 998 "ctangle.w"
 {
 char delim= (char)c;
 id_first= section_text+1;
@@ -1052,11 +1049,11 @@
 }
 
 /*:74*/
-#line 910 "ctangle.w"
+#line 904 "ctangle.w"
 
 else if(isalpha((int)c)||isxalpha(c)||ishigh(c))
 /*72:*/
-#line 958 "ctangle.w"
+#line 952 "ctangle.w"
 {
 id_first= --loc;
 do
@@ -1067,10 +1064,10 @@
 }
 
 /*:72*/
-#line 912 "ctangle.w"
+#line 906 "ctangle.w"
 
 else if(c=='@')/*75:*/
-#line 1049 "ctangle.w"
+#line 1043 "ctangle.w"
 
 switch(c= ccode[(eight_bits)*loc++]){
 case ignore:continue;
@@ -1085,11 +1082,11 @@
 case section_name:
 cur_section_name_char= *(loc-1);
 /*77:*/
-#line 1094 "ctangle.w"
+#line 1088 "ctangle.w"
 {
 char*k= section_text;
 /*79:*/
-#line 1116 "ctangle.w"
+#line 1110 "ctangle.w"
 
 while(true){
 if(loc> limit&&get_line()==false){
@@ -1099,7 +1096,7 @@
 }
 c= (eight_bits)*loc;
 /*80:*/
-#line 1139 "ctangle.w"
+#line 1133 "ctangle.w"
 
 if(c=='@'){
 c= (eight_bits)*(loc+1);
@@ -1118,7 +1115,7 @@
 }
 
 /*:80*/
-#line 1124 "ctangle.w"
+#line 1118 "ctangle.w"
 
 loc++;if(k<section_text_end)k++;
 if(xisspace(c)){
@@ -1135,7 +1132,7 @@
 if(*k==' '&&k> section_text)k--;
 
 /*:79*/
-#line 1096 "ctangle.w"
+#line 1090 "ctangle.w"
 
 if(k-section_text> 3&&strncmp(k-2,"...",3)==0)
 cur_section_name= section_lookup(section_text+1,k-3,true);
@@ -1144,7 +1141,7 @@
 
 if(cur_section_name_char=='(')
 /*47:*/
-#line 504 "ctangle.w"
+#line 498 "ctangle.w"
 
 {
 for(an_output_file= cur_out_file;
@@ -1158,16 +1155,16 @@
 }
 
 /*:47*/
-#line 1104 "ctangle.w"
+#line 1098 "ctangle.w"
 
 return section_name;
 }
 
 /*:77*/
-#line 1062 "ctangle.w"
+#line 1056 "ctangle.w"
 
 case string:/*81:*/
-#line 1161 "ctangle.w"
+#line 1155 "ctangle.w"
 
 id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
 while(*loc!='@'||*(loc+1)!='>')loc++;
@@ -1177,10 +1174,10 @@
 return string;
 
 /*:81*/
-#line 1063 "ctangle.w"
+#line 1057 "ctangle.w"
 
 case ord:/*76:*/
-#line 1074 "ctangle.w"
+#line 1068 "ctangle.w"
 
 id_first= loc;
 if(*loc=='\\')
@@ -1202,13 +1199,13 @@
 return ord;
 
 /*:76*/
-#line 1064 "ctangle.w"
+#line 1058 "ctangle.w"
 
 default:return c;
 }
 
 /*:75*/
-#line 913 "ctangle.w"
+#line 907 "ctangle.w"
 
 else if(xisspace(c)){
 if(!preprocessing||loc> limit)continue;
@@ -1218,7 +1215,7 @@
 }
 else if(c=='#'&&loc==buffer+1)preprocessing= true;
 mistake:/*71:*/
-#line 935 "ctangle.w"
+#line 929 "ctangle.w"
 
 switch(c){
 case'+':if(*loc=='+')compress(plus_plus);break;
@@ -1243,7 +1240,7 @@
 }
 
 /*:71*/
-#line 921 "ctangle.w"
+#line 915 "ctangle.w"
 
 return c;
 }
@@ -1250,7 +1247,7 @@
 }
 
 /*:69*//*83:*/
-#line 1197 "ctangle.w"
+#line 1191 "ctangle.w"
 
 static void
 scan_repl(
@@ -1258,7 +1255,7 @@
 {
 sixteen_bits a;
 if(t==section_name)/*85:*/
-#line 1229 "ctangle.w"
+#line 1223 "ctangle.w"
 
 {
 eight_bits a;
@@ -1275,11 +1272,11 @@
 }
 
 /*:85*/
-#line 1203 "ctangle.w"
+#line 1197 "ctangle.w"
 
 while(true)switch(a= get_next()){
 /*86:*/
-#line 1244 "ctangle.w"
+#line 1238 "ctangle.w"
 
 case identifier:store_id(a);
 if(*buffer=='#'&&(
@@ -1292,7 +1289,7 @@
 case section_name:if(t!=section_name)goto done;
 else{
 /*87:*/
-#line 1285 "ctangle.w"
+#line 1279 "ctangle.w"
 {
 char*try_loc= loc;
 while(*try_loc==' '&&try_loc<limit)try_loc++;
@@ -1305,13 +1302,13 @@
 }
 
 /*:87*/
-#line 1255 "ctangle.w"
+#line 1249 "ctangle.w"
 
 a= cur_section_name-name_dir;
 app_repl((a/0400)+0250);
 app_repl(a%0400);
 /*85:*/
-#line 1229 "ctangle.w"
+#line 1223 "ctangle.w"
 
 {
 eight_bits a;
@@ -1328,7 +1325,7 @@
 }
 
 /*:85*/
-#line 1259 "ctangle.w"
+#line 1253 "ctangle.w"
 
 }
 break;
@@ -1340,7 +1337,7 @@
 app_repl((a/0400)+0200);
 app_repl(a%0400);
 /*85:*/
-#line 1229 "ctangle.w"
+#line 1223 "ctangle.w"
 
 {
 eight_bits a;
@@ -1357,13 +1354,13 @@
 }
 
 /*:85*/
-#line 1269 "ctangle.w"
+#line 1263 "ctangle.w"
 
 }
 break;
 case constant:case string:
 /*88:*/
-#line 1302 "ctangle.w"
+#line 1296 "ctangle.w"
 
 app_repl(a);
 while(id_first<id_loc){
@@ -1379,12 +1376,12 @@
 app_repl(a);
 
 /*:88*/
-#line 1273 "ctangle.w"
+#line 1267 "ctangle.w"
 
 break;
 case ord:
 /*89:*/
-#line 1320 "ctangle.w"
+#line 1314 "ctangle.w"
 {
 int c= (int)((eight_bits)*id_first);
 if(c=='\\'){
@@ -1434,7 +1431,7 @@
 }
 
 /*:89*/
-#line 1276 "ctangle.w"
+#line 1270 "ctangle.w"
 
 break;
 case definition:case format_code:case begin_C:if(t!=section_name)goto done;
@@ -1445,7 +1442,7 @@
 case new_section:goto done;
 
 /*:86*/
-#line 1208 "ctangle.w"
+#line 1202 "ctangle.w"
 
 case')':app_repl(a);
 if(t==macro)app_repl(' ');
@@ -1458,7 +1455,7 @@
 }
 
 /*:83*//*90:*/
-#line 1378 "ctangle.w"
+#line 1372 "ctangle.w"
 
 static void
 scan_section(void)
@@ -1473,7 +1470,7 @@
 next_control= ignore;
 while(true){
 /*92:*/
-#line 1419 "ctangle.w"
+#line 1413 "ctangle.w"
 
 while(next_control<definition)
 
@@ -1482,11 +1479,11 @@
 }
 
 /*:92*/
-#line 1392 "ctangle.w"
+#line 1386 "ctangle.w"
 
 if(next_control==definition){
 /*93:*/
-#line 1426 "ctangle.w"
+#line 1420 "ctangle.w"
 
 while((next_control= get_next())=='\n');
 if(next_control!=identifier){
@@ -1502,7 +1499,7 @@
 cur_text->text_link= macro;
 
 /*:93*/
-#line 1394 "ctangle.w"
+#line 1388 "ctangle.w"
 
 continue;
 }
@@ -1512,7 +1509,7 @@
 if(next_control==section_name){
 p= cur_section_name;
 /*94:*/
-#line 1448 "ctangle.w"
+#line 1442 "ctangle.w"
 
 while((next_control= get_next())=='+');
 if(next_control!='='&&next_control!=eq_eq)
@@ -1519,7 +1516,7 @@
 continue;
 
 /*:94*/
-#line 1402 "ctangle.w"
+#line 1396 "ctangle.w"
 
 break;
 }
@@ -1527,20 +1524,20 @@
 }
 no_where= print_where= false;
 /*95:*/
-#line 1453 "ctangle.w"
+#line 1447 "ctangle.w"
 
 /*96:*/
-#line 1458 "ctangle.w"
+#line 1452 "ctangle.w"
 
 store_two_bytes((sixteen_bits)(0150000+section_count));
 
 
 /*:96*/
-#line 1454 "ctangle.w"
+#line 1448 "ctangle.w"
 
 scan_repl(section_name);
 /*97:*/
-#line 1462 "ctangle.w"
+#line 1456 "ctangle.w"
 
 if(p==name_dir||p==NULL){
 last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text;
@@ -1557,16 +1554,16 @@
 
 
 /*:97*/
-#line 1456 "ctangle.w"
+#line 1450 "ctangle.w"
 
 
 /*:95*/
-#line 1408 "ctangle.w"
+#line 1402 "ctangle.w"
 
 }
 
 /*:90*//*98:*/
-#line 1477 "ctangle.w"
+#line 1471 "ctangle.w"
 
 static void
 phase_one(void){
@@ -1579,7 +1576,7 @@
 }
 
 /*:98*//*100:*/
-#line 1493 "ctangle.w"
+#line 1487 "ctangle.w"
 
 static void
 skip_limbo(void)
@@ -1593,7 +1590,7 @@
 switch(ccode[(eight_bits)c]){
 case new_section:return;
 case translit_code:/*102:*/
-#line 1523 "ctangle.w"
+#line 1517 "ctangle.w"
 
 while(xisspace(*loc)&&loc<limit)loc++;
 loc+= 3;
@@ -1618,7 +1615,7 @@
 }
 
 /*:102*/
-#line 1505 "ctangle.w"
+#line 1499 "ctangle.w"
 break;
 case format_code:case'@':break;
 case control_text:if(c=='q'||c=='Q'){
@@ -1636,7 +1633,7 @@
 }
 
 /*:100*//*103:*/
-#line 1549 "ctangle.w"
+#line 1543 "ctangle.w"
 
 void
 print_stats(void){

Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.w	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.w	2023-07-13 15:11:14 UTC (rev 67618)
@@ -247,14 +247,11 @@
 
 @** Stacks for output.  The output process uses a stack to keep track
 of what is going on at different ``levels'' as the sections are being
-written out.  Entries on this stack have five parts:
+written out.  Entries on this stack have four parts:
 
-\yskip\hang |end_field| is the |tok_mem| location where the replacement
-text of a particular level will end;
+\yskip\hang |byte_field| is the |tok_mem| location from which the next
+token on a particular level will be read;
 
-\hang |byte_field| is the |tok_mem| location from which the next token
-on a particular level will be read;
-
 \hang |name_field| points to the name corresponding to a particular level;
 
 \hang |repl_field| points to the replacement text currently being read
@@ -262,10 +259,10 @@
 
 \hang |section_field| is the section number, or zero if this is a macro.
 
-\yskip\noindent The current values of these five quantities are referred to
-quite frequently, so they are stored in a separate place instead of in
-the |stack| array. We call the current values |cur_end|, |cur_byte|,
-|cur_name|, |cur_repl|, and |cur_section|.
+\yskip\noindent The current values of these four quantities are referred to
+quite frequently, so they are stored in an extra slot at the very end of the
+|stack| array.  We call the current values |cur_byte|, |cur_name|, |cur_repl|,
+and |cur_section|.
 
 The global variable |stack_ptr| tells how many levels of output are
 currently in progress. The end of all output occurs when the stack is
@@ -273,7 +270,6 @@
 
 @<Typed...@>=
 typedef struct {
-  eight_bits *end_field; /* ending location of replacement text */
   eight_bits *byte_field; /* present location within replacement text */
   name_pointer name_field; /* |byte_start| index for text being output */
   text_pointer repl_field; /* |tok_start| index for text being output */
@@ -282,16 +278,16 @@
 typedef output_state *stack_pointer;
 
 @ @d stack_size 50 /* number of simultaneous levels of macro expansion */
- at d cur_end cur_state.end_field /* current ending location in |tok_mem| */
+ at d cur_state stack[stack_size+1] /* |cur_byte|, |cur_name|, |cur_repl|,
+  and |cur_section| */
 @d cur_byte cur_state.byte_field /* location of next output byte in |tok_mem|*/
 @d cur_name cur_state.name_field /* pointer to current name being expanded */
 @d cur_repl cur_state.repl_field /* pointer to current replacement text */
 @d cur_section cur_state.section_field /* current section number being expanded */
+ at d cur_end (cur_repl+1)->tok_start /* current ending location in |tok_mem| */
 
 @<Private...@>=
-static output_state cur_state; /* |cur_end|, |cur_byte|, |cur_name|, |cur_repl|,
-  and |cur_section| */
-static output_state stack[stack_size+1]; /* info for non-current levels */
+static output_state stack[stack_size+2]; /* info for non-current levels */
 static stack_pointer stack_end=stack+stack_size; /* end of |stack| */
 static stack_pointer stack_ptr; /* first unused location in the output state stack */
 
@@ -303,7 +299,7 @@
 
 @<Initialize the output stacks@>=
 stack_ptr=stack+1; cur_name=name_dir; cur_repl=text_info->text_link+text_info;
-cur_byte=cur_repl->tok_start; cur_end=(cur_repl+1)->tok_start; cur_section=0;
+cur_byte=cur_repl->tok_start; cur_section=0;
 
 @ When the replacement text for name |p| is to be inserted into the output,
 the following subroutine is called to save the old level of output and get
@@ -322,8 +318,7 @@
   stack_ptr++;
   if (p!=NULL) { /* |p==NULL| means we are in |output_defs| */
     cur_name=p; cur_repl=(text_pointer)p->equiv;
-    cur_byte=cur_repl->tok_start; cur_end=(cur_repl+1)->tok_start;
-    cur_section=0;
+    cur_byte=cur_repl->tok_start; cur_section=0;
   }
 }
 
@@ -342,8 +337,7 @@
 {
   if (flag && cur_repl->text_link<section_flag) { /* link to a continuation */
     cur_repl=cur_repl->text_link+text_info; /* stay on the same level */
-    cur_byte=cur_repl->tok_start; cur_end=(cur_repl+1)->tok_start;
-    return;
+    cur_byte=cur_repl->tok_start; return;
   }
   stack_ptr--; /* go down to the previous level */
   if (stack_ptr>stack) cur_state=*stack_ptr;
@@ -574,7 +568,6 @@
     cur_name=*an_output_file;
     cur_repl=(text_pointer)cur_name->equiv;
     cur_byte=cur_repl->tok_start;
-    cur_end=(cur_repl+1)->tok_start;
     while (stack_ptr > stack) get_output();
     flush_buffer();
 }
@@ -596,6 +589,8 @@
 
 @ @d C_printf(c,a) fprintf(C_file,c,a)
 @d C_putc(c) putc((int)(c),C_file) /* isn't \CEE/ wonderfully consistent? */
+@#
+ at d macro_end (cur_text+1)->tok_start /* end of |macro| replacement text */
 
 @c
 static void
@@ -606,13 +601,12 @@
   for (cur_text=text_info+1; cur_text<text_ptr; cur_text++)
     if (cur_text->text_link==macro) { /* |cur_text| is the text for a |macro| */
       cur_byte=cur_text->tok_start;
-      cur_end=(cur_text+1)->tok_start;
       C_printf("%s","#define ");
       out_state=normal;
       protect=true; /* newlines should be preceded by |'\\'| */
-      while (cur_byte<cur_end) {
+      while (cur_byte<macro_end) {
         a=*cur_byte++;
-        if (cur_byte==cur_end && a=='\n') break; /* disregard a final newline */
+        if (cur_byte==macro_end && a=='\n') break; /* disregard a final newline */
         if (out_state==verbatim && a!=string && a!=constant && a!='\n')
           C_putc(a); /* a high-bit character can occur in a string */
 @^high-bit character handling@>

Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w	2023-07-12 23:43:23 UTC (rev 67617)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w	2023-07-13 15:11:14 UTC (rev 67618)
@@ -3754,8 +3754,8 @@
 \yskip\hang |mode_field| is the current mode, either |inner| or |outer|.
 
 \yskip\noindent The current values of these quantities are referred to
-quite frequently, so they are stored in a separate place instead of in the
-|stack| array. We call the current values |cur_end|, |cur_tok|, and
+quite frequently, so they are stored in an extra slot at the very end of
+the |stack| array.  We call the current values |cur_end|, |cur_tok|, and
 |cur_mode|.
 
 The global variable |stack_ptr| tells how many levels of output are
@@ -3763,10 +3763,10 @@
 token is found, so the stack is never empty except when we first begin the
 output process.
 
- at d inner false /* value of |mode| for \CEE/ texts within \TEX/ texts */
- at d outer true /* value of |mode| for \CEE/ texts in sections */
+ at d inner false /* mode value for \CEE/ texts within \TEX/ texts */
+ at d outer true /* mode value for \CEE/ texts in sections */
 
-@<Typed...@>= typedef int mode;
+@<Typed...@>=
 typedef struct {
   token_pointer end_field; /* ending location of token list */
   token_pointer tok_field; /* present location within token list */
@@ -3775,6 +3775,7 @@
 typedef output_state *stack_pointer;
 
 @ @d stack_size 2000 /* number of simultaneous output levels */
+ at d cur_state stack[stack_size] /* |cur_end|, |cur_tok|, |cur_mode| */
 @d cur_end cur_state.end_field /* current ending location in |tok_mem| */
 @d cur_tok cur_state.tok_field /* location of next output token in |tok_mem| */
 @d cur_mode cur_state.mode_field /* current mode of interpretation */
@@ -3781,8 +3782,7 @@
 @d init_stack stack_ptr=stack;cur_mode=outer /* initialize the stack */
 
 @<Private...@>=
-static output_state cur_state; /* |cur_end|, |cur_tok|, |cur_mode| */
-static output_state stack[stack_size]; /* info for non-current levels */
+static output_state stack[stack_size+1]; /* info for non-current levels */
 static stack_pointer stack_end=stack+stack_size-1; /* end of |stack| */
 static stack_pointer stack_ptr; /* first unused location in the output state stack */
 static stack_pointer max_stack_ptr; /* largest value assumed by |stack_ptr| */



More information about the tex-live-commits mailing list.