From 1553d537c63d2eef1b6fb7e7fcfc14fbb0d2e6f4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 22 Feb 2017 00:01:30 +0000 Subject: cweb 3.64b git-svn-id: svn://tug.org/texlive/trunk@43294 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/cwebdir/ctangle.c | 113 +++++++++++++++++------------- 1 file changed, 63 insertions(+), 50 deletions(-) (limited to 'Build/source/texk/web2c/cwebdir/ctangle.c') diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c index 01fa7c407cd..b7a1b553cee 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.c +++ b/Build/source/texk/web2c/cwebdir/ctangle.c @@ -215,6 +215,7 @@ extern char file_name[][max_file_name_length]; extern char change_file_name[]; extern line[]; extern change_line; +extern change_depth; extern boolean input_has_ended; extern boolean changing; extern boolean web_file_open; @@ -223,7 +224,7 @@ extern get_line(); extern check_complete(); /*:11*//*12:*/ -#line 158 "common.h" +#line 159 "common.h" typedef unsigned short sixteen_bits; extern sixteen_bits section_count; @@ -232,14 +233,14 @@ extern boolean change_pending; extern boolean print_where; /*:12*//*13:*/ -#line 170 "common.h" +#line 171 "common.h" extern int argc; extern char**argv; extern boolean flags[]; /*:13*//*14:*/ -#line 182 "common.h" +#line 183 "common.h" extern FILE*C_file; extern FILE*tex_file; @@ -248,7 +249,7 @@ extern FILE*scn_file; extern FILE*active_file; /*:14*//*15:*/ -#line 191 "common.h" +#line 192 "common.h" extern void common_init(); #line 128 "ctangle.w" @@ -356,7 +357,7 @@ text_pointer cur_text; eight_bits next_control; /*:75*//*82:*/ -#line 1350 "ctangle.w" +#line 1353 "ctangle.w" extern sixteen_bits section_count; @@ -388,12 +389,12 @@ void output_defs(); static void out_char(); /*:48*//*90:*/ -#line 1457 "ctangle.w" +#line 1460 "ctangle.w" void phase_one(); /*:90*//*92:*/ -#line 1475 "ctangle.w" +#line 1478 "ctangle.w" void skip_limbo(); @@ -888,11 +889,14 @@ print_where= 0; #line 1225 "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); {int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200); app_repl(a%0400);} @@ -1192,11 +1196,14 @@ if(t==section_name){/*77:*/ #line 1225 "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); {int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200); app_repl(a%0400);} @@ -1205,7 +1212,7 @@ app_repl(a%0400);} ;} while(1)switch(a= get_next()){ /*78:*/ -#line 1235 "ctangle.w" +#line 1238 "ctangle.w" case identifier:a= id_lookup(id_first,id_loc,0)-name_dir; app_repl((a/0400)+0200); @@ -1213,7 +1220,7 @@ app_repl(a%0400);break; case section_name:if(t!=section_name)goto done; else{ /*79:*/ -#line 1268 "ctangle.w" +#line 1271 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loctok_start= tok_ptr; } /*:76*//*83:*/ -#line 1357 "ctangle.w" +#line 1360 "ctangle.w" void scan_section() @@ -1380,7 +1393,7 @@ printf("*%d",section_count);update_terminal; next_control= 0; while(1){ /*84:*/ -#line 1396 "ctangle.w" +#line 1399 "ctangle.w" while(next_controltext_link= 0; } /*:85*/ -#line 1373 "ctangle.w" +#line 1376 "ctangle.w" continue; } @@ -1422,14 +1435,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*86:*/ -#line 1428 "ctangle.w" +#line 1431 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:86*/ -#line 1381 "ctangle.w" +#line 1384 "ctangle.w" ; break; } @@ -1437,20 +1450,20 @@ return; } no_where= print_where= 0; /*87:*/ -#line 1433 "ctangle.w" +#line 1436 "ctangle.w" /*88:*/ -#line 1438 "ctangle.w" +#line 1441 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:88*/ -#line 1434 "ctangle.w" +#line 1437 "ctangle.w" ; scan_repl(section_name); /*89:*/ -#line 1442 "ctangle.w" +#line 1445 "ctangle.w" if(p==name_dir||p==0){ (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1467,16 +1480,16 @@ cur_text->text_link= section_flag; /*:89*/ -#line 1436 "ctangle.w" +#line 1439 "ctangle.w" ; /*:87*/ -#line 1387 "ctangle.w" +#line 1390 "ctangle.w" ; } /*:83*//*91:*/ -#line 1460 "ctangle.w" +#line 1463 "ctangle.w" void phase_one(){ @@ -1490,7 +1503,7 @@ phase= 2; } /*:91*//*93:*/ -#line 1478 "ctangle.w" +#line 1481 "ctangle.w" void skip_limbo() @@ -1505,7 +1518,7 @@ c= *loc++; if(ccode[(eight_bits)c]==new_section)break; switch(ccode[(eight_bits)c]){ case translit_code:/*94:*/ -#line 1507 "ctangle.w" +#line 1510 "ctangle.w" while(xisspace(*loc)&&loc