diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2022-02-18 21:24:59 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2022-02-18 21:24:59 +0000 |
commit | 23f4a12f69a5da74c8c6ca06c50b791266c92111 (patch) | |
tree | 2dd9fe4e9ee567489d5e245470433fe0d7773792 /Build/source | |
parent | 83e022f21372458ca684d6b11734fd62dc26355a (diff) |
[CWEB] Remove redundancy.
git-svn-id: svn://tug.org/texlive/trunk@62068 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/web2c/ctangleboot.cin | 92 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.c | 70 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.w | 14 |
3 files changed, 85 insertions, 91 deletions
diff --git a/Build/source/texk/web2c/ctangleboot.cin b/Build/source/texk/web2c/ctangleboot.cin index 83b438ce35f..c835052d64a 100644 --- a/Build/source/texk/web2c/ctangleboot.cin +++ b/Build/source/texk/web2c/ctangleboot.cin @@ -462,15 +462,15 @@ static eight_bits get_next(void); static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1413 "cwebdir/ctangle.w" +#line 1411 "cwebdir/ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1490 "cwebdir/ctangle.w" +#line 1488 "cwebdir/ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1523 "cwebdir/ctangle.w" +#line 1521 "cwebdir/ctangle.w" static void skip_limbo(void); /*:101*/ @@ -1599,19 +1599,17 @@ while(true)switch(a= get_next()){ #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)|| -(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))) +if(*buffer=='#'&&id_first==buffer+1&&( +(id_loc-id_first==5&&strncmp("endif",id_first,5)==0)|| +(id_loc-id_first==4&&strncmp("else",id_first,4)==0)|| +(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 1287 "cwebdir/ctangle.w" +#line 1285 "cwebdir/ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1619,14 +1617,14 @@ if(*try_loc=='+'&&try_loc<limit)try_loc++; 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 1293 "cwebdir/ctangle.w" +#line 1291 "cwebdir/ctangle.w" } /*:87*/ -#line 1257 "cwebdir/ctangle.w" +#line 1255 "cwebdir/ctangle.w" a= cur_section_name-name_dir; app_repl((a/0400)+0250); @@ -1649,13 +1647,13 @@ store_id(a); } /*:85*/ -#line 1261 "cwebdir/ctangle.w" +#line 1259 "cwebdir/ctangle.w" } break; #line 282 "cwebdir/ctang-w2c.ch" case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h")); -#line 1265 "cwebdir/ctangle.w" +#line 1263 "cwebdir/ctangle.w" else{ output_defs_seen= true; @@ -1680,13 +1678,13 @@ store_id(a); } /*:85*/ -#line 1271 "cwebdir/ctangle.w" +#line 1269 "cwebdir/ctangle.w" } break; case constant:case string: /*88:*/ -#line 1304 "cwebdir/ctangle.w" +#line 1302 "cwebdir/ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1694,7 +1692,7 @@ if(*id_first=='@'){ if(*(id_first+1)=='@')id_first++; #line 300 "cwebdir/ctang-w2c.ch" else err_print(_("! Double @ should be used in string")); -#line 1310 "cwebdir/ctangle.w" +#line 1308 "cwebdir/ctangle.w" } else if(a==constant&&*id_first=='\''&&!keep_digit_separators) @@ -1704,12 +1702,12 @@ app_repl(*id_first++); app_repl(a); /*:88*/ -#line 1275 "cwebdir/ctangle.w" +#line 1273 "cwebdir/ctangle.w" break; case ord: /*89:*/ -#line 1322 "cwebdir/ctangle.w" +#line 1320 "cwebdir/ctangle.w" { int c= (int)((eight_bits)*id_first); if(c=='\\'){ @@ -1748,7 +1746,7 @@ case'\'':c= '\'';break; case'\"':c= '\"';break; #line 306 "cwebdir/ctang-w2c.ch" default:err_print(_("! Unrecognized escape sequence")); -#line 1359 "cwebdir/ctangle.w" +#line 1357 "cwebdir/ctangle.w" } } @@ -1761,14 +1759,14 @@ app_repl(constant); } /*:89*/ -#line 1278 "cwebdir/ctangle.w" +#line 1276 "cwebdir/ctangle.w" break; case definition:case format_code:case begin_C:if(t!=section_name)goto done; else{ #line 288 "cwebdir/ctang-w2c.ch" err_print(_("! @d, @f and @c are ignored in C text"));continue; -#line 1283 "cwebdir/ctangle.w" +#line 1281 "cwebdir/ctangle.w" } case new_section:goto done; @@ -1789,7 +1787,7 @@ cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:83*//*90:*/ -#line 1380 "cwebdir/ctangle.w" +#line 1378 "cwebdir/ctangle.w" static void scan_section(void) @@ -1804,7 +1802,7 @@ printf("*%d",(int)section_count);update_terminal; next_control= ignore; while(true){ /*92:*/ -#line 1421 "cwebdir/ctangle.w" +#line 1419 "cwebdir/ctangle.w" while(next_control<definition) @@ -1813,17 +1811,17 @@ loc-= 2;next_control= get_next(); } /*:92*/ -#line 1394 "cwebdir/ctangle.w" +#line 1392 "cwebdir/ctangle.w" if(next_control==definition){ /*93:*/ -#line 1428 "cwebdir/ctangle.w" +#line 1426 "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 1432 "cwebdir/ctangle.w" +#line 1430 "cwebdir/ctangle.w" continue; } @@ -1835,7 +1833,7 @@ scan_repl(macro); cur_text->text_link= macro; /*:93*/ -#line 1396 "cwebdir/ctangle.w" +#line 1394 "cwebdir/ctangle.w" continue; } @@ -1845,14 +1843,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1450 "cwebdir/ctangle.w" +#line 1448 "cwebdir/ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1404 "cwebdir/ctangle.w" +#line 1402 "cwebdir/ctangle.w" break; } @@ -1860,20 +1858,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1455 "cwebdir/ctangle.w" +#line 1453 "cwebdir/ctangle.w" /*96:*/ -#line 1460 "cwebdir/ctangle.w" +#line 1458 "cwebdir/ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1456 "cwebdir/ctangle.w" +#line 1454 "cwebdir/ctangle.w" scan_repl(section_name); /*97:*/ -#line 1464 "cwebdir/ctangle.w" +#line 1462 "cwebdir/ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1890,16 +1888,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1458 "cwebdir/ctangle.w" +#line 1456 "cwebdir/ctangle.w" /*:95*/ -#line 1410 "cwebdir/ctangle.w" +#line 1408 "cwebdir/ctangle.w" } /*:90*//*98:*/ -#line 1479 "cwebdir/ctangle.w" +#line 1477 "cwebdir/ctangle.w" static void phase_one(void){ @@ -1912,7 +1910,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1495 "cwebdir/ctangle.w" +#line 1493 "cwebdir/ctangle.w" static void skip_limbo(void) @@ -1926,7 +1924,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1525 "cwebdir/ctangle.w" +#line 1523 "cwebdir/ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1934,7 +1932,7 @@ if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) #line 330 "cwebdir/ctang-w2c.ch" err_print(_("! Improper hex number following @l")); -#line 1531 "cwebdir/ctangle.w" +#line 1529 "cwebdir/ctangle.w" else{ unsigned int i; @@ -1946,7 +1944,7 @@ while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++; if(loc-beg>=translit_length) #line 336 "cwebdir/ctang-w2c.ch" err_print(_("! Replacement string in @l too long")); -#line 1541 "cwebdir/ctangle.w" +#line 1539 "cwebdir/ctangle.w" else{ strncpy(translit[i-0200],beg,(size_t)(loc-beg)); @@ -1955,7 +1953,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1507 "cwebdir/ctangle.w" +#line 1505 "cwebdir/ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1963,13 +1961,13 @@ while((c= (char)skip_ahead())=='@'); if(*(loc-1)!='>') #line 318 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1513 "cwebdir/ctangle.w" +#line 1511 "cwebdir/ctangle.w" break; } #line 324 "cwebdir/ctang-w2c.ch" default:err_print(_("! Double @ should be used in limbo")); -#line 1517 "cwebdir/ctangle.w" +#line 1515 "cwebdir/ctangle.w" } } @@ -1977,7 +1975,7 @@ default:err_print(_("! Double @ should be used in limbo")); } /*:100*//*103:*/ -#line 1551 "cwebdir/ctangle.w" +#line 1549 "cwebdir/ctangle.w" void print_stats(void){ @@ -1990,7 +1988,7 @@ printf(_("%td replacement texts (out of %ld)\n"), printf(_("%td bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes); printf(_("%td tokens (out of %ld)\n"), -#line 1562 "cwebdir/ctangle.w" +#line 1560 "cwebdir/ctangle.w" (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks); } diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c index d8bdb7e30f4..7677ce1f323 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.c +++ b/Build/source/texk/web2c/cwebdir/ctangle.c @@ -434,15 +434,15 @@ static eight_bits get_next(void); static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1413 "ctangle.w" +#line 1411 "ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1490 "ctangle.w" +#line 1488 "ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1523 "ctangle.w" +#line 1521 "ctangle.w" static void skip_limbo(void); /*:101*/ @@ -1282,19 +1282,17 @@ while(true)switch(a= get_next()){ #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)|| -(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))) +if(*buffer=='#'&&id_first==buffer+1&&( +(id_loc-id_first==5&&strncmp("endif",id_first,5)==0)|| +(id_loc-id_first==4&&strncmp("else",id_first,4)==0)|| +(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 1287 "ctangle.w" +#line 1285 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1307,7 +1305,7 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); } /*:87*/ -#line 1257 "ctangle.w" +#line 1255 "ctangle.w" a= cur_section_name-name_dir; app_repl((a/0400)+0250); @@ -1330,7 +1328,7 @@ store_id(a); } /*:85*/ -#line 1261 "ctangle.w" +#line 1259 "ctangle.w" } break; @@ -1359,13 +1357,13 @@ store_id(a); } /*:85*/ -#line 1271 "ctangle.w" +#line 1269 "ctangle.w" } break; case constant:case string: /*88:*/ -#line 1304 "ctangle.w" +#line 1302 "ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1381,12 +1379,12 @@ app_repl(*id_first++); app_repl(a); /*:88*/ -#line 1275 "ctangle.w" +#line 1273 "ctangle.w" break; case ord: /*89:*/ -#line 1322 "ctangle.w" +#line 1320 "ctangle.w" { int c= (int)((eight_bits)*id_first); if(c=='\\'){ @@ -1436,7 +1434,7 @@ app_repl(constant); } /*:89*/ -#line 1278 "ctangle.w" +#line 1276 "ctangle.w" break; case definition:case format_code:case begin_C:if(t!=section_name)goto done; @@ -1460,7 +1458,7 @@ cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:83*//*90:*/ -#line 1380 "ctangle.w" +#line 1378 "ctangle.w" static void scan_section(void) @@ -1475,7 +1473,7 @@ printf("*%d",(int)section_count);update_terminal; next_control= ignore; while(true){ /*92:*/ -#line 1421 "ctangle.w" +#line 1419 "ctangle.w" while(next_control<definition) @@ -1484,11 +1482,11 @@ loc-= 2;next_control= get_next(); } /*:92*/ -#line 1394 "ctangle.w" +#line 1392 "ctangle.w" if(next_control==definition){ /*93:*/ -#line 1428 "ctangle.w" +#line 1426 "ctangle.w" while((next_control= get_next())=='\n'); if(next_control!=identifier){ @@ -1504,7 +1502,7 @@ scan_repl(macro); cur_text->text_link= macro; /*:93*/ -#line 1396 "ctangle.w" +#line 1394 "ctangle.w" continue; } @@ -1514,14 +1512,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1450 "ctangle.w" +#line 1448 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1404 "ctangle.w" +#line 1402 "ctangle.w" break; } @@ -1529,20 +1527,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1455 "ctangle.w" +#line 1453 "ctangle.w" /*96:*/ -#line 1460 "ctangle.w" +#line 1458 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1456 "ctangle.w" +#line 1454 "ctangle.w" scan_repl(section_name); /*97:*/ -#line 1464 "ctangle.w" +#line 1462 "ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1559,16 +1557,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1458 "ctangle.w" +#line 1456 "ctangle.w" /*:95*/ -#line 1410 "ctangle.w" +#line 1408 "ctangle.w" } /*:90*//*98:*/ -#line 1479 "ctangle.w" +#line 1477 "ctangle.w" static void phase_one(void){ @@ -1581,7 +1579,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1495 "ctangle.w" +#line 1493 "ctangle.w" static void skip_limbo(void) @@ -1595,7 +1593,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1525 "ctangle.w" +#line 1523 "ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1620,7 +1618,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1507 "ctangle.w" +#line 1505 "ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1638,7 +1636,7 @@ default:err_print("! Double @ should be used in limbo"); } /*:100*//*103:*/ -#line 1551 "ctangle.w" +#line 1549 "ctangle.w" void print_stats(void){ diff --git a/Build/source/texk/web2c/cwebdir/ctangle.w b/Build/source/texk/web2c/cwebdir/ctangle.w index cd462961e24..62d12290ff8 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.w +++ b/Build/source/texk/web2c/cwebdir/ctangle.w @@ -1243,14 +1243,12 @@ file name. @ @<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 ) || @| - ( 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 */ + if (*buffer=='#' && id_first==buffer+1 && @| ( + ( id_loc-id_first==5 && strncmp("endif",id_first,5)==0 ) || @| + ( id_loc-id_first==4 && strncmp("else",id_first,4)==0 ) || @| + ( id_loc-id_first==4 && strncmp("elif",id_first,4)==0 ) ) ) + /* Avoid preprocessor calamities */ + print_where=true; break; case section_name: if (t!=section_name) goto done; else { |