texlive[62066] Build/source/texk/web2c: [CWEB] Avoid preprocessor

commits+ascherer at tug.org commits+ascherer at tug.org
Fri Feb 18 16:05:01 CET 2022


Revision: 62066
          http://tug.org/svn/texlive?view=revision&revision=62066
Author:   ascherer
Date:     2022-02-18 16:05:01 +0100 (Fri, 18 Feb 2022)
Log Message:
-----------
[CWEB] Avoid preprocessor calamities.

Trying to fix all loopholes in weird stuff like
https://github.com/ascherer/cweb/blob/cweb-4.8-dev/if.w
by repeating '#line' directives after all '#elif', '#else',
and '#endif' preprocessor statements. In almost all cases
this information is redundant, but in the past years people
have come up with the idea to jump to '@<code sections@>'
in '#if' blocks.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/ctangleboot.cin
    trunk/Build/source/texk/web2c/cwebboot.cin
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/common.c
    trunk/Build/source/texk/web2c/cwebdir/ctangle.c
    trunk/Build/source/texk/web2c/cwebdir/ctangle.w

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/ChangeLog	2022-02-18 15:05:01 UTC (rev 62066)
@@ -1,3 +1,8 @@
+2022-02-18  Andreas Scherer  <https://ascherer.github.io>
+
+	* cwebboot.cin,
+	* ctangleboot.bin: Add '#line' after '#elif', '#else', and '#endif'.
+
 2022-02-15  Andreas Scherer  <https://ascherer.github.io>
 
 	* cwebboot.cin,

Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin	2022-02-18 15:05:01 UTC (rev 62066)
@@ -15,17 +15,16 @@
 #ifndef HAVE_GETTEXT
 #define HAVE_GETTEXT 0
 #endif
-#line 65 "cwebdir/comm-w2c.h"
+#line 66 "cwebdir/comm-w2c.h"
 
-
 #if HAVE_GETTEXT
 #include <libintl.h> 
 #else
+#line 70 "cwebdir/comm-w2c.h"
 #define gettext(a) a
 #endif
-#line 71 "cwebdir/comm-w2c.h"
+#line 72 "cwebdir/comm-w2c.h"
 
-
 /*:4*/
 #line 67 "cwebdir/ctangle.w"
 
@@ -463,15 +462,15 @@
 static void scan_repl(eight_bits);
 
 /*:84*//*91:*/
-#line 1408 "cwebdir/ctangle.w"
+#line 1413 "cwebdir/ctangle.w"
 static void scan_section(void);
 
 /*:91*//*99:*/
-#line 1485 "cwebdir/ctangle.w"
+#line 1490 "cwebdir/ctangle.w"
 static void phase_one(void);
 
 /*:99*//*101:*/
-#line 1518 "cwebdir/ctangle.w"
+#line 1523 "cwebdir/ctangle.w"
 static void skip_limbo(void);
 
 /*:101*/
@@ -1600,33 +1599,19 @@
 #line 1244 "cwebdir/ctangle.w"
 
 case identifier:store_id(a);
-if(*buffer=='#'&&id_first==buffer+1&&id_loc-id_first==5
-&&strncmp("endif",id_first,5)==0)
-/*85:*/
-#line 1229 "cwebdir/ctangle.w"
-
-{
-eight_bits a;
-store_two_bytes(0150000);
-if(changing&&include_depth==change_depth){
-id_first= change_file_name;
-store_two_bytes((sixteen_bits)change_line);
-}else{
-id_first= cur_file_name;
-store_two_bytes((sixteen_bits)cur_line);
-}
-id_loc= id_first+strlen(id_first);
-store_id(a);
-}
-
-/*:85*/
-#line 1248 "cwebdir/ctangle.w"
-
+if(*buffer=='#'&&(
+(id_first==buffer+1&&id_loc-id_first==5
+&&strncmp("endif",id_first,5)==0)||
+(id_first==buffer+1&&id_loc-id_first==4
+&&strncmp("else",id_first,4)==0)||
+(id_first==buffer+1&&id_loc-id_first==4
+&&strncmp("elif",id_first,4)==0)))
+print_where= true;
 break;
 case section_name:if(t!=section_name)goto done;
 else{
 /*87:*/
-#line 1282 "cwebdir/ctangle.w"
+#line 1287 "cwebdir/ctangle.w"
 {
 char*try_loc= loc;
 while(*try_loc==' '&&try_loc<limit)try_loc++;
@@ -1634,7 +1619,7 @@
 while(*try_loc==' '&&try_loc<limit)try_loc++;
 #line 294 "cwebdir/ctang-w2c.ch"
 if(*try_loc=='=')err_print(_("! Missing `@ ' before a named section"));
-#line 1288 "cwebdir/ctangle.w"
+#line 1293 "cwebdir/ctangle.w"
 
 
 
@@ -1641,7 +1626,7 @@
 }
 
 /*:87*/
-#line 1252 "cwebdir/ctangle.w"
+#line 1257 "cwebdir/ctangle.w"
 
 a= cur_section_name-name_dir;
 app_repl((a/0400)+0250);
@@ -1664,13 +1649,13 @@
 }
 
 /*:85*/
-#line 1256 "cwebdir/ctangle.w"
+#line 1261 "cwebdir/ctangle.w"
 
 }
 break;
 #line 282 "cwebdir/ctang-w2c.ch"
 case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h"));
-#line 1260 "cwebdir/ctangle.w"
+#line 1265 "cwebdir/ctangle.w"
 
 else{
 output_defs_seen= true;
@@ -1695,13 +1680,13 @@
 }
 
 /*:85*/
-#line 1266 "cwebdir/ctangle.w"
+#line 1271 "cwebdir/ctangle.w"
 
 }
 break;
 case constant:case string:
 /*88:*/
-#line 1299 "cwebdir/ctangle.w"
+#line 1304 "cwebdir/ctangle.w"
 
 app_repl(a);
 while(id_first<id_loc){
@@ -1709,7 +1694,7 @@
 if(*(id_first+1)=='@')id_first++;
 #line 300 "cwebdir/ctang-w2c.ch"
 else err_print(_("! Double @ should be used in string"));
-#line 1305 "cwebdir/ctangle.w"
+#line 1310 "cwebdir/ctangle.w"
 
 }
 else if(a==constant&&*id_first=='\''&&!keep_digit_separators)
@@ -1719,12 +1704,12 @@
 app_repl(a);
 
 /*:88*/
-#line 1270 "cwebdir/ctangle.w"
+#line 1275 "cwebdir/ctangle.w"
 
 break;
 case ord:
 /*89:*/
-#line 1317 "cwebdir/ctangle.w"
+#line 1322 "cwebdir/ctangle.w"
 {
 int c= (int)((eight_bits)*id_first);
 if(c=='\\'){
@@ -1763,7 +1748,7 @@
 case'\"':c= '\"';break;
 #line 306 "cwebdir/ctang-w2c.ch"
 default:err_print(_("! Unrecognized escape sequence"));
-#line 1354 "cwebdir/ctangle.w"
+#line 1359 "cwebdir/ctangle.w"
 
 }
 }
@@ -1776,7 +1761,7 @@
 }
 
 /*:89*/
-#line 1273 "cwebdir/ctangle.w"
+#line 1278 "cwebdir/ctangle.w"
 
 break;
 case definition:case format_code:case begin_C:if(t!=section_name)goto done;
@@ -1783,7 +1768,7 @@
 else{
 #line 288 "cwebdir/ctang-w2c.ch"
 err_print(_("! @d, @f and @c are ignored in C text"));continue;
-#line 1278 "cwebdir/ctangle.w"
+#line 1283 "cwebdir/ctangle.w"
 
 }
 case new_section:goto done;
@@ -1804,7 +1789,7 @@
 }
 
 /*:83*//*90:*/
-#line 1375 "cwebdir/ctangle.w"
+#line 1380 "cwebdir/ctangle.w"
 
 static void
 scan_section(void)
@@ -1819,7 +1804,7 @@
 next_control= ignore;
 while(true){
 /*92:*/
-#line 1416 "cwebdir/ctangle.w"
+#line 1421 "cwebdir/ctangle.w"
 
 while(next_control<definition)
 
@@ -1828,17 +1813,17 @@
 }
 
 /*:92*/
-#line 1389 "cwebdir/ctangle.w"
+#line 1394 "cwebdir/ctangle.w"
 
 if(next_control==definition){
 /*93:*/
-#line 1423 "cwebdir/ctangle.w"
+#line 1428 "cwebdir/ctangle.w"
 
 while((next_control= get_next())=='\n');
 if(next_control!=identifier){
 #line 312 "cwebdir/ctang-w2c.ch"
 err_print(_("! Definition flushed, must start with identifier"));
-#line 1427 "cwebdir/ctangle.w"
+#line 1432 "cwebdir/ctangle.w"
 
 continue;
 }
@@ -1850,7 +1835,7 @@
 cur_text->text_link= macro;
 
 /*:93*/
-#line 1391 "cwebdir/ctangle.w"
+#line 1396 "cwebdir/ctangle.w"
 
 continue;
 }
@@ -1860,7 +1845,7 @@
 if(next_control==section_name){
 p= cur_section_name;
 /*94:*/
-#line 1445 "cwebdir/ctangle.w"
+#line 1450 "cwebdir/ctangle.w"
 
 while((next_control= get_next())=='+');
 if(next_control!='='&&next_control!=eq_eq)
@@ -1867,7 +1852,7 @@
 continue;
 
 /*:94*/
-#line 1399 "cwebdir/ctangle.w"
+#line 1404 "cwebdir/ctangle.w"
 
 break;
 }
@@ -1875,20 +1860,20 @@
 }
 no_where= print_where= false;
 /*95:*/
-#line 1450 "cwebdir/ctangle.w"
+#line 1455 "cwebdir/ctangle.w"
 
 /*96:*/
-#line 1455 "cwebdir/ctangle.w"
+#line 1460 "cwebdir/ctangle.w"
 
 store_two_bytes((sixteen_bits)(0150000+section_count));
 
 
 /*:96*/
-#line 1451 "cwebdir/ctangle.w"
+#line 1456 "cwebdir/ctangle.w"
 
 scan_repl(section_name);
 /*97:*/
-#line 1459 "cwebdir/ctangle.w"
+#line 1464 "cwebdir/ctangle.w"
 
 if(p==name_dir||p==NULL){
 last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text;
@@ -1905,16 +1890,16 @@
 
 
 /*:97*/
-#line 1453 "cwebdir/ctangle.w"
+#line 1458 "cwebdir/ctangle.w"
 
 
 /*:95*/
-#line 1405 "cwebdir/ctangle.w"
+#line 1410 "cwebdir/ctangle.w"
 
 }
 
 /*:90*//*98:*/
-#line 1474 "cwebdir/ctangle.w"
+#line 1479 "cwebdir/ctangle.w"
 
 static void
 phase_one(void){
@@ -1927,7 +1912,7 @@
 }
 
 /*:98*//*100:*/
-#line 1490 "cwebdir/ctangle.w"
+#line 1495 "cwebdir/ctangle.w"
 
 static void
 skip_limbo(void)
@@ -1941,7 +1926,7 @@
 switch(ccode[(eight_bits)c]){
 case new_section:return;
 case translit_code:/*102:*/
-#line 1520 "cwebdir/ctangle.w"
+#line 1525 "cwebdir/ctangle.w"
 
 while(xisspace(*loc)&&loc<limit)loc++;
 loc+= 3;
@@ -1949,7 +1934,7 @@
 ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
 #line 330 "cwebdir/ctang-w2c.ch"
 err_print(_("! Improper hex number following @l"));
-#line 1526 "cwebdir/ctangle.w"
+#line 1531 "cwebdir/ctangle.w"
 
 else{
 unsigned int i;
@@ -1961,7 +1946,7 @@
 if(loc-beg>=translit_length)
 #line 336 "cwebdir/ctang-w2c.ch"
 err_print(_("! Replacement string in @l too long"));
-#line 1536 "cwebdir/ctangle.w"
+#line 1541 "cwebdir/ctangle.w"
 
 else{
 strncpy(translit[i-0200],beg,(size_t)(loc-beg));
@@ -1970,7 +1955,7 @@
 }
 
 /*:102*/
-#line 1502 "cwebdir/ctangle.w"
+#line 1507 "cwebdir/ctangle.w"
 break;
 case format_code:case'@':break;
 case control_text:if(c=='q'||c=='Q'){
@@ -1978,13 +1963,13 @@
 if(*(loc-1)!='>')
 #line 318 "cwebdir/ctang-w2c.ch"
 err_print(_("! Double @ should be used in control text"));
-#line 1508 "cwebdir/ctangle.w"
+#line 1513 "cwebdir/ctangle.w"
 
 break;
 }
 #line 324 "cwebdir/ctang-w2c.ch"
 default:err_print(_("! Double @ should be used in limbo"));
-#line 1512 "cwebdir/ctangle.w"
+#line 1517 "cwebdir/ctangle.w"
 
 }
 }
@@ -1992,7 +1977,7 @@
 }
 
 /*:100*//*103:*/
-#line 1546 "cwebdir/ctangle.w"
+#line 1551 "cwebdir/ctangle.w"
 
 void
 print_stats(void){
@@ -2005,7 +1990,7 @@
 printf(_("%td bytes (out of %ld)\n"),
 (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes);
 printf(_("%td tokens (out of %ld)\n"),
-#line 1557 "cwebdir/ctangle.w"
+#line 1562 "cwebdir/ctangle.w"
 (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks);
 }
 

Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/cwebboot.cin	2022-02-18 15:05:01 UTC (rev 62066)
@@ -15,17 +15,16 @@
 #ifndef HAVE_GETTEXT
 #define HAVE_GETTEXT 0
 #endif
-#line 65 "cwebdir/comm-w2c.h"
+#line 66 "cwebdir/comm-w2c.h"
 
-
 #if HAVE_GETTEXT
 #include <libintl.h> 
 #else
+#line 70 "cwebdir/comm-w2c.h"
 #define gettext(a) a
 #endif
-#line 71 "cwebdir/comm-w2c.h"
+#line 72 "cwebdir/comm-w2c.h"
 
-
 /*:3*//*91:*/
 #line 739 "cwebdir/comm-w2c.ch"
 
@@ -32,13 +31,13 @@
 #if HAVE_GETTEXT
 #include <locale.h>  
 #else
+#line 743 "cwebdir/comm-w2c.ch"
 #define setlocale(a,b) ""
 #define bindtextdomain(a,b) ""
 #define textdomain(a) ""
 #endif
-#line 746 "cwebdir/comm-w2c.ch"
+#line 747 "cwebdir/comm-w2c.ch"
 
-
 /*:91*//*93:*/
 #line 786 "cwebdir/comm-w2c.ch"
 
@@ -414,10 +413,9 @@
 #ifndef SEPARATORS
 #define SEPARATORS "://"
 #endif
-#line 647 "cwebdir/comm-w2c.ch"
+#line 648 "cwebdir/comm-w2c.ch"
+ char separators[]= SEPARATORS;
 
-char separators[]= SEPARATORS;
-
 /*:87*/
 #line 66 "cwebdir/common.w"
 
@@ -1424,14 +1422,14 @@
 strncpy(change_file_name,DEV_NULL,max_file_name_length-2);
 change_file_name[max_file_name_length-2]= '\0';
 #elif defined _DEV_NULL
-strncpy(change_file_name,_DEV_NULL,max_file_name_length-2);
+#line 482 "cwebdir/comm-w2c.ch"
+ strncpy(change_file_name,_DEV_NULL,max_file_name_length-2);
 change_file_name[max_file_name_length-2]= '\0';
 #endif
-#line 484 "cwebdir/comm-w2c.ch"
+#line 485 "cwebdir/comm-w2c.ch"
 
-
 #line 1168 "cwebdir/common.w"
-while(--argc> 0){
+ while(--argc> 0){
 if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
 #line 1247 "cwebdir/common.w"
 

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2022-02-18 15:05:01 UTC (rev 62066)
@@ -1,3 +1,9 @@
+2022-02-18  Andreas Scherer  <https://ascherer.github.io>
+
+	* common.c,
+	* ctangle.c,
+	* ctangle.w: Add '#line' after '#elif', '#else', and '#endif'.
+
 2022-02-14  Andreas Scherer  <https://ascherer.github.io>
 
 	* cwebmac.tex,

Modified: trunk/Build/source/texk/web2c/cwebdir/common.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.c	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/cwebdir/common.c	2022-02-18 15:05:01 UTC (rev 62066)
@@ -732,10 +732,10 @@
 if((l= strlen(CWEBINPUTS))> max_file_name_length-2)too_long();
 strcpy(temp_file_name,CWEBINPUTS);
 #else
-l= 0;
-#endif
-#line 475 "common.w"
- 
+#line 474 "common.w"
+ l= 0;
+#endif 
+#line 476 "common.w"
 }
 if(l> 0){
 if(k+l+2>=cur_file_name_end)too_long();

Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.c	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.c	2022-02-18 15:05:01 UTC (rev 62066)
@@ -434,15 +434,15 @@
 static void scan_repl(eight_bits);
 
 /*:84*//*91:*/
-#line 1408 "ctangle.w"
+#line 1413 "ctangle.w"
 static void scan_section(void);
 
 /*:91*//*99:*/
-#line 1485 "ctangle.w"
+#line 1490 "ctangle.w"
 static void phase_one(void);
 
 /*:99*//*101:*/
-#line 1518 "ctangle.w"
+#line 1523 "ctangle.w"
 static void skip_limbo(void);
 
 /*:101*/
@@ -1282,33 +1282,19 @@
 #line 1244 "ctangle.w"
 
 case identifier:store_id(a);
-if(*buffer=='#'&&id_first==buffer+1&&id_loc-id_first==5
-&&strncmp("endif",id_first,5)==0)
-/*85:*/
-#line 1229 "ctangle.w"
-
-{
-eight_bits a;
-store_two_bytes(0150000);
-if(changing&&include_depth==change_depth){
-id_first= change_file_name;
-store_two_bytes((sixteen_bits)change_line);
-}else{
-id_first= cur_file_name;
-store_two_bytes((sixteen_bits)cur_line);
-}
-id_loc= id_first+strlen(id_first);
-store_id(a);
-}
-
-/*:85*/
-#line 1248 "ctangle.w"
-
+if(*buffer=='#'&&(
+(id_first==buffer+1&&id_loc-id_first==5
+&&strncmp("endif",id_first,5)==0)||
+(id_first==buffer+1&&id_loc-id_first==4
+&&strncmp("else",id_first,4)==0)||
+(id_first==buffer+1&&id_loc-id_first==4
+&&strncmp("elif",id_first,4)==0)))
+print_where= true;
 break;
 case section_name:if(t!=section_name)goto done;
 else{
 /*87:*/
-#line 1282 "ctangle.w"
+#line 1287 "ctangle.w"
 {
 char*try_loc= loc;
 while(*try_loc==' '&&try_loc<limit)try_loc++;
@@ -1321,7 +1307,7 @@
 }
 
 /*:87*/
-#line 1252 "ctangle.w"
+#line 1257 "ctangle.w"
 
 a= cur_section_name-name_dir;
 app_repl((a/0400)+0250);
@@ -1344,7 +1330,7 @@
 }
 
 /*:85*/
-#line 1256 "ctangle.w"
+#line 1261 "ctangle.w"
 
 }
 break;
@@ -1373,13 +1359,13 @@
 }
 
 /*:85*/
-#line 1266 "ctangle.w"
+#line 1271 "ctangle.w"
 
 }
 break;
 case constant:case string:
 /*88:*/
-#line 1299 "ctangle.w"
+#line 1304 "ctangle.w"
 
 app_repl(a);
 while(id_first<id_loc){
@@ -1395,12 +1381,12 @@
 app_repl(a);
 
 /*:88*/
-#line 1270 "ctangle.w"
+#line 1275 "ctangle.w"
 
 break;
 case ord:
 /*89:*/
-#line 1317 "ctangle.w"
+#line 1322 "ctangle.w"
 {
 int c= (int)((eight_bits)*id_first);
 if(c=='\\'){
@@ -1450,7 +1436,7 @@
 }
 
 /*:89*/
-#line 1273 "ctangle.w"
+#line 1278 "ctangle.w"
 
 break;
 case definition:case format_code:case begin_C:if(t!=section_name)goto done;
@@ -1474,7 +1460,7 @@
 }
 
 /*:83*//*90:*/
-#line 1375 "ctangle.w"
+#line 1380 "ctangle.w"
 
 static void
 scan_section(void)
@@ -1489,7 +1475,7 @@
 next_control= ignore;
 while(true){
 /*92:*/
-#line 1416 "ctangle.w"
+#line 1421 "ctangle.w"
 
 while(next_control<definition)
 
@@ -1498,11 +1484,11 @@
 }
 
 /*:92*/
-#line 1389 "ctangle.w"
+#line 1394 "ctangle.w"
 
 if(next_control==definition){
 /*93:*/
-#line 1423 "ctangle.w"
+#line 1428 "ctangle.w"
 
 while((next_control= get_next())=='\n');
 if(next_control!=identifier){
@@ -1518,7 +1504,7 @@
 cur_text->text_link= macro;
 
 /*:93*/
-#line 1391 "ctangle.w"
+#line 1396 "ctangle.w"
 
 continue;
 }
@@ -1528,7 +1514,7 @@
 if(next_control==section_name){
 p= cur_section_name;
 /*94:*/
-#line 1445 "ctangle.w"
+#line 1450 "ctangle.w"
 
 while((next_control= get_next())=='+');
 if(next_control!='='&&next_control!=eq_eq)
@@ -1535,7 +1521,7 @@
 continue;
 
 /*:94*/
-#line 1399 "ctangle.w"
+#line 1404 "ctangle.w"
 
 break;
 }
@@ -1543,20 +1529,20 @@
 }
 no_where= print_where= false;
 /*95:*/
-#line 1450 "ctangle.w"
+#line 1455 "ctangle.w"
 
 /*96:*/
-#line 1455 "ctangle.w"
+#line 1460 "ctangle.w"
 
 store_two_bytes((sixteen_bits)(0150000+section_count));
 
 
 /*:96*/
-#line 1451 "ctangle.w"
+#line 1456 "ctangle.w"
 
 scan_repl(section_name);
 /*97:*/
-#line 1459 "ctangle.w"
+#line 1464 "ctangle.w"
 
 if(p==name_dir||p==NULL){
 last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text;
@@ -1573,16 +1559,16 @@
 
 
 /*:97*/
-#line 1453 "ctangle.w"
+#line 1458 "ctangle.w"
 
 
 /*:95*/
-#line 1405 "ctangle.w"
+#line 1410 "ctangle.w"
 
 }
 
 /*:90*//*98:*/
-#line 1474 "ctangle.w"
+#line 1479 "ctangle.w"
 
 static void
 phase_one(void){
@@ -1595,7 +1581,7 @@
 }
 
 /*:98*//*100:*/
-#line 1490 "ctangle.w"
+#line 1495 "ctangle.w"
 
 static void
 skip_limbo(void)
@@ -1609,7 +1595,7 @@
 switch(ccode[(eight_bits)c]){
 case new_section:return;
 case translit_code:/*102:*/
-#line 1520 "ctangle.w"
+#line 1525 "ctangle.w"
 
 while(xisspace(*loc)&&loc<limit)loc++;
 loc+= 3;
@@ -1634,7 +1620,7 @@
 }
 
 /*:102*/
-#line 1502 "ctangle.w"
+#line 1507 "ctangle.w"
 break;
 case format_code:case'@':break;
 case control_text:if(c=='q'||c=='Q'){
@@ -1652,7 +1638,7 @@
 }
 
 /*:100*//*103:*/
-#line 1546 "ctangle.w"
+#line 1551 "ctangle.w"
 
 void
 print_stats(void){

Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.w	2022-02-18 00:51:14 UTC (rev 62065)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.w	2022-02-18 15:05:01 UTC (rev 62066)
@@ -1243,9 +1243,14 @@
 
 @ @<In cases that |a| is...@>=@t\1\quad@>
 case identifier: store_id(a);
-  if (*buffer=='#' && id_first==buffer+1 && id_loc-id_first==5
-      && strncmp("endif",id_first,5)==0)
-    @<Insert the line number into |tok_mem|@>@;
+  if (*buffer=='#' && @| (
+      ( id_first==buffer+1 && id_loc-id_first==5
+        && strncmp("endif",id_first,5)==0 ) || @|
+      ( id_first==buffer+1 && id_loc-id_first==4
+        && strncmp("else",id_first,4)==0 ) || @|
+      ( id_first==buffer+1 && id_loc-id_first==4
+        && strncmp("elif",id_first,4)==0 ) ) )
+    print_where=true; /* Avoid preprocessor calamities */
   break;
 case section_name: if (t!=section_name) goto done;
   else {



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