Unified · Split
| @@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c' · 9 unmodified lines | |||
| 10 | @x | 10 | @x |
| 11 | \def\v{\char'174} % vertical (|) in typewriter font | 11 | \def\v{\char'174} % vertical (|) in typewriter font |
| 12 | 12 | ||
| 13 | \def\title{Common code for CTANGLE and CWEAVE (Version 3.3)} | 13 | \def\title{Common code for CTANGLE and CWEAVE (Version 3.42)} |
| 14 | \def\topofcontents{\null\vfill | 14 | \def\topofcontents{\null\vfill |
| 15 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and | 15 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and |
| 16 | {\ttitlefont CWEAVE}} | 16 | {\ttitlefont CWEAVE}} |
| 17 | \vskip 15pt | 17 | \vskip 15pt |
| 18 | \centerline{(Version 3.3)} | 18 | \centerline{(Version 3.42)} |
| 19 | \vfill} | 19 | \vfill} |
| 20 | \def\botofcontents{\vfill | 20 | \def\botofcontents{\vfill |
| 21 | \noindent | 21 | \noindent |
| 22 | @y | 22 | @y |
| 23 | \def\v{\char'174} % vertical (|) in typewriter font | 23 | \def\v{\char'174} % vertical (|) in typewriter font |
| 24 | 24 | ||
| 25 | \def\title{Common code for CTANGLE and CWEAVE (QL Version 3.4)} | 25 | \def\title{Common code for CTANGLE and CWEAVE (QL Version 3.42)} |
| 26 | \def\topofcontents{\null\vfill | 26 | \def\topofcontents{\null\vfill |
| 27 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and | 27 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and |
| 28 | {\ttitlefont CWEAVE}} | 28 | {\ttitlefont CWEAVE}} |
| 29 | \vskip 15pt | 29 | \vskip 15pt |
| 30 | \centerline{(Version 3.4)} | 30 | \centerline{(Version 3.42)} |
| 31 | \vfill} | 31 | \vfill} |
| 32 | \def\botofcontents{\vfill | 32 | \def\botofcontents{\vfill |
| 33 | \noindent | 33 | \noindent |
| @@ -174,16 +174,12 @@ after the dot. We must check that there is enough room in · 140 unmodified lines | |||
| 174 | sprintf(C_file_name,"%s.c",*argv); | 174 | sprintf(C_file_name,"%s.c",*argv); |
| 175 | } else { | 175 | } else { |
| 176 | strcpy(tex_file_name,*argv); | 176 | strcpy(tex_file_name,*argv); |
| 177 | strcpy(C_file_name,*argv); | ||
| 177 | if (flags['x']) { /* indexes will be generated */ | 178 | if (flags['x']) { /* indexes will be generated */ |
| 178 | if (program==cweave && strcmp(*argv+strlen(*argv)-4,".tex")!=0) | 179 | *dot_pos=0; |
| 179 | fatal("! Output file name should end with .tex\n",*argv); | 180 | sprintf(idx_file_name,"%s.idx",*argv); |
| 180 | @.Output file name...tex@> | 181 | sprintf(scn_file_name,"%s.scn",*argv); |
| 181 | strcpy(idx_file_name,*argv); | ||
| 182 | strcpy(idx_file_name+strlen(*argv)-4,".idx"); | ||
| 183 | strcpy(scn_file_name,*argv); | ||
| 184 | strcpy(scn_file_name+strlen(*argv)-4,".scn"); | ||
| 185 | } | 182 | } |
| 186 | strcpy(C_file_name,*argv); | ||
| 187 | } | 183 | } |
| 188 | found_out=1; | 184 | found_out=1; |
| 189 | } | 185 | } |
| @@ -297,16 +293,12 @@ the routine as if it would work. · 107 unmodified lines | |||
| 297 | sprintf(C_file_name,"%s_c",*argv); | 293 | sprintf(C_file_name,"%s_c",*argv); |
| 298 | } else { | 294 | } else { |
| 299 | strcpy(tex_file_name,*argv); | 295 | strcpy(tex_file_name,*argv); |
| 296 | strcpy(C_file_name,*argv); | ||
| 300 | if (flags['x']) { /* indexes will be generated */ | 297 | if (flags['x']) { /* indexes will be generated */ |
| 301 | if (program==cweave && strcmp(*argv+strlen(*argv)-4,"_tex")!=0) | 298 | *dot_pos=0; |
| 302 | fatal("! Output file name should end with _tex\n",*argv); | 299 | sprintf(idx_file_name,"%s_idx",*argv); |
| 303 | @.Output file name...tex@> | 300 | sprintf(scn_file_name,"%s_scn",*argv); |
| 304 | strcpy(idx_file_name,*argv); | ||
| 305 | strcpy(idx_file_name+strlen(*argv)-4,"_idx"); | ||
| 306 | strcpy(scn_file_name,*argv); | ||
| 307 | strcpy(scn_file_name+strlen(*argv)-4,"_scn"); | ||
| 308 | } | 301 | } |
| 309 | strcpy(C_file_name,*argv); | ||
| 310 | } | 302 | } |
| 311 | found_out=1; | 303 | found_out=1; |
| 312 | } | 304 | } |
| @@ -4,17 +4,17 @@ · 3 unmodified lines | |||
| 4 | /*5:*/ | 4 | /*5:*/ |
| 5 | #line 101 "common.w" | 5 | #line 101 "common.w" |
| 6 | 6 | ||
| 7 | #include <ctype.h> | 7 | #include <ctype.h> |
| 8 | 8 | ||
| 9 | /*:5*//*8:*/ | 9 | /*:5*//*8:*/ |
| 10 | #line 164 "common.w" | 10 | #line 164 "common.w" |
| 11 | 11 | ||
| 12 | #include <stdio.h> | 12 | #include <stdio.h> |
| 13 | 13 | ||
| 14 | /*:8*//*22:*/ | 14 | /*:8*//*22:*/ |
| 15 | #line 469 "common.w" | 15 | #line 469 "common.w" |
| 16 | 16 | ||
| 17 | #include <stdlib.h> | 17 | #include <stdlib.h> |
| 18 | 18 | ||
| 19 | /*:22*/ | 19 | /*:22*/ |
| 20 | #line 58 "common.w" | 20 | #line 58 "common.w" |
| @@ -229,7 +229,7 @@ char scn_file_name[max_file_name_length]; · 208 unmodified lines | |||
| 229 | boolean flags[128]; | 229 | boolean flags[128]; |
| 230 | 230 | ||
| 231 | /*:67*//*77:*/ | 231 | /*:67*//*77:*/ |
| 232 | #line 1367 "common.w" | 232 | #line 1363 "common.w" |
| 233 | 233 | ||
| 234 | FILE*C_file; | 234 | FILE*C_file; |
| 235 | FILE*tex_file; | 235 | FILE*tex_file; |
| @@ -295,7 +295,7 @@ void fatal(),overflow(); · 59 unmodified lines | |||
| 295 | void scan_args(); | 295 | void scan_args(); |
| 296 | 296 | ||
| 297 | /*:69*//*81:*/ | 297 | /*:69*//*81:*/ |
| 298 | #line 1408 "common.w" | 298 | #line 1404 "common.w" |
| 299 | 299 | ||
| 300 | extern int strlen(); | 300 | extern int strlen(); |
| 301 | extern int strcmp(); | 301 | extern int strcmp(); |
| @@ -342,7 +342,7 @@ show_banner= show_happiness= show_progress= 1; · 40 unmodified lines | |||
| 342 | #line 93 "common.w" | 342 | #line 93 "common.w" |
| 343 | ; | 343 | ; |
| 344 | /*78:*/ | 344 | /*78:*/ |
| 345 | #line 1374 "common.w" | 345 | #line 1370 "common.w" |
| 346 | 346 | ||
| 347 | scan_args(); | 347 | scan_args(); |
| 348 | if(program==ctangle){ | 348 | if(program==ctangle){ |
| @@ -372,7 +372,7 @@ if(feof(fp))return(0); · 23 unmodified lines | |||
| 372 | limit= k= buffer; | 372 | limit= k= buffer; |
| 373 | while(k<=buffer_end&&(c= getc(fp))!=EOF&&c!='\n') | 373 | while(k<=buffer_end&&(c= getc(fp))!=EOF&&c!='\n') |
| 374 | if((*(k++)= c)!=' ')limit= k; | 374 | if((*(k++)= c)!=' ')limit= k; |
| 375 | if(k>buffer_end) | 375 | if(k> buffer_end) |
| 376 | if((c= getc(fp))!=EOF&&c!='\n'){ | 376 | if((c= getc(fp))!=EOF&&c!='\n'){ |
| 377 | ungetc(c,fp);loc= buffer;err_print("! Input line too long"); | 377 | ungetc(c,fp);loc= buffer;err_print("! Input line too long"); |
| 378 | 378 | ||
| @@ -458,7 +458,7 @@ err_print("! Change file ended before @y"); · 79 unmodified lines | |||
| 458 | change_limit= change_buffer;changing= 0; | 458 | change_limit= change_buffer;changing= 0; |
| 459 | return; | 459 | return; |
| 460 | } | 460 | } |
| 461 | if(limit>buffer+1&&buffer[0]=='@'){ | 461 | if(limit> buffer+1&&buffer[0]=='@'){ |
| 462 | if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]); | 462 | if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]); |
| 463 | /*17:*/ | 463 | /*17:*/ |
| 464 | #line 357 "common.w" | 464 | #line 357 "common.w" |
| @@ -468,7 +468,7 @@ loc= buffer+2;err_print("! Where is the matching @y?"); · 3 unmodified lines | |||
| 468 | 468 | ||
| 469 | } | 469 | } |
| 470 | else if(buffer[1]=='y'){ | 470 | else if(buffer[1]=='y'){ |
| 471 | if(n>0){ | 471 | if(n> 0){ |
| 472 | loc= buffer+2; | 472 | loc= buffer+2; |
| 473 | printf("\n! Hmm... %d ",n); | 473 | printf("\n! Hmm... %d ",n); |
| 474 | err_print("of the preceding lines failed to match"); | 474 | err_print("of the preceding lines failed to match"); |
| @@ -552,7 +552,7 @@ err_print("! Change file ended without @z"); · 77 unmodified lines | |||
| 552 | 552 | ||
| 553 | buffer[0]= '@';buffer[1]= 'z';limit= buffer+2; | 553 | buffer[0]= '@';buffer[1]= 'z';limit= buffer+2; |
| 554 | } | 554 | } |
| 555 | if(limit>buffer){ | 555 | if(limit> buffer){ |
| 556 | if(change_pending){ | 556 | if(change_pending){ |
| 557 | if_section_start_make_pending(0); | 557 | if_section_start_make_pending(0); |
| 558 | if(change_pending){ | 558 | if(change_pending){ |
| @@ -577,7 +577,7 @@ prime_the_change_buffer();changing= !changing;print_where= 1; · 18 unmodified lines | |||
| 577 | /*:25*/ | 577 | /*:25*/ |
| 578 | #line 430 "common.w" | 578 | #line 430 "common.w" |
| 579 | ; | 579 | ; |
| 580 | if(!changing||include_depth>change_depth){ | 580 | if(!changing||include_depth> change_depth){ |
| 581 | /*24:*/ | 581 | /*24:*/ |
| 582 | #line 513 "common.w" | 582 | #line 513 "common.w" |
| 583 | { | 583 | { |
| @@ -594,7 +594,7 @@ cur_line++; · 10 unmodified lines | |||
| 594 | if(!changing&&!input_has_ended) | 594 | if(!changing&&!input_has_ended) |
| 595 | if(limit-buffer==change_limit-change_buffer) | 595 | if(limit-buffer==change_limit-change_buffer) |
| 596 | if(buffer[0]==change_buffer[0]) | 596 | if(buffer[0]==change_buffer[0]) |
| 597 | if(change_limit>change_buffer)check_change(); | 597 | if(change_limit> change_buffer)check_change(); |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | /*:24*/ | 600 | /*:24*/ |
| @@ -626,7 +626,7 @@ char*k= cur_file_name,*kk; · 25 unmodified lines | |||
| 626 | int l; | 626 | int l; |
| 627 | 627 | ||
| 628 | while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++; | 628 | while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++; |
| 629 | if(k>cur_file_name_end)too_long(); | 629 | if(k> cur_file_name_end)too_long(); |
| 630 | 630 | ||
| 631 | *k= '\0'; | 631 | *k= '\0'; |
| 632 | if((cur_file= fopen(cur_file_name,"r"))!=NULL){ | 632 | if((cur_file= fopen(cur_file_name,"r"))!=NULL){ |
| @@ -635,18 +635,18 @@ goto restart; · 2 unmodified lines | |||
| 635 | } | 635 | } |
| 636 | kk= getenv("CWEBINPUTS"); | 636 | kk= getenv("CWEBINPUTS"); |
| 637 | if(kk!=NULL){ | 637 | if(kk!=NULL){ |
| 638 | if((l= strlen(kk))>max_file_name_length-2)too_long(); | 638 | if((l= strlen(kk))> max_file_name_length-2)too_long(); |
| 639 | strcpy(temp_file_name,kk); | 639 | strcpy(temp_file_name,kk); |
| 640 | } | 640 | } |
| 641 | else{ | 641 | else{ |
| 642 | #ifdef CWEBINPUTS | 642 | #ifdef CWEBINPUTS |
| 643 | if((l= strlen(CWEBINPUTS))>max_file_name_length-2)too_long(); | 643 | if((l= strlen(CWEBINPUTS))> max_file_name_length-2)too_long(); |
| 644 | strcpy(temp_file_name,CWEBINPUTS); | 644 | strcpy(temp_file_name,CWEBINPUTS); |
| 645 | #else | 645 | #else |
| 646 | l= 0; | 646 | l= 0; |
| 647 | #endif | 647 | #endif |
| 648 | } | 648 | } |
| 649 | if(l>0){ | 649 | if(l> 0){ |
| 650 | if(k+l+2>=cur_file_name_end)too_long(); | 650 | if(k+l+2>=cur_file_name_end)too_long(); |
| 651 | 651 | ||
| 652 | for(;k>=cur_file_name;k--)*(k+l+1)= *k; | 652 | for(;k>=cur_file_name;k--)*(k+l+1)= *k; |
| @@ -722,7 +722,7 @@ p->link= hash[h];hash[h]= p; · 69 unmodified lines | |||
| 722 | if(p==name_ptr)/*39:*/ | 722 | if(p==name_ptr)/*39:*/ |
| 723 | #line 699 "common.w" | 723 | #line 699 "common.w" |
| 724 | { | 724 | { |
| 725 | if(byte_ptr+l>byte_mem_end)overflow("byte memory"); | 725 | if(byte_ptr+l> byte_mem_end)overflow("byte memory"); |
| 726 | if(name_ptr>=name_dir_end)overflow("name"); | 726 | if(name_ptr>=name_dir_end)overflow("name"); |
| 727 | strncpy(byte_ptr,first,l); | 727 | strncpy(byte_ptr,first,l); |
| 728 | (++name_ptr)->byte_start= byte_ptr+= l; | 728 | (++name_ptr)->byte_start= byte_ptr+= l; |
| @@ -822,7 +822,7 @@ int ispref; · 93 unmodified lines | |||
| 822 | name_pointer p= name_ptr; | 822 | name_pointer p= name_ptr; |
| 823 | char*s= first_chunk(p); | 823 | char*s= first_chunk(p); |
| 824 | int name_len= last-first+ispref; | 824 | int name_len= last-first+ispref; |
| 825 | if(s+name_len>byte_mem_end)overflow("byte memory"); | 825 | if(s+name_len> byte_mem_end)overflow("byte memory"); |
| 826 | if(name_ptr+1>=name_dir_end)overflow("name"); | 826 | if(name_ptr+1>=name_dir_end)overflow("name"); |
| 827 | (++name_ptr)->byte_start= byte_ptr= s+name_len; | 827 | (++name_ptr)->byte_start= byte_ptr= s+name_len; |
| 828 | if(ispref){ | 828 | if(ispref){ |
| @@ -857,7 +857,7 @@ while(q->link!=name_dir)q= q->link; · 28 unmodified lines | |||
| 857 | q->link= name_ptr; | 857 | q->link= name_ptr; |
| 858 | s= name_ptr->byte_start; | 858 | s= name_ptr->byte_start; |
| 859 | name_ptr->link= name_dir; | 859 | name_ptr->link= name_dir; |
| 860 | if(s+name_len>byte_mem_end)overflow("byte memory"); | 860 | if(s+name_len> byte_mem_end)overflow("byte memory"); |
| 861 | (++name_ptr)->byte_start= byte_ptr= s+name_len; | 861 | (++name_ptr)->byte_start= byte_ptr= s+name_len; |
| 862 | strncpy(s,first,name_len); | 862 | strncpy(s,first,name_len); |
| 863 | if(ispref)*(byte_ptr-1)= ' '; | 863 | if(ispref)*(byte_ptr-1)= ' '; |
| @@ -1007,7 +1007,7 @@ printf(". (l. %d of change file)\n",change_line); · 143 unmodified lines | |||
| 1007 | else if(include_depth==0)printf(". (l. %d)\n",cur_line); | 1007 | else if(include_depth==0)printf(". (l. %d)\n",cur_line); |
| 1008 | else printf(". (l. %d of include file %s)\n",cur_line,cur_file_name); | 1008 | else printf(". (l. %d of include file %s)\n",cur_line,cur_file_name); |
| 1009 | l= (loc>=limit?limit:loc); | 1009 | l= (loc>=limit?limit:loc); |
| 1010 | if(l>buffer){ | 1010 | if(l> buffer){ |
| 1011 | for(k= buffer;k<l;k++) | 1011 | for(k= buffer;k<l;k++) |
| 1012 | if(*k=='\t')putchar(' '); | 1012 | if(*k=='\t')putchar(' '); |
| 1013 | else putchar(*k); | 1013 | else putchar(*k); |
| @@ -1047,7 +1047,7 @@ case fatal_message:printf("(That was a fatal error, my friend.)\n"); · 33 unmodified lines | |||
| 1047 | /*:62*/ | 1047 | /*:62*/ |
| 1048 | #line 1148 "common.w" | 1048 | #line 1148 "common.w" |
| 1049 | ; | 1049 | ; |
| 1050 | if(history>harmless_message)return(1); | 1050 | if(history> harmless_message)return(1); |
| 1051 | else return(0); | 1051 | else return(0); |
| 1052 | } | 1052 | } |
| 1053 | 1053 | ||
| @@ -1085,14 +1085,14 @@ boolean found_web= 0,found_change= 0,found_out= 0; · 31 unmodified lines | |||
| 1085 | 1085 | ||
| 1086 | boolean flag_change; | 1086 | boolean flag_change; |
| 1087 | 1087 | ||
| 1088 | while(--argc>0){ | 1088 | while(--argc> 0){ |
| 1089 | if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/ | 1089 | if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/ |
| 1090 | #line 1341 "common.w" | 1090 | #line 1337 "common.w" |
| 1091 | 1091 | ||
| 1092 | { | 1092 | { |
| 1093 | if(**argv=='-')flag_change= 0; | 1093 | if(**argv=='-')flag_change= 0; |
| 1094 | else flag_change= 1; | 1094 | else flag_change= 1; |
| 1095 | for(dot_pos= *argv+1;*dot_pos>'\0';dot_pos++) | 1095 | for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++) |
| 1096 | flags[*dot_pos]= flag_change; | 1096 | flags[*dot_pos]= flag_change; |
| 1097 | } | 1097 | } |
| 1098 | 1098 | ||
| @@ -1110,9 +1110,9 @@ if(!found_web)/*71:*/ · 11 unmodified lines | |||
| 1110 | #line 1285 "common.w" | 1110 | #line 1285 "common.w" |
| 1111 | 1111 | ||
| 1112 | { | 1112 | { |
| 1113 | if(s-*argv>max_file_name_length-5) | 1113 | if(s-*argv> max_file_name_length-5) |
| 1114 | /*76:*/ | 1114 | /*76:*/ |
| 1115 | #line 1361 "common.w" | 1115 | #line 1357 "common.w" |
| 1116 | fatal("! Filename too long\n",*argv); | 1116 | fatal("! Filename too long\n",*argv); |
| 1117 | 1117 | ||
| 1118 | 1118 | ||
| @@ -1142,9 +1142,9 @@ else if(!found_change)/*72:*/ · 23 unmodified lines | |||
| 1142 | { | 1142 | { |
| 1143 | if(strcmp(*argv,"-")==0)found_change= -1; | 1143 | if(strcmp(*argv,"-")==0)found_change= -1; |
| 1144 | else{ | 1144 | else{ |
| 1145 | if(s-*argv>max_file_name_length-4) | 1145 | if(s-*argv> max_file_name_length-4) |
| 1146 | /*76:*/ | 1146 | /*76:*/ |
| 1147 | #line 1361 "common.w" | 1147 | #line 1357 "common.w" |
| 1148 | fatal("! Filename too long\n",*argv); | 1148 | fatal("! Filename too long\n",*argv); |
| 1149 | 1149 | ||
| 1150 | 1150 | ||
| @@ -1165,9 +1165,9 @@ else if(!found_out)/*73:*/ · 14 unmodified lines | |||
| 1165 | #line 1316 "common.w" | 1165 | #line 1316 "common.w" |
| 1166 | 1166 | ||
| 1167 | { | 1167 | { |
| 1168 | if(s-*argv>max_file_name_length-5) | 1168 | if(s-*argv> max_file_name_length-5) |
| 1169 | /*76:*/ | 1169 | /*76:*/ |
| 1170 | #line 1361 "common.w" | 1170 | #line 1357 "common.w" |
| 1171 | fatal("! Filename too long\n",*argv); | 1171 | fatal("! Filename too long\n",*argv); |
| 1172 | 1172 | ||
| 1173 | 1173 | ||
| @@ -1181,16 +1181,12 @@ sprintf(scn_file_name,"%s.scn",*argv); · 7 unmodified lines | |||
| 1181 | sprintf(C_file_name,"%s.c",*argv); | 1181 | sprintf(C_file_name,"%s.c",*argv); |
| 1182 | }else{ | 1182 | }else{ |
| 1183 | strcpy(tex_file_name,*argv); | 1183 | strcpy(tex_file_name,*argv); |
| 1184 | strcpy(C_file_name,*argv); | ||
| 1184 | if(flags['x']){ | 1185 | if(flags['x']){ |
| 1185 | if(program==cweave&&strcmp(*argv+strlen(*argv)-4,".tex")!=0) | 1186 | *dot_pos= 0; |
| 1186 | fatal("! Output file name should end with .tex\n",*argv); | 1187 | sprintf(idx_file_name,"%s.idx",*argv); |
| 1187 | 1188 | sprintf(scn_file_name,"%s.scn",*argv); | |
| 1188 | strcpy(idx_file_name,*argv); | ||
| 1189 | strcpy(idx_file_name+strlen(*argv)-4,".idx"); | ||
| 1190 | strcpy(scn_file_name,*argv); | ||
| 1191 | strcpy(scn_file_name+strlen(*argv)-4,".scn"); | ||
| 1192 | } | 1189 | } |
| 1193 | strcpy(C_file_name,*argv); | ||
| 1194 | } | 1190 | } |
| 1195 | found_out= 1; | 1191 | found_out= 1; |
| 1196 | } | 1192 | } |
| @@ -1199,7 +1195,7 @@ found_out= 1; · 2 unmodified lines | |||
| 1199 | #line 1270 "common.w" | 1195 | #line 1270 "common.w" |
| 1200 | 1196 | ||
| 1201 | else/*75:*/ | 1197 | else/*75:*/ |
| 1202 | #line 1349 "common.w" | 1198 | #line 1345 "common.w" |
| 1203 | 1199 | ||
| 1204 | { | 1200 | { |
| 1205 | if(program==ctangle) | 1201 | if(program==ctangle) |
| @@ -1218,7 +1214,7 @@ else fatal( · 12 unmodified lines | |||
| 1218 | } | 1214 | } |
| 1219 | } | 1215 | } |
| 1220 | if(!found_web)/*75:*/ | 1216 | if(!found_web)/*75:*/ |
| 1221 | #line 1349 "common.w" | 1217 | #line 1345 "common.w" |
| 1222 | 1218 | ||
| 1223 | { | 1219 | { |
| 1224 | if(program==ctangle) | 1220 | if(program==ctangle) |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | % This program by Silvio Levy and Donald E. Knuth | 2 | % This program by Silvio Levy and Donald E. Knuth |
| 3 | % is based on a program by Knuth. | 3 | % is based on a program by Knuth. |
| 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. | 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. |
| 5 | % Version 3.0 --- June 1993 | 5 | % Version 3.0 --- June 1993 (works also with later versions) |
| 6 | 6 | ||
| 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth | 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth |
| 8 | 8 | ||
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | % This program by Silvio Levy and Donald E. Knuth | 2 | % This program by Silvio Levy and Donald E. Knuth |
| 3 | % is based on a program by Knuth. | 3 | % is based on a program by Knuth. |
| 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. | 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. |
| 5 | % Version 3.3 --- December 1994 (works with later versions too) | 5 | % Version 3.42 --- August 1998 (works with later versions too) |
| 6 | 6 | ||
| 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth | 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth |
| 8 | 8 | ||
| @@ -17,12 +17,12 @@ · 8 unmodified lines | |||
| 17 | 17 | ||
| 18 | \def\v{\char'174} % vertical (|) in typewriter font | 18 | \def\v{\char'174} % vertical (|) in typewriter font |
| 19 | 19 | ||
| 20 | \def\title{Common code for CTANGLE and CWEAVE (Version 3.3)} | 20 | \def\title{Common code for CTANGLE and CWEAVE (Version 3.42)} |
| 21 | \def\topofcontents{\null\vfill | 21 | \def\topofcontents{\null\vfill |
| 22 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and | 22 | \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and |
| 23 | {\ttitlefont CWEAVE}} | 23 | {\ttitlefont CWEAVE}} |
| 24 | \vskip 15pt | 24 | \vskip 15pt |
| 25 | \centerline{(Version 3.3)} | 25 | \centerline{(Version 3.42)} |
| 26 | \vfill} | 26 | \vfill} |
| 27 | \def\botofcontents{\vfill | 27 | \def\botofcontents{\vfill |
| 28 | \noindent | 28 | \noindent |
| @@ -1324,16 +1324,12 @@ after the dot. We must check that there is enough room in · 1295 unmodified lines | |||
| 1324 | sprintf(C_file_name,"%s.c",*argv); | 1324 | sprintf(C_file_name,"%s.c",*argv); |
| 1325 | } else { | 1325 | } else { |
| 1326 | strcpy(tex_file_name,*argv); | 1326 | strcpy(tex_file_name,*argv); |
| 1327 | strcpy(C_file_name,*argv); | ||
| 1327 | if (flags['x']) { /* indexes will be generated */ | 1328 | if (flags['x']) { /* indexes will be generated */ |
| 1328 | if (program==cweave && strcmp(*argv+strlen(*argv)-4,".tex")!=0) | 1329 | *dot_pos=0; |
| 1329 | fatal("! Output file name should end with .tex\n",*argv); | 1330 | sprintf(idx_file_name,"%s.idx",*argv); |
| 1330 | @.Output file name...tex@> | 1331 | sprintf(scn_file_name,"%s.scn",*argv); |
| 1331 | strcpy(idx_file_name,*argv); | ||
| 1332 | strcpy(idx_file_name+strlen(*argv)-4,".idx"); | ||
| 1333 | strcpy(scn_file_name,*argv); | ||
| 1334 | strcpy(scn_file_name+strlen(*argv)-4,".scn"); | ||
| 1335 | } | 1332 | } |
| 1336 | strcpy(C_file_name,*argv); | ||
| 1337 | } | 1333 | } |
| 1338 | found_out=1; | 1334 | found_out=1; |
| 1339 | } | 1335 | } |
| @@ -17,12 +17,12 @@ by using "huge" pointers. · 16 unmodified lines | |||
| 17 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} | 17 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} |
| 18 | is modified. | 18 | is modified. |
| 19 | 19 | ||
| 20 | @d banner "This is CTANGLE (Version 3.4)\n" | 20 | @d banner "This is CTANGLE (Version 3.43)\n" |
| 21 | @y | 21 | @y |
| 22 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} | 22 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} |
| 23 | is modified. | 23 | is modified. |
| 24 | 24 | ||
| 25 | @d banner "This is CTANGLE (Version 3.4pc/big)\n" | 25 | @d banner "This is CTANGLE (Version 3.43pc/big)\n" |
| 26 | @z | 26 | @z |
| 27 | 27 | ||
| 28 | 28 | ||
| @@ -9,9 +9,9 @@ that allows >64K arrays. If you need lots of bytes and toks, try the · 8 unmodified lines | |||
| 9 | alternate change files with -bs suffix instead of -pc. | 9 | alternate change files with -bs suffix instead of -pc. |
| 10 | 10 | ||
| 11 | @x section 1 | 11 | @x section 1 |
| 12 | @d banner "This is CTANGLE (Version 3.4)\n" | 12 | @d banner "This is CTANGLE (Version 3.43)\n" |
| 13 | @y | 13 | @y |
| 14 | @d banner "This is CTANGLE (Version 3.4pc)\n" | 14 | @d banner "This is CTANGLE (Version 3.43pc)\n" |
| 15 | @z | 15 | @z |
| 16 | @x section 4 | 16 | @x section 4 |
| 17 | @d max_bytes 90000 /* the number of bytes in identifiers, | 17 | @d max_bytes 90000 /* the number of bytes in identifiers, |
| @@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c -=500000 ctangle_c" · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | @x | 9 | @x |
| 10 | \def\title{CTANGLE (Version 3.4)} | 10 | \def\title{CTANGLE (Version 3.43)} |
| 11 | @y | 11 | @y |
| 12 | \def\title{CTANGLE (QL Version 3.4)} | 12 | \def\title{CTANGLE (QL Version 3.43)} |
| 13 | @z | 13 | @z |
| 14 | 14 | ||
| 15 | @x section 1 | 15 | @x section 1 |
| 16 | @d banner "This is CTANGLE (Version 3.4)\n" | 16 | @d banner "This is CTANGLE (Version 3.43)\n" |
| 17 | @y | 17 | @y |
| 18 | @d banner "This is CTANGLE (QL Version 3.4)\n" | 18 | @d banner "This is CTANGLE (QL Version 3.43)\n" |
| 19 | @z | 19 | @z |
| 20 | 20 | ||
| 21 | @x | 21 | @x |
| @@ -10,9 +10,9 @@ created: · 9 unmodified lines | |||
| 10 | (these changes not necessary for initial bootstrapping) | 10 | (these changes not necessary for initial bootstrapping) |
| 11 | 11 | ||
| 12 | @x section 1 (01-FEB-1992 ST) | 12 | @x section 1 (01-FEB-1992 ST) |
| 13 | @d banner "This is CTANGLE (Version 3.4)\n" | 13 | @d banner "This is CTANGLE (Version 3.43)\n" |
| 14 | @y | 14 | @y |
| 15 | @d banner "This is CTANGLE (VAX/VMS Version 3.4)\n" | 15 | @d banner "This is CTANGLE (VAX/VMS Version 3.43)\n" |
| 16 | @z | 16 | @z |
| 17 | 17 | ||
| 18 | @x section 6 (from common.h) (01-FEB-1992 ST) | 18 | @x section 6 (from common.h) (01-FEB-1992 ST) |
| @@ -4,18 +4,18 @@ · 3 unmodified lines | |||
| 4 | /*6:*/ | 4 | /*6:*/ |
| 5 | #line 35 "common.h" | 5 | #line 35 "common.h" |
| 6 | 6 | ||
| 7 | #include <stdio.h> | 7 | #include <stdio.h> |
| 8 | 8 | ||
| 9 | /*:6*//*62:*/ | 9 | /*:6*//*62:*/ |
| 10 | #line 881 "ctangle.w" | 10 | #line 882 "ctangle.w" |
| 11 | 11 | ||
| 12 | #include <ctype.h> | 12 | #include <ctype.h> |
| 13 | #include <stdlib.h> | 13 | #include <stdlib.h> |
| 14 | 14 | ||
| 15 | /*:62*/ | 15 | /*:62*/ |
| 16 | #line 62 "ctangle.w" | 16 | #line 62 "ctangle.w" |
| 17 | 17 | ||
| 18 | #define banner "This is CTANGLE (Version 3.4)\n" \ | 18 | #define banner "This is CTANGLE (Version 3.43)\n" \ |
| 19 | 19 | ||
| 20 | #define max_bytes 90000 \ | 20 | #define max_bytes 90000 \ |
| 21 | 21 | ||
| @@ -24,7 +24,7 @@ · 2 unmodified lines | |||
| 24 | 24 | ||
| 25 | #define max_texts 2500 | 25 | #define max_texts 2500 |
| 26 | #define hash_size 353 | 26 | #define hash_size 353 |
| 27 | #define longest_name 1000 | 27 | #define longest_name 10000 |
| 28 | #define stack_size 50 | 28 | #define stack_size 50 |
| 29 | #define buf_size 100 \ | 29 | #define buf_size 100 \ |
| 30 | 30 | ||
| @@ -127,7 +127,7 @@ · 96 unmodified lines | |||
| 127 | #define constant 03 \ | 127 | #define constant 03 \ |
| 128 | 128 | ||
| 129 | #define isxalpha(c) ((c) =='_') | 129 | #define isxalpha(c) ((c) =='_') |
| 130 | #define ishigh(c) ((unsigned char) (c) >0177) \ | 130 | #define ishigh(c) ((unsigned char) (c) > 0177) \ |
| 131 | \ | 131 | \ |
| 132 | 132 | ||
| 133 | #define compress(c) if(loc++<=limit) return(c) \ | 133 | #define compress(c) if(loc++<=limit) return(c) \ |
| @@ -328,34 +328,34 @@ char output_file_name[longest_name]; · 194 unmodified lines | |||
| 328 | boolean output_defs_seen= 0; | 328 | boolean output_defs_seen= 0; |
| 329 | 329 | ||
| 330 | /*:45*//*51:*/ | 330 | /*:45*//*51:*/ |
| 331 | #line 706 "ctangle.w" | 331 | #line 707 "ctangle.w" |
| 332 | 332 | ||
| 333 | char translit[128][translit_length]; | 333 | char translit[128][translit_length]; |
| 334 | 334 | ||
| 335 | /*:51*//*56:*/ | 335 | /*:51*//*56:*/ |
| 336 | #line 782 "ctangle.w" | 336 | #line 783 "ctangle.w" |
| 337 | 337 | ||
| 338 | eight_bits ccode[256]; | 338 | eight_bits ccode[256]; |
| 339 | 339 | ||
| 340 | /*:56*//*59:*/ | 340 | /*:56*//*59:*/ |
| 341 | #line 838 "ctangle.w" | 341 | #line 839 "ctangle.w" |
| 342 | 342 | ||
| 343 | boolean comment_continues= 0; | 343 | boolean comment_continues= 0; |
| 344 | 344 | ||
| 345 | /*:59*//*61:*/ | 345 | /*:59*//*61:*/ |
| 346 | #line 877 "ctangle.w" | 346 | #line 878 "ctangle.w" |
| 347 | 347 | ||
| 348 | name_pointer cur_section_name; | 348 | name_pointer cur_section_name; |
| 349 | int no_where; | 349 | int no_where; |
| 350 | 350 | ||
| 351 | /*:61*//*75:*/ | 351 | /*:61*//*75:*/ |
| 352 | #line 1191 "ctangle.w" | 352 | #line 1192 "ctangle.w" |
| 353 | 353 | ||
| 354 | text_pointer cur_text; | 354 | text_pointer cur_text; |
| 355 | eight_bits next_control; | 355 | eight_bits next_control; |
| 356 | 356 | ||
| 357 | /*:75*//*82:*/ | 357 | /*:75*//*82:*/ |
| 358 | #line 1341 "ctangle.w" | 358 | #line 1342 "ctangle.w" |
| 359 | 359 | ||
| 360 | extern sixteen_bits section_count; | 360 | extern sixteen_bits section_count; |
| 361 | 361 | ||
| @@ -387,12 +387,12 @@ void output_defs(); · 25 unmodified lines | |||
| 387 | static void out_char(); | 387 | static void out_char(); |
| 388 | 388 | ||
| 389 | /*:48*//*90:*/ | 389 | /*:48*//*90:*/ |
| 390 | #line 1448 "ctangle.w" | 390 | #line 1449 "ctangle.w" |
| 391 | 391 | ||
| 392 | void phase_one(); | 392 | void phase_one(); |
| 393 | 393 | ||
| 394 | /*:90*//*92:*/ | 394 | /*:90*//*92:*/ |
| 395 | #line 1466 "ctangle.w" | 395 | #line 1467 "ctangle.w" |
| 396 | 396 | ||
| 397 | void skip_limbo(); | 397 | void skip_limbo(); |
| 398 | 398 | ||
| @@ -431,7 +431,7 @@ last_unnamed= text_info;text_info->text_link= 0; · 32 unmodified lines | |||
| 431 | cur_out_file= end_output_files= output_files+max_files; | 431 | cur_out_file= end_output_files= output_files+max_files; |
| 432 | 432 | ||
| 433 | /*:39*//*52:*/ | 433 | /*:39*//*52:*/ |
| 434 | #line 709 "ctangle.w" | 434 | #line 710 "ctangle.w" |
| 435 | 435 | ||
| 436 | { | 436 | { |
| 437 | int i; | 437 | int i; |
| @@ -439,7 +439,7 @@ for(i= 0;i<128;i++)sprintf(translit[i],"X%02X",(unsigned)(128+i)); · 1 unmodified line | |||
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | /*:52*//*57:*/ | 441 | /*:52*//*57:*/ |
| 442 | #line 785 "ctangle.w" | 442 | #line 786 "ctangle.w" |
| 443 | { | 443 | { |
| 444 | int c; | 444 | int c; |
| 445 | for(c= 0;c<256;c++)ccode[c]= ignore; | 445 | for(c= 0;c<256;c++)ccode[c]= ignore; |
| @@ -459,7 +459,7 @@ ccode['\'']= ord; · 13 unmodified lines | |||
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | /*:57*//*71:*/ | 461 | /*:57*//*71:*/ |
| 462 | #line 1112 "ctangle.w" | 462 | #line 1113 "ctangle.w" |
| 463 | section_text[0]= ' '; | 463 | section_text[0]= ' '; |
| 464 | 464 | ||
| 465 | /*:71*/ | 465 | /*:71*/ |
| @@ -503,7 +503,7 @@ void · 37 unmodified lines | |||
| 503 | store_two_bytes(x) | 503 | store_two_bytes(x) |
| 504 | sixteen_bits x; | 504 | sixteen_bits x; |
| 505 | { | 505 | { |
| 506 | if(tok_ptr+2>tok_mem_end)overflow("token"); | 506 | if(tok_ptr+2> tok_mem_end)overflow("token"); |
| 507 | *tok_ptr++= x>>8; | 507 | *tok_ptr++= x>>8; |
| 508 | *tok_ptr++= x&0377; | 508 | *tok_ptr++= x&0377; |
| 509 | } | 509 | } |
| @@ -538,7 +538,7 @@ cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start; · 28 unmodified lines | |||
| 538 | return; | 538 | return; |
| 539 | } | 539 | } |
| 540 | stack_ptr--; | 540 | stack_ptr--; |
| 541 | if(stack_ptr>stack)cur_state= *stack_ptr; | 541 | if(stack_ptr> stack)cur_state= *stack_ptr; |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /*:31*//*33:*/ | 544 | /*:31*//*33:*/ |
| @@ -582,7 +582,7 @@ goto restart; · 37 unmodified lines | |||
| 582 | #line 409 "ctangle.w" | 582 | #line 409 "ctangle.w" |
| 583 | ; | 583 | ; |
| 584 | break; | 584 | break; |
| 585 | default:cur_val= a-050000;if(cur_val>0)cur_section= cur_val; | 585 | default:cur_val= a-050000;if(cur_val> 0)cur_section= cur_val; |
| 586 | out_char(section_number); | 586 | out_char(section_number); |
| 587 | } | 587 | } |
| 588 | } | 588 | } |
| @@ -646,12 +646,12 @@ update_terminal; · 57 unmodified lines | |||
| 646 | } | 646 | } |
| 647 | if(text_info->text_link==0)goto writeloop; | 647 | if(text_info->text_link==0)goto writeloop; |
| 648 | } | 648 | } |
| 649 | while(stack_ptr>stack)get_output(); | 649 | while(stack_ptr> stack)get_output(); |
| 650 | flush_buffer(); | 650 | flush_buffer(); |
| 651 | writeloop:/*43:*/ | 651 | writeloop:/*43:*/ |
| 652 | #line 569 "ctangle.w" | 652 | #line 569 "ctangle.w" |
| 653 | 653 | ||
| 654 | for(an_output_file= end_output_files;an_output_file>cur_out_file;){ | 654 | for(an_output_file= end_output_files;an_output_file> cur_out_file;){ |
| 655 | an_output_file--; | 655 | an_output_file--; |
| 656 | sprint_section_name(output_file_name,*an_output_file); | 656 | sprint_section_name(output_file_name,*an_output_file); |
| 657 | fclose(C_file); | 657 | fclose(C_file); |
| @@ -665,7 +665,7 @@ cur_name= (*an_output_file); · 7 unmodified lines | |||
| 665 | cur_repl= (text_pointer)cur_name->equiv; | 665 | cur_repl= (text_pointer)cur_name->equiv; |
| 666 | cur_byte= cur_repl->tok_start; | 666 | cur_byte= cur_repl->tok_start; |
| 667 | cur_end= (cur_repl+1)->tok_start; | 667 | cur_end= (cur_repl+1)->tok_start; |
| 668 | while(stack_ptr>stack)get_output(); | 668 | while(stack_ptr> stack)get_output(); |
| 669 | flush_buffer(); | 669 | flush_buffer(); |
| 670 | } | 670 | } |
| 671 | 671 | ||
| @@ -726,11 +726,11 @@ eight_bits cur_char; · 54 unmodified lines | |||
| 726 | char*j,*k; | 726 | char*j,*k; |
| 727 | restart: | 727 | restart: |
| 728 | switch(cur_char){ | 728 | switch(cur_char){ |
| 729 | case'\n':if(protect)C_putc(' '); | 729 | case'\n':if(protect&&out_state!=verbatim)C_putc(' '); |
| 730 | if(protect||out_state==verbatim)C_putc('\\'); | 730 | if(protect||out_state==verbatim)C_putc('\\'); |
| 731 | flush_buffer();if(out_state!=verbatim)out_state= normal;break; | 731 | flush_buffer();if(out_state!=verbatim)out_state= normal;break; |
| 732 | /*53:*/ | 732 | /*53:*/ |
| 733 | #line 715 "ctangle.w" | 733 | #line 716 "ctangle.w" |
| 734 | 734 | ||
| 735 | case identifier: | 735 | case identifier: |
| 736 | if(out_state==num_or_id)C_putc(' '); | 736 | if(out_state==num_or_id)C_putc(' '); |
| @@ -748,10 +748,10 @@ out_state= num_or_id;break; · 11 unmodified lines | |||
| 748 | #line 659 "ctangle.w" | 748 | #line 659 "ctangle.w" |
| 749 | ; | 749 | ; |
| 750 | /*54:*/ | 750 | /*54:*/ |
| 751 | #line 728 "ctangle.w" | 751 | #line 729 "ctangle.w" |
| 752 | 752 | ||
| 753 | case section_number: | 753 | case section_number: |
| 754 | if(cur_val>0)C_printf("/*%d:*/",cur_val); | 754 | if(cur_val> 0)C_printf("/*%d:*/",cur_val); |
| 755 | else if(cur_val<0)C_printf("/*:%d*/",-cur_val); | 755 | else if(cur_val<0)C_printf("/*:%d*/",-cur_val); |
| 756 | else if(protect){ | 756 | else if(protect){ |
| 757 | cur_byte+= 4; | 757 | cur_byte+= 4; |
| @@ -775,7 +775,7 @@ break; · 17 unmodified lines | |||
| 775 | #line 660 "ctangle.w" | 775 | #line 660 "ctangle.w" |
| 776 | ; | 776 | ; |
| 777 | /*50:*/ | 777 | /*50:*/ |
| 778 | #line 677 "ctangle.w" | 778 | #line 678 "ctangle.w" |
| 779 | 779 | ||
| 780 | case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; | 780 | case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; |
| 781 | case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; | 781 | case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; |
| @@ -798,7 +798,8 @@ break; · 16 unmodified lines | |||
| 798 | /*:50*/ | 798 | /*:50*/ |
| 799 | #line 661 "ctangle.w" | 799 | #line 661 "ctangle.w" |
| 800 | ; | 800 | ; |
| 801 | case'=':C_putc('=');C_putc(' ');out_state= normal;break; | 801 | case'=':case'>':C_putc(cur_char);C_putc(' '); |
| 802 | out_state= normal;break; | ||
| 802 | case join:out_state= unbreakable;break; | 803 | case join:out_state= unbreakable;break; |
| 803 | case constant:if(out_state==verbatim){ | 804 | case constant:if(out_state==verbatim){ |
| 804 | out_state= num_or_id;break; | 805 | out_state= num_or_id;break; |
| @@ -814,14 +815,14 @@ default:C_putc(cur_char);out_state= normal;break; · 9 unmodified lines | |||
| 814 | } | 815 | } |
| 815 | 816 | ||
| 816 | /*:49*//*58:*/ | 817 | /*:49*//*58:*/ |
| 817 | #line 806 "ctangle.w" | 818 | #line 807 "ctangle.w" |
| 818 | 819 | ||
| 819 | eight_bits | 820 | eight_bits |
| 820 | skip_ahead() | 821 | skip_ahead() |
| 821 | { | 822 | { |
| 822 | eight_bits c; | 823 | eight_bits c; |
| 823 | while(1){ | 824 | while(1){ |
| 824 | if(loc>limit&&(get_line()==0))return(new_section); | 825 | if(loc> limit&&(get_line()==0))return(new_section); |
| 825 | *(limit+1)= '@'; | 826 | *(limit+1)= '@'; |
| 826 | while(*loc!='@')loc++; | 827 | while(*loc!='@')loc++; |
| 827 | if(loc<=limit){ | 828 | if(loc<=limit){ |
| @@ -832,14 +833,14 @@ if(c!=ignore||*(loc-1)=='>')return(c); · 4 unmodified lines | |||
| 832 | } | 833 | } |
| 833 | 834 | ||
| 834 | /*:58*//*60:*/ | 835 | /*:58*//*60:*/ |
| 835 | #line 841 "ctangle.w" | 836 | #line 842 "ctangle.w" |
| 836 | 837 | ||
| 837 | int skip_comment(is_long_comment) | 838 | int skip_comment(is_long_comment) |
| 838 | boolean is_long_comment; | 839 | boolean is_long_comment; |
| 839 | { | 840 | { |
| 840 | char c; | 841 | char c; |
| 841 | while(1){ | 842 | while(1){ |
| 842 | if(loc>limit){ | 843 | if(loc> limit){ |
| 843 | if(is_long_comment){ | 844 | if(is_long_comment){ |
| 844 | if(get_line())return(comment_continues= 1); | 845 | if(get_line())return(comment_continues= 1); |
| 845 | else{ | 846 | else{ |
| @@ -866,7 +867,7 @@ else loc++; · 20 unmodified lines | |||
| 866 | } | 867 | } |
| 867 | 868 | ||
| 868 | /*:60*//*63:*/ | 869 | /*:60*//*63:*/ |
| 869 | #line 892 "ctangle.w" | 870 | #line 893 "ctangle.w" |
| 870 | 871 | ||
| 871 | eight_bits | 872 | eight_bits |
| 872 | get_next() | 873 | get_next() |
| @@ -874,13 +875,13 @@ get_next() · 1 unmodified line | |||
| 874 | static int preprocessing= 0; | 875 | static int preprocessing= 0; |
| 875 | eight_bits c; | 876 | eight_bits c; |
| 876 | while(1){ | 877 | while(1){ |
| 877 | if(loc>limit){ | 878 | if(loc> limit){ |
| 878 | if(preprocessing&&*(limit-1)!='\\')preprocessing= 0; | 879 | if(preprocessing&&*(limit-1)!='\\')preprocessing= 0; |
| 879 | if(get_line()==0)return(new_section); | 880 | if(get_line()==0)return(new_section); |
| 880 | else if(print_where&&!no_where){ | 881 | else if(print_where&&!no_where){ |
| 881 | print_where= 0; | 882 | print_where= 0; |
| 882 | /*77:*/ | 883 | /*77:*/ |
| 883 | #line 1221 "ctangle.w" | 884 | #line 1222 "ctangle.w" |
| 884 | 885 | ||
| 885 | store_two_bytes(0150000); | 886 | store_two_bytes(0150000); |
| 886 | if(changing)id_first= change_file_name; | 887 | if(changing)id_first= change_file_name; |
| @@ -892,7 +893,7 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines | |||
| 892 | app_repl(a%0400);} | 893 | app_repl(a%0400);} |
| 893 | 894 | ||
| 894 | /*:77*/ | 895 | /*:77*/ |
| 895 | #line 904 "ctangle.w" | 896 | #line 905 "ctangle.w" |
| 896 | ; | 897 | ; |
| 897 | } | 898 | } |
| 898 | else return('\n'); | 899 | else return('\n'); |
| @@ -906,7 +907,7 @@ else continue; · 7 unmodified lines | |||
| 906 | } | 907 | } |
| 907 | loc++; | 908 | loc++; |
| 908 | if(xisdigit(c)||c=='\\'||c=='.')/*66:*/ | 909 | if(xisdigit(c)||c=='\\'||c=='.')/*66:*/ |
| 909 | #line 970 "ctangle.w" | 910 | #line 971 "ctangle.w" |
| 910 | { | 911 | { |
| 911 | id_first= loc-1; | 912 | id_first= loc-1; |
| 912 | if(*id_first=='.'&&!xisdigit(*loc))goto mistake; | 913 | if(*id_first=='.'&&!xisdigit(*loc))goto mistake; |
| @@ -934,11 +935,11 @@ return(constant); · 21 unmodified lines | |||
| 934 | } | 935 | } |
| 935 | 936 | ||
| 936 | /*:66*/ | 937 | /*:66*/ |
| 937 | #line 916 "ctangle.w" | 938 | #line 917 "ctangle.w" |
| 938 | 939 | ||
| 939 | else if(c=='\''||c=='"'||(c=='L'&&(*loc=='\''||*loc=='"'))) | 940 | else if(c=='\''||c=='"'||(c=='L'&&(*loc=='\''||*loc=='"'))) |
| 940 | /*67:*/ | 941 | /*67:*/ |
| 941 | #line 1001 "ctangle.w" | 942 | #line 1002 "ctangle.w" |
| 942 | { | 943 | { |
| 943 | char delim= c; | 944 | char delim= c; |
| 944 | id_first= section_text+1; | 945 | id_first= section_text+1; |
| @@ -981,11 +982,11 @@ return(string); · 36 unmodified lines | |||
| 981 | } | 982 | } |
| 982 | 983 | ||
| 983 | /*:67*/ | 984 | /*:67*/ |
| 984 | #line 918 "ctangle.w" | 985 | #line 919 "ctangle.w" |
| 985 | 986 | ||
| 986 | else if(isalpha(c)||isxalpha(c)||ishigh(c)) | 987 | else if(isalpha(c)||isxalpha(c)||ishigh(c)) |
| 987 | /*65:*/ | 988 | /*65:*/ |
| 988 | #line 964 "ctangle.w" | 989 | #line 965 "ctangle.w" |
| 989 | { | 990 | { |
| 990 | id_first= --loc; | 991 | id_first= --loc; |
| 991 | while(isalpha(*++loc)||isdigit(*loc)||isxalpha(*loc)||ishigh(*loc)); | 992 | while(isalpha(*++loc)||isdigit(*loc)||isxalpha(*loc)||ishigh(*loc)); |
| @@ -993,10 +994,10 @@ id_loc= loc;return(identifier); · 1 unmodified line | |||
| 993 | } | 994 | } |
| 994 | 995 | ||
| 995 | /*:65*/ | 996 | /*:65*/ |
| 996 | #line 920 "ctangle.w" | 997 | #line 921 "ctangle.w" |
| 997 | 998 | ||
| 998 | else if(c=='@')/*68:*/ | 999 | else if(c=='@')/*68:*/ |
| 999 | #line 1045 "ctangle.w" | 1000 | #line 1046 "ctangle.w" |
| 1000 | { | 1001 | { |
| 1001 | c= ccode[(eight_bits)*loc++]; | 1002 | c= ccode[(eight_bits)*loc++]; |
| 1002 | switch(c){ | 1003 | switch(c){ |
| @@ -1013,22 +1014,22 @@ continue; · 10 unmodified lines | |||
| 1013 | case section_name: | 1014 | case section_name: |
| 1014 | cur_section_name_char= *(loc-1); | 1015 | cur_section_name_char= *(loc-1); |
| 1015 | /*70:*/ | 1016 | /*70:*/ |
| 1016 | #line 1094 "ctangle.w" | 1017 | #line 1095 "ctangle.w" |
| 1017 | { | 1018 | { |
| 1018 | char*k; | 1019 | char*k; |
| 1019 | /*72:*/ | 1020 | /*72:*/ |
| 1020 | #line 1114 "ctangle.w" | 1021 | #line 1115 "ctangle.w" |
| 1021 | 1022 | ||
| 1022 | k= section_text; | 1023 | k= section_text; |
| 1023 | while(1){ | 1024 | while(1){ |
| 1024 | if(loc>limit&&get_line()==0){ | 1025 | if(loc> limit&&get_line()==0){ |
| 1025 | err_print("! Input ended in section name"); | 1026 | err_print("! Input ended in section name"); |
| 1026 | 1027 | ||
| 1027 | loc= buffer+1;break; | 1028 | loc= buffer+1;break; |
| 1028 | } | 1029 | } |
| 1029 | c= *loc; | 1030 | c= *loc; |
| 1030 | /*73:*/ | 1031 | /*73:*/ |
| 1031 | #line 1138 "ctangle.w" | 1032 | #line 1139 "ctangle.w" |
| 1032 | 1033 | ||
| 1033 | if(c=='@'){ | 1034 | if(c=='@'){ |
| 1034 | c= *(loc+1); | 1035 | c= *(loc+1); |
| @@ -1047,7 +1048,7 @@ err_print("! Nesting of section names not allowed");break; · 12 unmodified lines | |||
| 1047 | } | 1048 | } |
| 1048 | 1049 | ||
| 1049 | /*:73*/ | 1050 | /*:73*/ |
| 1050 | #line 1123 "ctangle.w" | 1051 | #line 1124 "ctangle.w" |
| 1051 | ; | 1052 | ; |
| 1052 | loc++;if(k<section_text_end)k++; | 1053 | loc++;if(k<section_text_end)k++; |
| 1053 | if(xisspace(c)){ | 1054 | if(xisspace(c)){ |
| @@ -1061,12 +1062,12 @@ printf("\n! Section name too long: "); · 7 unmodified lines | |||
| 1061 | term_write(section_text+1,25); | 1062 | term_write(section_text+1,25); |
| 1062 | printf("...");mark_harmless; | 1063 | printf("...");mark_harmless; |
| 1063 | } | 1064 | } |
| 1064 | if(*k==' '&&k>section_text)k--; | 1065 | if(*k==' '&&k> section_text)k--; |
| 1065 | 1066 | ||
| 1066 | /*:72*/ | 1067 | /*:72*/ |
| 1067 | #line 1096 "ctangle.w" | 1068 | #line 1097 "ctangle.w" |
| 1068 | ; | 1069 | ; |
| 1069 | if(k-section_text>3&&strncmp(k-2,"...",3)==0) | 1070 | if(k-section_text> 3&&strncmp(k-2,"...",3)==0) |
| 1070 | cur_section_name= section_lookup(section_text+1,k-3,1); | 1071 | cur_section_name= section_lookup(section_text+1,k-3,1); |
| 1071 | else cur_section_name= section_lookup(section_text+1,k,0); | 1072 | else cur_section_name= section_lookup(section_text+1,k,0); |
| 1072 | if(cur_section_name_char=='(') | 1073 | if(cur_section_name_char=='(') |
| @@ -1078,7 +1079,7 @@ for(an_output_file= cur_out_file; · 5 unmodified lines | |||
| 1078 | an_output_file<end_output_files;an_output_file++) | 1079 | an_output_file<end_output_files;an_output_file++) |
| 1079 | if(*an_output_file==cur_section_name)break; | 1080 | if(*an_output_file==cur_section_name)break; |
| 1080 | if(an_output_file==end_output_files){ | 1081 | if(an_output_file==end_output_files){ |
| 1081 | if(cur_out_file>output_files) | 1082 | if(cur_out_file> output_files) |
| 1082 | *--cur_out_file= cur_section_name; | 1083 | *--cur_out_file= cur_section_name; |
| 1083 | else{ | 1084 | else{ |
| 1084 | overflow("output files"); | 1085 | overflow("output files"); |
| @@ -1087,16 +1088,16 @@ overflow("output files"); · 2 unmodified lines | |||
| 1087 | } | 1088 | } |
| 1088 | 1089 | ||
| 1089 | /*:40*/ | 1090 | /*:40*/ |
| 1090 | #line 1102 "ctangle.w" | 1091 | #line 1103 "ctangle.w" |
| 1091 | ; | 1092 | ; |
| 1092 | return(section_name); | 1093 | return(section_name); |
| 1093 | } | 1094 | } |
| 1094 | 1095 | ||
| 1095 | /*:70*/ | 1096 | /*:70*/ |
| 1096 | #line 1060 "ctangle.w" | 1097 | #line 1061 "ctangle.w" |
| 1097 | ; | 1098 | ; |
| 1098 | case string:/*74:*/ | 1099 | case string:/*74:*/ |
| 1099 | #line 1160 "ctangle.w" | 1100 | #line 1161 "ctangle.w" |
| 1100 | { | 1101 | { |
| 1101 | id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; | 1102 | id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; |
| 1102 | while(*loc!='@'||*(loc+1)!='>')loc++; | 1103 | while(*loc!='@'||*(loc+1)!='>')loc++; |
| @@ -1107,10 +1108,10 @@ return(string); · 4 unmodified lines | |||
| 1107 | } | 1108 | } |
| 1108 | 1109 | ||
| 1109 | /*:74*/ | 1110 | /*:74*/ |
| 1110 | #line 1061 "ctangle.w" | 1111 | #line 1062 "ctangle.w" |
| 1111 | ; | 1112 | ; |
| 1112 | case ord:/*69:*/ | 1113 | case ord:/*69:*/ |
| 1113 | #line 1073 "ctangle.w" | 1114 | #line 1074 "ctangle.w" |
| 1114 | 1115 | ||
| 1115 | id_first= loc; | 1116 | id_first= loc; |
| 1116 | if(*loc=='\\'){ | 1117 | if(*loc=='\\'){ |
| @@ -1124,7 +1125,7 @@ err_print("! Double @ should be used in ASCII constant"); · 7 unmodified lines | |||
| 1124 | else loc++; | 1125 | else loc++; |
| 1125 | } | 1126 | } |
| 1126 | loc++; | 1127 | loc++; |
| 1127 | if(loc>limit){ | 1128 | if(loc> limit){ |
| 1128 | err_print("! String didn't end");loc= limit-1;break; | 1129 | err_print("! String didn't end");loc= limit-1;break; |
| 1129 | 1130 | ||
| 1130 | } | 1131 | } |
| @@ -1133,23 +1134,23 @@ loc++; · 2 unmodified lines | |||
| 1133 | return(ord); | 1134 | return(ord); |
| 1134 | 1135 | ||
| 1135 | /*:69*/ | 1136 | /*:69*/ |
| 1136 | #line 1062 "ctangle.w" | 1137 | #line 1063 "ctangle.w" |
| 1137 | ; | 1138 | ; |
| 1138 | default:return(c); | 1139 | default:return(c); |
| 1139 | } | 1140 | } |
| 1140 | } | 1141 | } |
| 1141 | 1142 | ||
| 1142 | /*:68*/ | 1143 | /*:68*/ |
| 1143 | #line 921 "ctangle.w" | 1144 | #line 922 "ctangle.w" |
| 1144 | 1145 | ||
| 1145 | else if(xisspace(c)){ | 1146 | else if(xisspace(c)){ |
| 1146 | if(!preprocessing||loc>limit)continue; | 1147 | if(!preprocessing||loc> limit)continue; |
| 1147 | 1148 | ||
| 1148 | else return(' '); | 1149 | else return(' '); |
| 1149 | } | 1150 | } |
| 1150 | else if(c=='#'&&loc==buffer+1)preprocessing= 1; | 1151 | else if(c=='#'&&loc==buffer+1)preprocessing= 1; |
| 1151 | mistake:/*64:*/ | 1152 | mistake:/*64:*/ |
| 1152 | #line 942 "ctangle.w" | 1153 | #line 943 "ctangle.w" |
| 1153 | 1154 | ||
| 1154 | switch(c){ | 1155 | switch(c){ |
| 1155 | case'+':if(*loc=='+')compress(plus_plus);break; | 1156 | case'+':if(*loc=='+')compress(plus_plus);break; |
| @@ -1173,14 +1174,14 @@ case'!':if(*loc=='=')compress(not_eq);break; · 17 unmodified lines | |||
| 1173 | } | 1174 | } |
| 1174 | 1175 | ||
| 1175 | /*:64*/ | 1176 | /*:64*/ |
| 1176 | #line 928 "ctangle.w" | 1177 | #line 929 "ctangle.w" |
| 1177 | 1178 | ||
| 1178 | return(c); | 1179 | return(c); |
| 1179 | } | 1180 | } |
| 1180 | } | 1181 | } |
| 1181 | 1182 | ||
| 1182 | /*:63*//*76:*/ | 1183 | /*:63*//*76:*/ |
| 1183 | #line 1195 "ctangle.w" | 1184 | #line 1196 "ctangle.w" |
| 1184 | 1185 | ||
| 1185 | void | 1186 | void |
| 1186 | scan_repl(t) | 1187 | scan_repl(t) |
| @@ -1188,7 +1189,7 @@ eight_bits t; · 1 unmodified line | |||
| 1188 | { | 1189 | { |
| 1189 | sixteen_bits a; | 1190 | sixteen_bits a; |
| 1190 | if(t==section_name){/*77:*/ | 1191 | if(t==section_name){/*77:*/ |
| 1191 | #line 1221 "ctangle.w" | 1192 | #line 1222 "ctangle.w" |
| 1192 | 1193 | ||
| 1193 | store_two_bytes(0150000); | 1194 | store_two_bytes(0150000); |
| 1194 | if(changing)id_first= change_file_name; | 1195 | if(changing)id_first= change_file_name; |
| @@ -1200,11 +1201,11 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines | |||
| 1200 | app_repl(a%0400);} | 1201 | app_repl(a%0400);} |
| 1201 | 1202 | ||
| 1202 | /*:77*/ | 1203 | /*:77*/ |
| 1203 | #line 1201 "ctangle.w" | 1204 | #line 1202 "ctangle.w" |
| 1204 | ;} | 1205 | ;} |
| 1205 | while(1)switch(a= get_next()){ | 1206 | while(1)switch(a= get_next()){ |
| 1206 | /*78:*/ | 1207 | /*78:*/ |
| 1207 | #line 1231 "ctangle.w" | 1208 | #line 1232 "ctangle.w" |
| 1208 | 1209 | ||
| 1209 | case identifier:a= id_lookup(id_first,id_loc,0)-name_dir; | 1210 | case identifier:a= id_lookup(id_first,id_loc,0)-name_dir; |
| 1210 | app_repl((a/0400)+0200); | 1211 | app_repl((a/0400)+0200); |
| @@ -1212,7 +1213,7 @@ app_repl(a%0400);break; · 1 unmodified line | |||
| 1212 | case section_name:if(t!=section_name)goto done; | 1213 | case section_name:if(t!=section_name)goto done; |
| 1213 | else{ | 1214 | else{ |
| 1214 | /*79:*/ | 1215 | /*79:*/ |
| 1215 | #line 1259 "ctangle.w" | 1216 | #line 1260 "ctangle.w" |
| 1216 | { | 1217 | { |
| 1217 | char*try_loc= loc; | 1218 | char*try_loc= loc; |
| 1218 | while(*try_loc==' '&&try_loc<limit)try_loc++; | 1219 | while(*try_loc==' '&&try_loc<limit)try_loc++; |
| @@ -1225,13 +1226,13 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); · 6 unmodified lines | |||
| 1225 | } | 1226 | } |
| 1226 | 1227 | ||
| 1227 | /*:79*/ | 1228 | /*:79*/ |
| 1228 | #line 1237 "ctangle.w" | 1229 | #line 1238 "ctangle.w" |
| 1229 | ; | 1230 | ; |
| 1230 | a= cur_section_name-name_dir; | 1231 | a= cur_section_name-name_dir; |
| 1231 | app_repl((a/0400)+0250); | 1232 | app_repl((a/0400)+0250); |
| 1232 | app_repl(a%0400); | 1233 | app_repl(a%0400); |
| 1233 | /*77:*/ | 1234 | /*77:*/ |
| 1234 | #line 1221 "ctangle.w" | 1235 | #line 1222 "ctangle.w" |
| 1235 | 1236 | ||
| 1236 | store_two_bytes(0150000); | 1237 | store_two_bytes(0150000); |
| 1237 | if(changing)id_first= change_file_name; | 1238 | if(changing)id_first= change_file_name; |
| @@ -1243,7 +1244,7 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines | |||
| 1243 | app_repl(a%0400);} | 1244 | app_repl(a%0400);} |
| 1244 | 1245 | ||
| 1245 | /*:77*/ | 1246 | /*:77*/ |
| 1246 | #line 1241 "ctangle.w" | 1247 | #line 1242 "ctangle.w" |
| 1247 | ;break; | 1248 | ;break; |
| 1248 | } | 1249 | } |
| 1249 | case output_defs_code: | 1250 | case output_defs_code: |
| @@ -1251,7 +1252,7 @@ a= output_defs_flag; · 1 unmodified line | |||
| 1251 | app_repl((a/0400)+0200); | 1252 | app_repl((a/0400)+0200); |
| 1252 | app_repl(a%0400); | 1253 | app_repl(a%0400); |
| 1253 | /*77:*/ | 1254 | /*77:*/ |
| 1254 | #line 1221 "ctangle.w" | 1255 | #line 1222 "ctangle.w" |
| 1255 | 1256 | ||
| 1256 | store_two_bytes(0150000); | 1257 | store_two_bytes(0150000); |
| 1257 | if(changing)id_first= change_file_name; | 1258 | if(changing)id_first= change_file_name; |
| @@ -1263,11 +1264,11 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines | |||
| 1263 | app_repl(a%0400);} | 1264 | app_repl(a%0400);} |
| 1264 | 1265 | ||
| 1265 | /*:77*/ | 1266 | /*:77*/ |
| 1266 | #line 1247 "ctangle.w" | 1267 | #line 1248 "ctangle.w" |
| 1267 | ;break; | 1268 | ;break; |
| 1268 | case constant:case string: | 1269 | case constant:case string: |
| 1269 | /*80:*/ | 1270 | /*80:*/ |
| 1270 | #line 1270 "ctangle.w" | 1271 | #line 1271 "ctangle.w" |
| 1271 | 1272 | ||
| 1272 | app_repl(a); | 1273 | app_repl(a); |
| 1273 | while(id_first<id_loc){ | 1274 | while(id_first<id_loc){ |
| @@ -1281,11 +1282,11 @@ app_repl(*id_first++); · 7 unmodified lines | |||
| 1281 | app_repl(a);break; | 1282 | app_repl(a);break; |
| 1282 | 1283 | ||
| 1283 | /*:80*/ | 1284 | /*:80*/ |
| 1284 | #line 1249 "ctangle.w" | 1285 | #line 1250 "ctangle.w" |
| 1285 | ; | 1286 | ; |
| 1286 | case ord: | 1287 | case ord: |
| 1287 | /*81:*/ | 1288 | /*81:*/ |
| 1288 | #line 1286 "ctangle.w" | 1289 | #line 1287 "ctangle.w" |
| 1289 | { | 1290 | { |
| 1290 | int c= (eight_bits)*id_first; | 1291 | int c= (eight_bits)*id_first; |
| 1291 | if(c=='\\'){ | 1292 | if(c=='\\'){ |
| @@ -1336,7 +1337,7 @@ app_repl(constant); · 44 unmodified lines | |||
| 1336 | break; | 1337 | break; |
| 1337 | 1338 | ||
| 1338 | /*:81*/ | 1339 | /*:81*/ |
| 1339 | #line 1251 "ctangle.w" | 1340 | #line 1252 "ctangle.w" |
| 1340 | ; | 1341 | ; |
| 1341 | case definition:case format_code:case begin_C:if(t!=section_name)goto done; | 1342 | case definition:case format_code:case begin_C:if(t!=section_name)goto done; |
| 1342 | else{ | 1343 | else{ |
| @@ -1346,7 +1347,7 @@ err_print("! @d, @f and @c are ignored in C text");continue; · 3 unmodified lines | |||
| 1346 | case new_section:goto done; | 1347 | case new_section:goto done; |
| 1347 | 1348 | ||
| 1348 | /*:78*/ | 1349 | /*:78*/ |
| 1349 | #line 1206 "ctangle.w" | 1350 | #line 1207 "ctangle.w" |
| 1350 | 1351 | ||
| 1351 | case')':app_repl(a); | 1352 | case')':app_repl(a); |
| 1352 | if(t==macro)app_repl(' '); | 1353 | if(t==macro)app_repl(' '); |
| @@ -1354,12 +1355,12 @@ break; · 1 unmodified line | |||
| 1354 | default:app_repl(a); | 1355 | default:app_repl(a); |
| 1355 | } | 1356 | } |
| 1356 | done:next_control= (eight_bits)a; | 1357 | done:next_control= (eight_bits)a; |
| 1357 | if(text_ptr>text_info_end)overflow("text"); | 1358 | if(text_ptr> text_info_end)overflow("text"); |
| 1358 | cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; | 1359 | cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; |
| 1359 | } | 1360 | } |
| 1360 | 1361 | ||
| 1361 | /*:76*//*83:*/ | 1362 | /*:76*//*83:*/ |
| 1362 | #line 1348 "ctangle.w" | 1363 | #line 1349 "ctangle.w" |
| 1363 | 1364 | ||
| 1364 | void | 1365 | void |
| 1365 | scan_section() | 1366 | scan_section() |
| @@ -1374,7 +1375,7 @@ printf("*%d",section_count);update_terminal; · 8 unmodified lines | |||
| 1374 | next_control= 0; | 1375 | next_control= 0; |
| 1375 | while(1){ | 1376 | while(1){ |
| 1376 | /*84:*/ | 1377 | /*84:*/ |
| 1377 | #line 1387 "ctangle.w" | 1378 | #line 1388 "ctangle.w" |
| 1378 | 1379 | ||
| 1379 | while(next_control<definition) | 1380 | while(next_control<definition) |
| 1380 | 1381 | ||
| @@ -1383,11 +1384,11 @@ loc-= 2;next_control= get_next(); · 2 unmodified lines | |||
| 1383 | } | 1384 | } |
| 1384 | 1385 | ||
| 1385 | /*:84*/ | 1386 | /*:84*/ |
| 1386 | #line 1362 "ctangle.w" | 1387 | #line 1363 "ctangle.w" |
| 1387 | ; | 1388 | ; |
| 1388 | if(next_control==definition){ | 1389 | if(next_control==definition){ |
| 1389 | /*85:*/ | 1390 | /*85:*/ |
| 1390 | #line 1394 "ctangle.w" | 1391 | #line 1395 "ctangle.w" |
| 1391 | { | 1392 | { |
| 1392 | while((next_control= get_next())=='\n'); | 1393 | while((next_control= get_next())=='\n'); |
| 1393 | if(next_control!=identifier){ | 1394 | if(next_control!=identifier){ |
| @@ -1406,7 +1407,7 @@ cur_text->text_link= 0; · 12 unmodified lines | |||
| 1406 | } | 1407 | } |
| 1407 | 1408 | ||
| 1408 | /*:85*/ | 1409 | /*:85*/ |
| 1409 | #line 1364 "ctangle.w" | 1410 | #line 1365 "ctangle.w" |
| 1410 | 1411 | ||
| 1411 | continue; | 1412 | continue; |
| 1412 | } | 1413 | } |
| @@ -1416,14 +1417,14 @@ p= name_dir;break; · 3 unmodified lines | |||
| 1416 | if(next_control==section_name){ | 1417 | if(next_control==section_name){ |
| 1417 | p= cur_section_name; | 1418 | p= cur_section_name; |
| 1418 | /*86:*/ | 1419 | /*86:*/ |
| 1419 | #line 1419 "ctangle.w" | 1420 | #line 1420 "ctangle.w" |
| 1420 | 1421 | ||
| 1421 | while((next_control= get_next())=='+'); | 1422 | while((next_control= get_next())=='+'); |
| 1422 | if(next_control!='='&&next_control!=eq_eq) | 1423 | if(next_control!='='&&next_control!=eq_eq) |
| 1423 | continue; | 1424 | continue; |
| 1424 | 1425 | ||
| 1425 | /*:86*/ | 1426 | /*:86*/ |
| 1426 | #line 1372 "ctangle.w" | 1427 | #line 1373 "ctangle.w" |
| 1427 | ; | 1428 | ; |
| 1428 | break; | 1429 | break; |
| 1429 | } | 1430 | } |
| @@ -1431,20 +1432,20 @@ return; · 1 unmodified line | |||
| 1431 | } | 1432 | } |
| 1432 | no_where= print_where= 0; | 1433 | no_where= print_where= 0; |
| 1433 | /*87:*/ | 1434 | /*87:*/ |
| 1434 | #line 1424 "ctangle.w" | 1435 | #line 1425 "ctangle.w" |
| 1435 | 1436 | ||
| 1436 | /*88:*/ | 1437 | /*88:*/ |
| 1437 | #line 1429 "ctangle.w" | 1438 | #line 1430 "ctangle.w" |
| 1438 | 1439 | ||
| 1439 | store_two_bytes((sixteen_bits)(0150000+section_count)); | 1440 | store_two_bytes((sixteen_bits)(0150000+section_count)); |
| 1440 | 1441 | ||
| 1441 | 1442 | ||
| 1442 | /*:88*/ | 1443 | /*:88*/ |
| 1443 | #line 1425 "ctangle.w" | 1444 | #line 1426 "ctangle.w" |
| 1444 | ; | 1445 | ; |
| 1445 | scan_repl(section_name); | 1446 | scan_repl(section_name); |
| 1446 | /*89:*/ | 1447 | /*89:*/ |
| 1447 | #line 1433 "ctangle.w" | 1448 | #line 1434 "ctangle.w" |
| 1448 | 1449 | ||
| 1449 | if(p==name_dir||p==0){ | 1450 | if(p==name_dir||p==0){ |
| 1450 | (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; | 1451 | (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; |
| @@ -1461,16 +1462,16 @@ cur_text->text_link= section_flag; · 10 unmodified lines | |||
| 1461 | 1462 | ||
| 1462 | 1463 | ||
| 1463 | /*:89*/ | 1464 | /*:89*/ |
| 1464 | #line 1427 "ctangle.w" | 1465 | #line 1428 "ctangle.w" |
| 1465 | ; | 1466 | ; |
| 1466 | 1467 | ||
| 1467 | /*:87*/ | 1468 | /*:87*/ |
| 1468 | #line 1378 "ctangle.w" | 1469 | #line 1379 "ctangle.w" |
| 1469 | ; | 1470 | ; |
| 1470 | } | 1471 | } |
| 1471 | 1472 | ||
| 1472 | /*:83*//*91:*/ | 1473 | /*:83*//*91:*/ |
| 1473 | #line 1451 "ctangle.w" | 1474 | #line 1452 "ctangle.w" |
| 1474 | 1475 | ||
| 1475 | void | 1476 | void |
| 1476 | phase_one(){ | 1477 | phase_one(){ |
| @@ -1484,14 +1485,14 @@ phase= 2; · 7 unmodified lines | |||
| 1484 | } | 1485 | } |
| 1485 | 1486 | ||
| 1486 | /*:91*//*93:*/ | 1487 | /*:91*//*93:*/ |
| 1487 | #line 1469 "ctangle.w" | 1488 | #line 1470 "ctangle.w" |
| 1488 | 1489 | ||
| 1489 | void | 1490 | void |
| 1490 | skip_limbo() | 1491 | skip_limbo() |
| 1491 | { | 1492 | { |
| 1492 | char c; | 1493 | char c; |
| 1493 | while(1){ | 1494 | while(1){ |
| 1494 | if(loc>limit&&get_line()==0)return; | 1495 | if(loc> limit&&get_line()==0)return; |
| 1495 | *(limit+1)= '@'; | 1496 | *(limit+1)= '@'; |
| 1496 | while(*loc!='@')loc++; | 1497 | while(*loc!='@')loc++; |
| 1497 | if(loc++<=limit){ | 1498 | if(loc++<=limit){ |
| @@ -1499,11 +1500,11 @@ c= *loc++; · 1 unmodified line | |||
| 1499 | if(ccode[(eight_bits)c]==new_section)break; | 1500 | if(ccode[(eight_bits)c]==new_section)break; |
| 1500 | switch(ccode[(eight_bits)c]){ | 1501 | switch(ccode[(eight_bits)c]){ |
| 1501 | case translit_code:/*94:*/ | 1502 | case translit_code:/*94:*/ |
| 1502 | #line 1498 "ctangle.w" | 1503 | #line 1499 "ctangle.w" |
| 1503 | 1504 | ||
| 1504 | while(xisspace(*loc)&&loc<limit)loc++; | 1505 | while(xisspace(*loc)&&loc<limit)loc++; |
| 1505 | loc+= 3; | 1506 | loc+= 3; |
| 1506 | if(loc>limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) | 1507 | if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) |
| 1507 | ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) | 1508 | ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) |
| 1508 | err_print("! Improper hex number following @l"); | 1509 | err_print("! Improper hex number following @l"); |
| 1509 | 1510 | ||
| @@ -1524,7 +1525,7 @@ translit[i-0200][loc-beg]= '\0'; · 14 unmodified lines | |||
| 1524 | } | 1525 | } |
| 1525 | 1526 | ||
| 1526 | /*:94*/ | 1527 | /*:94*/ |
| 1527 | #line 1482 "ctangle.w" | 1528 | #line 1483 "ctangle.w" |
| 1528 | ;break; | 1529 | ;break; |
| 1529 | case format_code:case'@':break; | 1530 | case format_code:case'@':break; |
| 1530 | case control_text:if(c=='q'||c=='Q'){ | 1531 | case control_text:if(c=='q'||c=='Q'){ |
| @@ -1542,7 +1543,7 @@ default:err_print("! Double @ should be used in limbo"); · 11 unmodified lines | |||
| 1542 | } | 1543 | } |
| 1543 | 1544 | ||
| 1544 | /*:93*//*95:*/ | 1545 | /*:93*//*95:*/ |
| 1545 | #line 1524 "ctangle.w" | 1546 | #line 1525 "ctangle.w" |
| 1546 | 1547 | ||
| 1547 | void | 1548 | void |
| 1548 | print_stats(){ | 1549 | print_stats(){ |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | % This program by Silvio Levy and Donald E. Knuth | 2 | % This program by Silvio Levy and Donald E. Knuth |
| 3 | % is based on a program by Knuth. | 3 | % is based on a program by Knuth. |
| 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. | 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. |
| 5 | % Version 3.4 --- April 1995 | 5 | % Version 3.43 --- September 1998 |
| 6 | 6 | ||
| 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth | 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth |
| 8 | 8 | ||
| @@ -22,11 +22,11 @@ · 13 unmodified lines | |||
| 22 | \mathchardef\RA="3221 % right arrow | 22 | \mathchardef\RA="3221 % right arrow |
| 23 | \mathchardef\BA="3224 % double arrow | 23 | \mathchardef\BA="3224 % double arrow |
| 24 | 24 | ||
| 25 | \def\title{CTANGLE (Version 3.4)} | 25 | \def\title{CTANGLE (Version 3.43)} |
| 26 | \def\topofcontents{\null\vfill | 26 | \def\topofcontents{\null\vfill |
| 27 | \centerline{\titlefont The {\ttitlefont CTANGLE} processor} | 27 | \centerline{\titlefont The {\ttitlefont CTANGLE} processor} |
| 28 | \vskip 15pt | 28 | \vskip 15pt |
| 29 | \centerline{(Version 3.4)} | 29 | \centerline{(Version 3.43)} |
| 30 | \vfill} | 30 | \vfill} |
| 31 | \def\botofcontents{\vfill | 31 | \def\botofcontents{\vfill |
| 32 | \noindent | 32 | \noindent |
| @@ -56,7 +56,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements. · 23 unmodified lines | |||
| 56 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} | 56 | The ``banner line'' defined here should be changed whenever \.{CTANGLE} |
| 57 | is modified. | 57 | is modified. |
| 58 | 58 | ||
| 59 | @d banner "This is CTANGLE (Version 3.4)\n" | 59 | @d banner "This is CTANGLE (Version 3.43)\n" |
| 60 | 60 | ||
| 61 | @c | 61 | @c |
| 62 | @<Include files@>@/ | 62 | @<Include files@>@/ |
| @@ -113,7 +113,7 @@ change them in the file |"common.w"|. · 50 unmodified lines | |||
| 113 | must be less than 10240; used in |"common.w"| */ | 113 | must be less than 10240; used in |"common.w"| */ |
| 114 | @d max_texts 2500 /* number of replacement texts, must be less than 10240 */ | 114 | @d max_texts 2500 /* number of replacement texts, must be less than 10240 */ |
| 115 | @d hash_size 353 /* should be prime; used in |"common.w"| */ | 115 | @d hash_size 353 /* should be prime; used in |"common.w"| */ |
| 116 | @d longest_name 1000 /* section names shouldn't be longer than this */ | 116 | @d longest_name 10000 /* section names shouldn't be longer than this */ |
| 117 | @d stack_size 50 /* number of simultaneous levels of macro expansion */ | 117 | @d stack_size 50 /* number of simultaneous levels of macro expansion */ |
| 118 | @d buf_size 100 /* for \.{CWEAVE} and \.{CTANGLE} */ | 118 | @d buf_size 100 /* for \.{CWEAVE} and \.{CTANGLE} */ |
| 119 | 119 | ||
| @@ -653,13 +653,14 @@ eight_bits cur_char; · 533 unmodified lines | |||
| 653 | char *j, *k; /* pointer into |byte_mem| */ | 653 | char *j, *k; /* pointer into |byte_mem| */ |
| 654 | restart: | 654 | restart: |
| 655 | switch (cur_char) { | 655 | switch (cur_char) { |
| 656 | case '\n': if (protect) C_putc(' '); | 656 | case '\n': if (protect && out_state!=verbatim) C_putc(' '); |
| 657 | if (protect || out_state==verbatim) C_putc('\\'); | 657 | if (protect || out_state==verbatim) C_putc('\\'); |
| 658 | flush_buffer(); if (out_state!=verbatim) out_state=normal; break; | 658 | flush_buffer(); if (out_state!=verbatim) out_state=normal; break; |
| 659 | @/@t\4@>@<Case of an identifier@>; | 659 | @/@t\4@>@<Case of an identifier@>; |
| 660 | @/@t\4@>@<Case of a section number@>; | 660 | @/@t\4@>@<Case of a section number@>; |
| 661 | @/@t\4@>@<Cases like \.{!=}@>; | 661 | @/@t\4@>@<Cases like \.{!=}@>; |
| 662 | case '=': C_putc('='); C_putc(' '); out_state=normal; break; | 662 | case '=': case '>': C_putc(cur_char); C_putc(' '); |
| 663 | out_state=normal; break; | ||
| 663 | case join: out_state=unbreakable; break; | 664 | case join: out_state=unbreakable; break; |
| 664 | case constant: if (out_state==verbatim) { | 665 | case constant: if (out_state==verbatim) { |
| 665 | out_state=num_or_id; break; | 666 | out_state=num_or_id; break; |
| @@ -20,12 +20,12 @@ This file contributed by Barry Schwartz, trashman@crud.mn.org, 28 Jun 94. · 19 unmodified lines | |||
| 20 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} | 20 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} |
| 21 | is modified. | 21 | is modified. |
| 22 | 22 | ||
| 23 | @d banner "This is CWEAVE (Version 3.4)\n" | 23 | @d banner "This is CWEAVE (Version 3.43)\n" |
| 24 | @y | 24 | @y |
| 25 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} | 25 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} |
| 26 | is modified. | 26 | is modified. |
| 27 | 27 | ||
| 28 | @d banner "This is CWEAVE (Version 3.4pc/big)\n" | 28 | @d banner "This is CWEAVE (Version 3.43pc/big)\n" |
| 29 | @z | 29 | @z |
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -11,9 +11,9 @@ that allows >64K arrays. (If you need lots more bytes, try the alternate · 10 unmodified lines | |||
| 11 | change files that have -bs in their name instead of -pc.) | 11 | change files that have -bs in their name instead of -pc.) |
| 12 | 12 | ||
| 13 | @x section 1 | 13 | @x section 1 |
| 14 | @d banner "This is CWEAVE (Version 3.4)\n" | 14 | @d banner "This is CWEAVE (Version 3.43)\n" |
| 15 | @y | 15 | @y |
| 16 | @d banner "This is CWEAVE (Version 3.4pc)\n" | 16 | @d banner "This is CWEAVE (Version 3.43pc)\n" |
| 17 | @z | 17 | @z |
| 18 | 18 | ||
| 19 | @x section 4 | 19 | @x section 4 |
| @@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c =500000 cweave_c" · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | @x | 9 | @x |
| 10 | \def\title{CWEAVE (Version 3.4)} | 10 | \def\title{CWEAVE (Version 3.43)} |
| 11 | @y | 11 | @y |
| 12 | \def\title{CWEAVE (QL Version 3.4)} | 12 | \def\title{CWEAVE (QL Version 3.43)} |
| 13 | @z | 13 | @z |
| 14 | 14 | ||
| 15 | @x section 1 | 15 | @x section 1 |
| 16 | @d banner "This is CWEAVE (Version 3.4)\n" | 16 | @d banner "This is CWEAVE (Version 3.43)\n" |
| 17 | @y | 17 | @y |
| 18 | @d banner "This is CWEAVE (QL Version 3.4)\n" | 18 | @d banner "This is CWEAVE (QL Version 3.43)\n" |
| 19 | @z | 19 | @z |
| 20 | 20 | ||
| 21 | @x | 21 | @x |
| @@ -13,9 +13,9 @@ modified: · 12 unmodified lines | |||
| 13 | (also modified by Don Knuth to keep version numbers uptodate) | 13 | (also modified by Don Knuth to keep version numbers uptodate) |
| 14 | 14 | ||
| 15 | @x section 1 (01-FEB-1992 ST) | 15 | @x section 1 (01-FEB-1992 ST) |
| 16 | @d banner "This is CWEAVE (Version 3.4)\n" | 16 | @d banner "This is CWEAVE (Version 3.43)\n" |
| 17 | @y | 17 | @y |
| 18 | @d banner "This is CWEAVE (VAX/VMS Version 3.4)\n" | 18 | @d banner "This is CWEAVE (VAX/VMS Version 3.43)\n" |
| 19 | @z | 19 | @z |
| 20 | 20 | ||
| 21 | @x section 6 (from common.h) (01-FEB-1992 ST) | 21 | @x section 6 (from common.h) (01-FEB-1992 ST) |
| @@ -2,7 +2,8 @@ · 1 unmodified line | |||
| 2 | % This program by Silvio Levy and Donald E. Knuth | 2 | % This program by Silvio Levy and Donald E. Knuth |
| 3 | % is based on a program by Knuth. | 3 | % is based on a program by Knuth. |
| 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. | 4 | % It is distributed WITHOUT ANY WARRANTY, express or implied. |
| 5 | % Version 3.4 --- April 1995 | 5 | % Version 3.43 --- September 1998 |
| 6 | % (is same as Version 3.4 except that the latter used an older COMMON) | ||
| 6 | 7 | ||
| 7 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth | 8 | % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth |
| 8 | 9 | ||
| @@ -27,11 +28,11 @@ · 18 unmodified lines | |||
| 27 | \def\skipxTeX{\\{skip\_\TEX/}} | 28 | \def\skipxTeX{\\{skip\_\TEX/}} |
| 28 | \def\copyxTeX{\\{copy\_\TEX/}} | 29 | \def\copyxTeX{\\{copy\_\TEX/}} |
| 29 | 30 | ||
| 30 | \def\title{CWEAVE (Version 3.4)} | 31 | \def\title{CWEAVE (Version 3.43)} |
| 31 | \def\topofcontents{\null\vfill | 32 | \def\topofcontents{\null\vfill |
| 32 | \centerline{\titlefont The {\ttitlefont CWEAVE} processor} | 33 | \centerline{\titlefont The {\ttitlefont CWEAVE} processor} |
| 33 | \vskip 15pt | 34 | \vskip 15pt |
| 34 | \centerline{(Version 3.4)} | 35 | \centerline{(Version 3.43)} |
| 35 | \vfill} | 36 | \vfill} |
| 36 | \def\botofcontents{\vfill | 37 | \def\botofcontents{\vfill |
| 37 | \noindent | 38 | \noindent |
| @@ -61,7 +62,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements. · 23 unmodified lines | |||
| 61 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} | 62 | The ``banner line'' defined here should be changed whenever \.{CWEAVE} |
| 62 | is modified. | 63 | is modified. |
| 63 | 64 | ||
| 64 | @d banner "This is CWEAVE (Version 3.4)\n" | 65 | @d banner "This is CWEAVE (Version 3.43)\n" |
| 65 | 66 | ||
| 66 | @c @<Include files@>@/ | 67 | @c @<Include files@>@/ |
| 67 | @h | 68 | @h |
| @@ -120,7 +121,7 @@ you have to change them also in the file |"common.w"|. · 52 unmodified lines | |||
| 120 | @d max_sections 2000 /* greater than the total number of sections */ | 121 | @d max_sections 2000 /* greater than the total number of sections */ |
| 121 | @d hash_size 353 /* should be prime */ | 122 | @d hash_size 353 /* should be prime */ |
| 122 | @d buf_size 100 /* maximum length of input line, plus one */ | 123 | @d buf_size 100 /* maximum length of input line, plus one */ |
| 123 | @d longest_name 1000 /* section names and strings shouldn't be longer than this */ | 124 | @d longest_name 10000 /* section names and strings shouldn't be longer than this */ |
| 124 | @d long_buf_size (buf_size+longest_name) | 125 | @d long_buf_size (buf_size+longest_name) |
| 125 | @d line_length 80 /* lines of \TEX/ output have at most this many characters; | 126 | @d line_length 80 /* lines of \TEX/ output have at most this many characters; |
| 126 | should be less than 256 */ | 127 | should be less than 256 */ |
| @@ -1,7 +1,7 @@ | |||
| 1 | % standard macros for CWEB listings (in addition to plain.tex) | 1 | % standard macros for CWEB listings (in addition to plain.tex) |
| 2 | % Version 3.1 --- September 1994 | 2 | % Version 3.43 --- September 1998 |
| 3 | \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros | 3 | \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros |
| 4 | \xdef\fmtversion{\fmtversion+CWEB3.1} | 4 | \xdef\fmtversion{\fmtversion+CWEB3.4} |
| 5 | 5 | ||
| 6 | \let\:=\. % preserve a way to get the dot accent | 6 | \let\:=\. % preserve a way to get the dot accent |
| 7 | % (all other accents will still work as usual) | 7 | % (all other accents will still work as usual) |
| @@ -42,7 +42,7 @@ · 34 unmodified lines | |||
| 42 | \let\&=\AM % ampersand in a string | 42 | \let\&=\AM % ampersand in a string |
| 43 | \let\^=\CF % circumflex in a string | 43 | \let\^=\CF % circumflex in a string |
| 44 | #1\kern.05em}} | 44 | #1\kern.05em}} |
| 45 | \def\){\discretionary{\hbox{\tentex\BS}}{}{}} | 45 | \def\){{\tentex\kern-.05em}\discretionary{\hbox{\tentex\BS}}{}{}} |
| 46 | \def\AT{@} % at sign for control text (not needed in versions >= 2.9) | 46 | \def\AT{@} % at sign for control text (not needed in versions >= 2.9) |
| 47 | \def\ATL{\par\noindent\bgroup\catcode`\_=12 \postATL} % print @l in limbo | 47 | \def\ATL{\par\noindent\bgroup\catcode`\_=12 \postATL} % print @l in limbo |
| 48 | \def\postATL#1 #2 {\bf letter \\{\uppercase{\char"#1}} | 48 | \def\postATL#1 #2 {\bf letter \\{\uppercase{\char"#1}} |
| @@ -168,7 +168,7 @@ · 119 unmodified lines | |||
| 168 | \let\V=\lor % logical or | 168 | \let\V=\lor % logical or |
| 169 | \let\W=\land % logical and | 169 | \let\W=\land % logical and |
| 170 | \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name | 170 | \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name |
| 171 | \XX$\langle\,${#2\eightrm\kern.5em#1}$\,\rangle$\XX} | 171 | \XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em#1}$\,\rangle$\XX} |
| 172 | \def\Y{\par\yskip} | 172 | \def\Y{\par\yskip} |
| 173 | \let\Z=\le | 173 | \let\Z=\le |
| 174 | \let\ZZ=\let % now you can \write the control sequence \ZZ | 174 | \let\ZZ=\let % now you can \write the control sequence \ZZ |
| @@ -409,7 +409,7 @@ appears frequently within \CEE/ text, because everything in · 408 unmodified lines | |||
| 409 | comments (i.e., between \.{/*} and \.{*/}, or following \.{//}) | 409 | comments (i.e., between \.{/*} and \.{*/}, or following \.{//}) |
| 410 | is treated as \TEX/ text. | 410 | is treated as \TEX/ text. |
| 411 | Likewise, the text of a section name consists of \TEX/ text, but | 411 | Likewise, the text of a section name consists of \TEX/ text, but |
| 412 | the construct \.{@<section name@>} as a whole is is expected to be found | 412 | the construct \.{@<section name@>} as a whole is expected to be found |
| 413 | in \CEE/ text; thus, one typically goes back and forth | 413 | in \CEE/ text; thus, one typically goes back and forth |
| 414 | between the \CEE/ and \TEX/ environments in a natural way, as in these | 414 | between the \CEE/ and \TEX/ environments in a natural way, as in these |
| 415 | examples: | 415 | examples: |
| @@ -0,0 +1,23 @@ | |||
| 1 | @x In my work (mainly TAOCP) I use \: (not \.) for the dot accent | ||
| 2 | '&`&\relax\^&"&\relax\~&=&.&u&v\cr | ||
| 3 | @y | ||
| 4 | '&`&\relax\^&"&\relax\~&=&:&u&v\cr | ||
| 5 | @z | ||
| 6 | @x | ||
| 7 | 1,1,1,1,1,0,0,1, /* \.{\\-} and \.{\\.} */ | ||
| 8 | 1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, /* \.{\\=} */ | ||
| 9 | @y | ||
| 10 | 1,1,1,1,1,0,1,1, /* \.{\\-} */ | ||
| 11 | 1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1, /* \.{:} and \.{\\=} */ | ||
| 12 | @z | ||
| 13 | @x and I use |...xref-tag...| for cross-references | ||
| 14 | case '|': if (web>1) { | ||
| 15 | save_skipping=skipping; | ||
| 16 | goto skip_C_prime; | ||
| 17 | } | ||
| 18 | @y | ||
| 19 | case '|': if (web>1) { | ||
| 20 | save_skipping=skipping; | ||
| 21 | goto skip_C_prime; | ||
| 22 | } else discard_to('|'); | ||
| 23 | @z | ||
| @@ -26,6 +26,7 @@ along too. If any of these control sequences is followed by \.\{, everything · 25 unmodified lines | |||
| 26 | up to the next \.\} will also be retained. Thus, for example, the | 26 | up to the next \.\} will also be retained. Thus, for example, the |
| 27 | construction `\.{m\\=\{\\i\}n\\u\ us}' will be considered a single word, | 27 | construction `\.{m\\=\{\\i\}n\\u\ us}' will be considered a single word, |
| 28 | in spite of the control sequences and the space between the two u's. | 28 | in spite of the control sequences and the space between the two u's. |
| 29 | Discretionary hyphens `\.{\char`\\-}' are treated in the same way as accents. | ||
| 29 | 30 | ||
| 30 | The \.{CWEB} conventions are essentially the same as the \TEX/ conventions, | 31 | The \.{CWEB} conventions are essentially the same as the \TEX/ conventions, |
| 31 | in the \TEX/ parts of a \.{CWEB} file. The \CEE/ parts of the file | 32 | in the \TEX/ parts of a \.{CWEB} file. The \CEE/ parts of the file |
| @@ -229,7 +230,7 @@ special, otherwise~1; the conventions for letters are reversed. · 197 unmodified lines | |||
| 229 | 230 | ||
| 230 | @<Global...@>= | 231 | @<Global...@>= |
| 231 | char ptab[]={0,1,1,1,1,0, /* \.{\\"} and \.{\\'} */ | 232 | char ptab[]={0,1,1,1,1,0, /* \.{\\"} and \.{\\'} */ |
| 232 | 1,1,1,1,1,1,0,1, /* \.{\\.} */ | 233 | 1,1,1,1,1,0,0,1, /* \.{\\-} and \.{\\.} */ |
| 233 | 1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, /* \.{\\=} */ | 234 | 1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, /* \.{\\=} */ |
| 234 | 1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1, /* \.{\\H}, \.{\\L}, \.{\\O} */ | 235 | 1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1, /* \.{\\H}, \.{\\L}, \.{\\O} */ |
| 235 | 0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1, /* \.{\\\^} */ | 236 | 0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1, /* \.{\\\^} */ |
| @@ -18,6 +18,11 @@ · 17 unmodified lines | |||
| 18 | ;; and nothing else, the probable cause is that the wordtest program | 18 | ;; and nothing else, the probable cause is that the wordtest program |
| 19 | ;; could not open /usr/local/lib/dict/words or ~/.words for reading. | 19 | ;; could not open /usr/local/lib/dict/words or ~/.words for reading. |
| 20 | 20 | ||
| 21 | ;; Note (10 Feb 1998): The spell-check logic failed to catch "obso1ete" | ||
| 22 | ;; as a scanner-typo for "obsolete". The reason is that, although "obso" | ||
| 23 | ;; and "ete" are non-words, they couldn't be found in query-replace | ||
| 24 | ;; for the regexps "\bobso\b" and "\bete\b". | ||
| 25 | |||
| 21 | (provide 'kspell) | 26 | (provide 'kspell) |
| 22 | 27 | ||
| 23 | (defvar wordtest-command "wordtest" ;; maybe "/usr/local/bin/wordtest" better? | 28 | (defvar wordtest-command "wordtest" ;; maybe "/usr/local/bin/wordtest" better? |
| @@ -46,7 +46,6 @@ · 45 unmodified lines | |||
| 46 | (define-key suntool-map "jt" 'narrow-to-region) ; F10 | 46 | (define-key suntool-map "jt" 'narrow-to-region) ; F10 |
| 47 | (define-key suntool-map "j\M-t" 'narrow-to-page) ; M-F10 | 47 | (define-key suntool-map "j\M-t" 'narrow-to-page) ; M-F10 |
| 48 | (define-key suntool-map "kt" 'revert-buffer) ; F11 | 48 | (define-key suntool-map "kt" 'revert-buffer) ; F11 |
| 49 | (define-key suntool-map "k\M-T" 'quick-revert-buffer) ; Shift-M-F11 | ||
| 50 | (define-key suntool-map "k\M-t" 'quick-revert-other-buffer) ; M-F11 | 49 | (define-key suntool-map "k\M-t" 'quick-revert-other-buffer) ; M-F11 |
| 51 | (define-key suntool-map "lt" 'goto-line) ; F12 | 50 | (define-key suntool-map "lt" 'goto-line) ; F12 |
| 52 | (define-key suntool-map "l\M-t" 'goto-line) ; M-F12 | 51 | (define-key suntool-map "l\M-t" 'goto-line) ; M-F12 |