diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-11 22:50:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-11 22:50:11 +0000 |
commit | c1a6b213ee5f1d664b4754c8048d44a543bc537a (patch) | |
tree | e6080c2f9627224a1a25c885edbcf77fdd56bf9c /Build | |
parent | abfc9b1ef6a50627aa4ef40a395bc3f4ce534853 (diff) |
tangleboot
git-svn-id: svn://tug.org/texlive/trunk@43460 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/ctangleboot.cin | 139 |
1 files changed, 76 insertions, 63 deletions
diff --git a/Build/source/texk/web2c/ctangleboot.cin b/Build/source/texk/web2c/ctangleboot.cin index 42c4a71018e..83e0a3a59e3 100644 --- a/Build/source/texk/web2c/ctangleboot.cin +++ b/Build/source/texk/web2c/ctangleboot.cin @@ -220,13 +220,14 @@ extern char change_file_name[]; extern int line[]; extern int change_line; #line 150 "cwebdir/common.h" +extern change_depth; extern boolean input_has_ended; extern boolean changing; extern boolean web_file_open; -#line 156 "cwebdir/common.h" +#line 157 "cwebdir/common.h" /*:10*//*11:*/ -#line 158 "cwebdir/common.h" +#line 159 "cwebdir/common.h" typedef unsigned short sixteen_bits; extern sixteen_bits section_count; @@ -235,14 +236,14 @@ extern boolean change_pending; extern boolean print_where; /*:11*//*12:*/ -#line 170 "cwebdir/common.h" +#line 171 "cwebdir/common.h" extern int argc; extern char**argv; extern boolean flags[]; /*:12*//*13:*/ -#line 182 "cwebdir/common.h" +#line 183 "cwebdir/common.h" extern FILE*C_file; extern FILE*tex_file; @@ -251,7 +252,7 @@ extern FILE*scn_file; extern FILE*active_file; /*:13*//*14:*/ -#line 191 "cwebdir/common.h" +#line 192 "cwebdir/common.h" #line 128 "cwebdir/ctangle.w" @@ -358,7 +359,7 @@ text_pointer cur_text; eight_bits next_control; /*:74*//*81:*/ -#line 1350 "cwebdir/ctangle.w" +#line 1353 "cwebdir/ctangle.w" extern sixteen_bits section_count; @@ -387,18 +388,18 @@ static void out_char(eight_bits); #line 650 "cwebdir/ctangle.w" /*:47*//*89:*/ -#line 1457 "cwebdir/ctangle.w" +#line 1460 "cwebdir/ctangle.w" #line 440 "cwebdir/ctang-w2c.ch" static void phase_one(void); -#line 1459 "cwebdir/ctangle.w" +#line 1462 "cwebdir/ctangle.w" /*:89*//*91:*/ -#line 1475 "cwebdir/ctangle.w" +#line 1478 "cwebdir/ctangle.w" #line 458 "cwebdir/ctang-w2c.ch" static void skip_limbo(void); -#line 1477 "cwebdir/ctangle.w" +#line 1480 "cwebdir/ctangle.w" /*:91*/ #line 70 "cwebdir/ctangle.w" @@ -919,15 +920,18 @@ print_where= 0; #line 1225 "cwebdir/ctangle.w" store_two_bytes(0150000); -if(changing)id_first= change_file_name; -else id_first= cur_file_name; +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); -if(changing)store_two_bytes((sixteen_bits)change_line); -else store_two_bytes((sixteen_bits)cur_line); #line 408 "cwebdir/ctang-w2c.ch" {int a_l= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a_l/0400)+0200); app_repl(a_l%0400);} -#line 1234 "cwebdir/ctangle.w" +#line 1237 "cwebdir/ctangle.w" /*:76*/ #line 912 "cwebdir/ctangle.w" @@ -1230,22 +1234,25 @@ if(t==section_name){/*76:*/ #line 1225 "cwebdir/ctangle.w" store_two_bytes(0150000); -if(changing)id_first= change_file_name; -else id_first= cur_file_name; +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); -if(changing)store_two_bytes((sixteen_bits)change_line); -else store_two_bytes((sixteen_bits)cur_line); #line 408 "cwebdir/ctang-w2c.ch" {int a_l= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a_l/0400)+0200); app_repl(a_l%0400);} -#line 1234 "cwebdir/ctangle.w" +#line 1237 "cwebdir/ctangle.w" /*:76*/ #line 1205 "cwebdir/ctangle.w" ;} while(1)switch(a= get_next()){ /*77:*/ -#line 1235 "cwebdir/ctangle.w" +#line 1238 "cwebdir/ctangle.w" case identifier:a= id_lookup(id_first,id_loc,0)-name_dir; app_repl((a/0400)+0200); @@ -1253,7 +1260,7 @@ app_repl(a%0400);break; case section_name:if(t!=section_name)goto done; else{ /*78:*/ -#line 1268 "cwebdir/ctangle.w" +#line 1271 "cwebdir/ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1266,7 +1273,7 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); } /*:78*/ -#line 1241 "cwebdir/ctangle.w" +#line 1244 "cwebdir/ctangle.w" ; a= cur_section_name-name_dir; app_repl((a/0400)+0250); @@ -1275,18 +1282,21 @@ app_repl(a%0400); #line 1225 "cwebdir/ctangle.w" store_two_bytes(0150000); -if(changing)id_first= change_file_name; -else id_first= cur_file_name; +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); -if(changing)store_two_bytes((sixteen_bits)change_line); -else store_two_bytes((sixteen_bits)cur_line); #line 408 "cwebdir/ctang-w2c.ch" {int a_l= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a_l/0400)+0200); app_repl(a_l%0400);} -#line 1234 "cwebdir/ctangle.w" +#line 1237 "cwebdir/ctangle.w" /*:76*/ -#line 1245 "cwebdir/ctangle.w" +#line 1248 "cwebdir/ctangle.w" ;break; } case output_defs_code:if(t!=section_name)err_print("! Misplaced @h"); @@ -1300,24 +1310,27 @@ app_repl(a%0400); #line 1225 "cwebdir/ctangle.w" store_two_bytes(0150000); -if(changing)id_first= change_file_name; -else id_first= cur_file_name; +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); -if(changing)store_two_bytes((sixteen_bits)change_line); -else store_two_bytes((sixteen_bits)cur_line); #line 408 "cwebdir/ctang-w2c.ch" {int a_l= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a_l/0400)+0200); app_repl(a_l%0400);} -#line 1234 "cwebdir/ctangle.w" +#line 1237 "cwebdir/ctangle.w" /*:76*/ -#line 1254 "cwebdir/ctangle.w" +#line 1257 "cwebdir/ctangle.w" ; } break; case constant:case string: /*79:*/ -#line 1279 "cwebdir/ctangle.w" +#line 1282 "cwebdir/ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1331,11 +1344,11 @@ app_repl(*id_first++); app_repl(a);break; /*:79*/ -#line 1258 "cwebdir/ctangle.w" +#line 1261 "cwebdir/ctangle.w" ; case ord: /*80:*/ -#line 1295 "cwebdir/ctangle.w" +#line 1298 "cwebdir/ctangle.w" { int c= (eight_bits)*id_first; if(c=='\\'){ @@ -1363,14 +1376,14 @@ else if(xisxdigit(*(id_first+1))){ ++id_first; #line 417 "cwebdir/ctang-w2c.ch" c= toupper((unsigned char)*id_first)-'A'+10; -#line 1321 "cwebdir/ctangle.w" +#line 1324 "cwebdir/ctangle.w" } if(xisdigit(*(id_first+1)))c= 16*c+*(++id_first)-'0'; else if(xisxdigit(*(id_first+1))){ ++id_first; #line 422 "cwebdir/ctang-w2c.ch" c= 16*c+toupper((unsigned char)*id_first)-'A'+10; -#line 1326 "cwebdir/ctangle.w" +#line 1329 "cwebdir/ctangle.w" } break; case'\\':c= '\\';break; @@ -1390,7 +1403,7 @@ app_repl(constant); break; /*:80*/ -#line 1260 "cwebdir/ctangle.w" +#line 1263 "cwebdir/ctangle.w" ; case definition:case format_code:case begin_C:if(t!=section_name)goto done; else{ @@ -1413,12 +1426,12 @@ cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:75*//*82:*/ -#line 1357 "cwebdir/ctangle.w" +#line 1360 "cwebdir/ctangle.w" #line 431 "cwebdir/ctang-w2c.ch" static void scan_section(void) -#line 1360 "cwebdir/ctangle.w" +#line 1363 "cwebdir/ctangle.w" { name_pointer p; text_pointer q; @@ -1430,7 +1443,7 @@ printf("*%d",section_count);update_terminal; next_control= 0; while(1){ /*83:*/ -#line 1396 "cwebdir/ctangle.w" +#line 1399 "cwebdir/ctangle.w" while(next_control<definition) @@ -1439,11 +1452,11 @@ loc-= 2;next_control= get_next(); } /*:83*/ -#line 1371 "cwebdir/ctangle.w" +#line 1374 "cwebdir/ctangle.w" ; if(next_control==definition){ /*84:*/ -#line 1403 "cwebdir/ctangle.w" +#line 1406 "cwebdir/ctangle.w" { while((next_control= get_next())=='\n'); if(next_control!=identifier){ @@ -1462,7 +1475,7 @@ cur_text->text_link= 0; } /*:84*/ -#line 1373 "cwebdir/ctangle.w" +#line 1376 "cwebdir/ctangle.w" continue; } @@ -1472,14 +1485,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*85:*/ -#line 1428 "cwebdir/ctangle.w" +#line 1431 "cwebdir/ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:85*/ -#line 1381 "cwebdir/ctangle.w" +#line 1384 "cwebdir/ctangle.w" ; break; } @@ -1487,20 +1500,20 @@ return; } no_where= print_where= 0; /*86:*/ -#line 1433 "cwebdir/ctangle.w" +#line 1436 "cwebdir/ctangle.w" /*87:*/ -#line 1438 "cwebdir/ctangle.w" +#line 1441 "cwebdir/ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:87*/ -#line 1434 "cwebdir/ctangle.w" +#line 1437 "cwebdir/ctangle.w" ; scan_repl(section_name); /*88:*/ -#line 1442 "cwebdir/ctangle.w" +#line 1445 "cwebdir/ctangle.w" if(p==name_dir||p==0){ (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1517,21 +1530,21 @@ cur_text->text_link= section_flag; /*:88*/ -#line 1436 "cwebdir/ctangle.w" +#line 1439 "cwebdir/ctangle.w" ; /*:86*/ -#line 1387 "cwebdir/ctangle.w" +#line 1390 "cwebdir/ctangle.w" ; } /*:82*//*90:*/ -#line 1460 "cwebdir/ctangle.w" +#line 1463 "cwebdir/ctangle.w" #line 449 "cwebdir/ctang-w2c.ch" static void phase_one(void){ -#line 1463 "cwebdir/ctangle.w" +#line 1466 "cwebdir/ctangle.w" phase= 1; section_count= 0; reset_input(); @@ -1542,12 +1555,12 @@ phase= 2; } /*:90*//*92:*/ -#line 1478 "cwebdir/ctangle.w" +#line 1481 "cwebdir/ctangle.w" #line 467 "cwebdir/ctang-w2c.ch" static void skip_limbo(void) -#line 1481 "cwebdir/ctangle.w" +#line 1484 "cwebdir/ctangle.w" { char c; while(1){ @@ -1559,7 +1572,7 @@ c= *loc++; if(ccode[(eight_bits)c]==new_section)break; switch(ccode[(eight_bits)c]){ case translit_code:/*93:*/ -#line 1507 "cwebdir/ctangle.w" +#line 1510 "cwebdir/ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1584,7 +1597,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:93*/ -#line 1491 "cwebdir/ctangle.w" +#line 1494 "cwebdir/ctangle.w" ;break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1602,12 +1615,12 @@ default:err_print("! Double @ should be used in limbo"); } /*:92*//*94:*/ -#line 1533 "cwebdir/ctangle.w" +#line 1536 "cwebdir/ctangle.w" void #line 476 "cwebdir/ctang-w2c.ch" print_stats(void){ -#line 1536 "cwebdir/ctangle.w" +#line 1539 "cwebdir/ctangle.w" printf("\nMemory usage statistics:\n"); printf("%ld names (out of %ld)\n", (long)(name_ptr-name_dir),(long)max_names); |