diff options
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/cweave.w')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweave.w | 211 |
1 files changed, 104 insertions, 107 deletions
diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index 71e5ee3df8a..db5b4f250f5 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -937,7 +937,7 @@ convention, but do not allow the string to be longer than |longest_name|. whether there is more work to do. @<Get control code and possible section name@>= -switch(ccode[(eight_bits)(c=*loc++)]) { +switch(ccode[c=*loc++]) { case translit_code: err_print("! Use @@l in limbo only"); continue; @.Use @@l in limbo...@> case underline: xref_switch=def_flag; continue; @@ -948,7 +948,7 @@ switch(ccode[(eight_bits)(c=*loc++)]) { case ord: @<Get a string@>@; case xref_roman: case xref_wildcard: case xref_typewriter: case noop: case TeX_string: skip_restricted(); /* fall through */ - default: return ccode[(eight_bits)c]; + default: return ccode[c]; } @ The occurrence of a section name sets |xref_switch| to zero, @@ -1002,7 +1002,7 @@ if (c=='@@') { if (c=='>') { loc+=2; break; } - if (ccode[(eight_bits)c]==new_section) { + if (ccode[c]==new_section) { err_print("! Section name didn't end"); break; @.Section name didn't end@> } @@ -1126,7 +1126,7 @@ C_xref( /* makes cross-references for \CEE/ identifiers */ { while (next_control<format_code || next_control==spec_ctrl) { if (next_control>=identifier && next_control<=xref_typewriter) { - if (next_control>identifier) @<Replace |"@@@@"| by |"@@"|@>@; + if (next_control>identifier) @<Replace `\.{@@@@}' by `\.{@@}'@>@; new_xref(id_lookup(id_first,id_loc,next_control-identifier)); } if (next_control==section_name) { @@ -1179,7 +1179,7 @@ while (true) { case noop: case section_name: loc-=2; next_control=get_next(); /* scan to \.{@@>} */ if (next_control>=xref_roman && next_control<=xref_typewriter) { - @<Replace |"@@@@"| by |"@@"|@>@; + @<Replace `\.{@@@@}' by `\.{@@}'@>@; new_xref(id_lookup(id_first,id_loc,next_control-identifier)); } break; @@ -1187,7 +1187,7 @@ while (true) { if (next_control>=format_code) break; } -@ @<Replace |"@@@@"| by |"@@"| @>= +@ @<Replace `\.{@@@@}' by `\.{@@}'@>= { char *src=id_first,*dst=id_first; while(src<id_loc){ @@ -1410,7 +1410,7 @@ tricky way so that the first line of the output file will be @<Start \TEX/...@>= out_ptr=out_buf+1; out_line=1; active_file=tex_file; -*out_ptr='c'; tex_printf("\\input cwebma"); +tex_printf("\\input cwebma"); *out_ptr='c'; @ When we wish to append one character |c| to the output buffer, we write `|out(c)|'; this will cause the buffer to be emptied if it was already @@ -1535,15 +1535,13 @@ static int copy_comment(boolean,int); static void copy_limbo(void) { - char c; while (true) { if (loc>limit && (finish_line(), get_line()==false)) return; *(limit+1)='@@'; while (*loc!='@@') out(*(loc++)); if (loc++<=limit) { - c=*loc++; - if (ccode[(eight_bits)c]==new_section) break; - switch (ccode[(eight_bits)c]) { + switch (ccode[(eight_bits)*loc++]) { + case new_section: return; case translit_code: out_str("\\ATL"); break; @.\\ATL@> case '@@': out('@@'); break; @@ -1766,7 +1764,7 @@ same initial letter; these subscripts are assigned from left to right. @d attr_head 69 /* denotes beginning of attribute */ @<Private...@>= -static char cat_name[256][12]; +static char cat_name[256][12]; /* |12==strlen("struct_head")+1| */ @ @<Set in...@>= {int c; for (c=0;c<256;c++) strcpy(cat_name[c],"UNKNOWN");} @@ -1839,7 +1837,7 @@ static char cat_name[256][12]; @ This code allows \.{CWEAVE} to display its parsing steps. -@d print_cat(c) fputs(cat_name[(eight_bits)(c)],stdout) +@d print_cat(c) fputs(cat_name[c],stdout) @ The token lists for translated \TEX/ output contain some special control symbols as well as ordinary characters. These control symbols are @@ -2126,9 +2124,9 @@ identifier&|exp|: \.{\\\\\{}identifier with underlines and \.{@@(@q)@>}\thinspace section name\thinspace\.{@@>}&|section_scrap|: \.{\\X}$n$\.{:\\.\{}section name with special characters quoted\.{\ \}\\X}&maybe\cr -\.{/*}comment\.{*/}&|insert|: |cancel| +\.{/*}\thinspace comment\thinspace\.{*/}&|insert|: |cancel| \.{\\C\{}translated comment\.\} |force|&no\cr -\.{//}comment&|insert|: |cancel| +\.{//}\thinspace comment&|insert|: |cancel| \.{\\SHC\{}translated comment\.\} |force|&no\cr } @@ -2302,15 +2300,15 @@ the production just mentioned. Before calling |reduce|, the program should have appended the tokens of the new translation to the |tok_mem| array. We commonly want to append copies of several existing translations, and macros are defined to -simplify these common cases. For example, \\{app2}|(pp)| will append the +simplify these common cases. For example, |big_app2(pp)| will append the translations of two consecutive scraps, |pp->trans| and |(pp+1)->trans|, to the current token list. If the entire new translation is formed in this way, we write `|squash(j,k,c,d,n)|' instead of `|reduce(j,k,c,d,n)|'. For -example, `|squash(pp,3,exp,-2,3)|' is an abbreviation for `\\{app3}|(pp); +example, `|squash(pp,3,exp,-2,3)|' is an abbreviation for `|big_app3(pp); reduce(pp,3,exp,-2,3)|'. A couple more words of explanation: -Both |big_app| and |app| append a token (while |big_app1| to |big_app3| +Both |big_app| and |app| append a token (while |big_app1| to |big_app4| append the specified number of scrap translations) to the current token list. The difference between |big_app| and |app| is simply that |big_app| checks whether there can be a conflict between math and non-math @@ -2323,10 +2321,10 @@ to be printed in a math mode context or not. It is separate from the a fixed |mathness| (as in the original \.{WEAVE}) would multiply the number of necessary production rules. -The low two bits (i.e. |mathness % 4|) control the left boundary. +The low two bits (i.e., |mathness % 4|) control the left boundary. (We need two bits because we allow cases |yes_math|, |no_math| and |maybe_math|, which can go either way.) -The next two bits (i.e. |mathness / 4|) control the right boundary. +The next two bits (i.e., |mathness / 4|) control the right boundary. If we combine two scraps and the right boundary of the first has a different mathness from the left boundary of the second, we insert a \.{\$} in between. Similarly, if at printing time some @@ -2344,9 +2342,9 @@ productions as they were listed earlier. @d maybe_math 0 /* works in either horizontal or math mode */ @d big_app2(a) big_app1(a);@+big_app1(a+1) @d big_app3(a) big_app2(a);@+big_app1(a+2) +@d big_app4(a) big_app3(a);@+big_app1(a+3) @d big_app1_insert(p,c) big_app1(p);@+big_app(c);@+big_app1(p+1) @d app(a) *(tok_ptr++)=(token)(a) -@d app1(a) *(tok_ptr++)=(token)(tok_flag+(int)((a)->trans-tok_start)) @<Private...@>= static int cur_mathness, init_mathness; @@ -2427,8 +2425,8 @@ code needs to be provided with a proper environment. if (cat1==end_arg && lhs_not_simple) if (pp->cat==begin_arg) squash(pp,2,exp,-2,124); else squash(pp,2,end_arg,-1,125); -else if (pp->cat==rbrack) squash(pp,1,rpar,-3,130); -else if (pp->cat==using_like) squash(pp,1,int_like,-3,140); +else if (pp->cat==rbrack) reduce(pp,0,rpar,-3,130); +else if (pp->cat==using_like) reduce(pp,0,int_like,-3,140); else if (cat1==insert) squash(pp,2,pp->cat,-2,0); else if (cat2==insert) squash(pp+1,2,(pp+1)->cat,-1,0); else if (cat3==insert) squash(pp+2,2,(pp+2)->cat,0,0); @@ -2637,8 +2635,8 @@ r->num=m; /* everything from |q| on is left undisturbed */ @ Now comes the code that tries to match each production starting with a particular type of scrap. Whenever a match is discovered, -the |squash| or |reduce| macro will cause the appropriate action -to be performed, followed by |goto found|. +the |squash| or |reduce| function will cause the appropriate action +to be performed. @<Cases for |exp|@>= if (cat1==lbrace || cat1==int_like || cat1==decl) { @@ -2652,13 +2650,13 @@ else if (cat1==comma && cat2==exp) { big_app2(pp); app(opt); app('9'); big_app1(pp+2); reduce(pp,3,exp,-2,4); } -else if (cat1==lpar && cat2==rpar && cat3==colon) squash(pp+3,1,base,0,5); -else if (cat1==cast && cat2==colon) squash(pp+2,1,base,0,5); +else if (cat1==lpar && cat2==rpar && cat3==colon) reduce(pp+3,0,base,0,5); +else if (cat1==cast && cat2==colon) reduce(pp+2,0,base,0,5); else if (cat1==semi) squash(pp,2,stmt,-1,6); else if (cat1==colon) { make_underlined (pp); squash(pp,2,tag,-1,7); } -else if (cat1==rbrace) squash(pp,1,stmt,-1,8); +else if (cat1==rbrace) reduce(pp,0,stmt,-1,8); else if (cat1==lpar && cat2==rpar && (cat3==const_like || cat3==case_like)) { big_app1_insert(pp+2,' '); reduce(pp+2,2,rpar,0,9); } @@ -2714,7 +2712,7 @@ if (cat1==lpar) squash(pp,2,lpar,-1,21); else if (cat1==exp) { big_app1_insert(pp,' '); reduce(pp,2,exp,-2,21); } -else if (cat1==semi) squash(pp,1,exp,-2,22); +else if (cat1==semi) reduce(pp,0,exp,-2,22); @ @<Cases for |sizeof_like|@>= if (cat1==cast) squash(pp,2,exp,-2,23); @@ -2731,11 +2729,11 @@ else if (cat1==exp && (cat2==raw_int||cat2==struct_like)) else if (cat1==exp || cat1==ubinop || cat1==colon) { big_app1(pp); big_app(' '); reduce(pp,1,decl_head,-1,27); } -else if (cat1==semi || cat1==binop) squash(pp,1,decl_head,0,28); +else if (cat1==semi || cat1==binop) reduce(pp,0,decl_head,0,28); @ @<Cases for |public_like|@>= if (cat1==colon) squash(pp,2,tag,-1,29); -else squash(pp,1,int_like,-2,30); +else reduce(pp,0,int_like,-2,30); @ @<Cases for |colcol|@>= if (cat1==exp||cat1==int_like) { @@ -2758,7 +2756,7 @@ else if ((cat1==binop||cat1==colon) && cat2==exp && (cat3==comma || squash(pp,3,decl_head,-1,36); else if (cat1==cast) squash(pp,2,decl_head,-1,37); else if (cat1==lbrace || cat1==int_like || cat1==decl) { - big_app(dindent); big_app1(pp); reduce(pp,1,fn_decl,0,38); + big_app(dindent); squash(pp,1,fn_decl,0,38); } else if (cat1==semi) squash(pp,2,decl,-1,39); else if (cat1==attr) { @@ -2798,7 +2796,7 @@ else if (cat1==exp||cat1==int_like) { big_app(' '); big_app1(pp+2);reduce(pp,3,struct_head,0,46); } } - else if (cat2==colon) squash(pp+2,1,base,2,47); + else if (cat2==colon) reduce(pp+2,0,base,2,47); else if (cat2!=base) { big_app1_insert(pp,' '); reduce(pp,2,int_like,-2,48); } @@ -2861,8 +2859,8 @@ if (cat1==exp) { } @ @<Cases for |else_like|@>= -if (cat1==colon) squash(pp+1,1,base,1,58); -else if (cat1==lbrace) squash(pp,1,else_head,0,59); +if (cat1==colon) reduce(pp+1,0,base,1,58); +else if (cat1==lbrace) reduce(pp,0,else_head,0,59); else if (cat1==stmt) { big_app(force); big_app1(pp); big_app(indent); big_app(break_space); big_app1(pp+1); big_app(outdent); big_app(force); @@ -2877,7 +2875,7 @@ if (cat1==stmt || cat1==exp) { } @ @<Cases for |if_clause|@>= -if (cat1==lbrace) squash(pp,1,if_head,0,62); +if (cat1==lbrace) reduce(pp,0,if_head,0,62); else if (cat1==stmt) { if (cat2==else_like) { big_app(force); big_app1(pp); big_app(indent); big_app(break_space); @@ -2887,7 +2885,7 @@ else if (cat1==stmt) { } else reduce(pp,3,else_like,0,64); } - else squash(pp,1,else_like,0,65); + else reduce(pp,0,else_like,0,65); } else if (cat1==attr) { big_app1_insert(pp,' '); reduce(pp,2,if_head,0,146); @@ -2903,7 +2901,7 @@ if (cat1==stmt || cat1==exp) { } else reduce(pp,3,else_like,0,67); } - else squash(pp,1,else_head,0,68); + else reduce(pp,0,else_head,0,68); } @ @<Cases for |do_like|@>= @@ -2933,7 +2931,7 @@ else if (cat1==stmt||cat1==decl||cat1==function) { big_app(force); big_app(backup); big_app1_insert(pp,break_space); reduce(pp,2,cat1,-1,75); } -else if (cat1==rbrace) squash(pp,1,decl,-1,156); +else if (cat1==rbrace) reduce(pp,0,decl,-1,156); @ The user can decide at run-time whether short statements should be grouped together on the same line. @@ -2950,20 +2948,20 @@ if (cat1==stmt||cat1==decl||cat1==function) { } @ @<Cases for |semi|@>= -big_app(' '); big_app1(pp); reduce(pp,1,stmt,-1,77); +big_app(' '); squash(pp,1,stmt,-1,77); @ @<Cases for |lproc|@>= if (cat1==define_like) make_underlined(pp+2); if (cat1==else_like || cat1==if_like || cat1==define_like) squash(pp,2,lproc,0,78); else if (cat1==rproc) { - app(inserted); big_app2(pp); reduce(pp,2,insert,-1,79); + app(inserted); squash(pp,2,insert,-1,79); } else if (cat1==exp || cat1==function) { if (cat2==rproc) { app(inserted); big_app1(pp); big_app(' '); big_app2(pp+1); reduce(pp,3,insert,-1,80); } - else if (cat2==exp && cat3==rproc && cat1==exp) { + else if (cat1==exp && cat2==exp && cat3==rproc) { app(inserted); big_app1_insert(pp,' '); app_str("\\5"); @.\\5@> big_app2(pp+2); reduce(pp,4,insert,-1,80); @@ -2974,7 +2972,7 @@ else if (cat1==rproc) { if (cat1==semi) { big_app2(pp); big_app(force); reduce(pp,2,stmt,-2,81); } -else squash(pp,1,exp,-2,82); +else reduce(pp,0,exp,-2,82); @ @<Cases for |insert|@>= if (cat1) @@ -3013,21 +3011,21 @@ else if ((cat1==struct_like) @| } @ @<Cases for |template_like|@>= -if (cat1==exp && cat2==prelangle) squash(pp+2,1,langle,2,89); +if (cat1==exp && cat2==prelangle) reduce(pp+2,0,langle,2,89); else if (cat1==exp || cat1==raw_int) { big_app1_insert(pp,' '); reduce(pp,2,cat1,-2,90); } else if (cat1==cast && cat2==struct_like) { big_app1_insert(pp,' '); reduce(pp,2,struct_like,0,155); } -else squash(pp,1,raw_int,0,91); +else reduce(pp,0,raw_int,0,91); @ @<Cases for |new_like|@>= if (cat1==lpar && cat2==exp && cat3==rpar) squash(pp,4,new_like,0,92); else if (cat1==cast) { big_app1_insert(pp,' '); reduce(pp,2,exp,-2,93); } -else if (cat1!=lpar) squash(pp,1,new_exp,0,94); +else if (cat1!=lpar) reduce(pp,0,new_exp,0,94); @ @<Cases for |new_exp|@>= if (cat1==int_like || cat1==const_like) { @@ -3040,16 +3038,16 @@ else if (cat1==struct_like && (cat2==exp || cat2==int_like)) { else if (cat1==raw_ubin) { big_app1_insert(pp,'{'); big_app('}'); reduce(pp,2,new_exp,0,97); } -else if (cat1==lpar) squash(pp,1,exp,-2,98); +else if (cat1==lpar) reduce(pp,0,exp,-2,98); else if (cat1==exp) { big_app1(pp); big_app(' '); reduce(pp,1,exp,-2,98); } else if (cat1!=raw_int && cat1!=struct_like && cat1!=colcol) - squash(pp,1,exp,-2,99); + reduce(pp,0,exp,-2,99); @ @<Cases for |ftemplate|@>= -if (cat1==prelangle) squash(pp+1,1,langle,1,100); -else squash(pp,1,exp,-2,101); +if (cat1==prelangle) reduce(pp+1,0,langle,1,100); +else reduce(pp,0,exp,-2,101); @ @<Cases for |for_like|@>= if (cat1==exp) { @@ -3061,18 +3059,18 @@ if (cat1==const_like) { big_app2(pp); app_str("\\ "); reduce(pp,2,raw_ubin,0,103); @.\\\ @> } -else squash(pp,1,ubinop,-2,104); +else reduce(pp,0,ubinop,-2,104); @ @<Cases for |const_like|@>= -squash(pp,1,int_like,-2,105); +reduce(pp,0,int_like,-2,105); @ @<Cases for |raw_int|@>= -if (cat1==prelangle) squash(pp+1,1,langle,1,106); +if (cat1==prelangle) reduce(pp+1,0,langle,1,106); else if (cat1==colcol) squash(pp,2,colcol,-1,107); else if (cat1==cast) squash(pp,2,raw_int,0,108); -else if (cat1==lpar) squash(pp,1,exp,-2,109); -else if (cat1==lbrack) squash(pp,1,exp,-2,144); -else if (cat1!=langle) squash(pp,1,int_like,-3,110); +else if (cat1==lpar) reduce(pp,0,exp,-2,109); +else if (cat1==lbrack) reduce(pp,0,exp,-2,144); +else if (cat1!=langle) reduce(pp,0,int_like,-3,110); @ @<Cases for |operator_like|@>= if (cat1==binop || cat1==unop || cat1==ubinop) { @@ -3083,11 +3081,11 @@ else if (cat1==new_like || cat1==delete_like) { big_app1_insert(pp,' '); reduce(pp,2,exp,-2,112); } else if (cat1==comma) squash(pp,2,exp,-2,113); -else if (cat1!=raw_ubin) squash(pp,1,new_exp,0,114); +else if (cat1!=raw_ubin) reduce(pp,0,new_exp,0,114); @ @<Cases for |typedef_like|@>= if ((cat1==int_like || cat1==cast) && (cat2==comma || cat2==semi)) - squash(pp+1,1,exp,-1,115); + reduce(pp+1,0,exp,-1,115); else if (cat1==int_like) { big_app1_insert(pp,' '); reduce(pp,2,typedef_like,0,116); } @@ -3128,7 +3126,7 @@ else if (cat1==cast) squash(pp,2,attr,-1,158); if (cat1==lbrack) if (cat2==rbrack && cat3==rbrack) squash(pp,4,exp,-2,147); else squash(pp,2,attr_head,-1,128); -else squash(pp,1,lpar,-1,129); +else reduce(pp,0,lpar,-1,129); @ @<Cases for |attr_head|@>= if (cat1==rbrack && cat2==rbrack) squash(pp,3,attr,-1,131); @@ -3161,12 +3159,10 @@ else if (cat1==function) { } @ @<Cases for |default_like|@>= -if (cat1==colon) squash(pp,1,case_like,-3,149); -else squash(pp,1,exp,-2,150); - -@ Now here's the |reduce| procedure used in our code for productions. +if (cat1==colon) reduce(pp,0,case_like,-3,149); +else reduce(pp,0,exp,-2,150); -The `|freeze_text|' macro is used to give official status to a token list. +@ The `|freeze_text|' macro is used to give official status to a token list. Before saying |freeze_text|, items are appended to the current token list, and we know that the eventual number of this token list will be the current value of |text_ptr|. But no list of that number really exists as yet, @@ -3184,7 +3180,10 @@ too large, since it is assumed that this test was done beforehand. static void reduce(scrap_pointer,short,eight_bits,short,short);@/ static void squash(scrap_pointer,short,eight_bits,short,short); -@ @c +@ Now here's the |reduce| procedure used in our code for productions, +which takes advantage of the simplification that occurs when |k==0|. + +@c static void reduce( scrap_pointer j, short k, @@ -3192,9 +3191,12 @@ eight_bits c, short d, short n) { scrap_pointer i, i1; /* pointers into scrap memory */ - j->cat=c; j->trans=text_ptr; - j->mathness=4*cur_mathness+init_mathness; - freeze_text; + j->cat=c; + if (k>0) { + j->trans=text_ptr; + j->mathness=4*cur_mathness+init_mathness; + freeze_text; + } if (k>1) { for (i=j+k, i1=j+1; i<=lo_ptr; i++, i1++) { i1->cat=i->cat; i1->trans=i->trans; @@ -3207,8 +3209,8 @@ short d, short n) pp--; /* we next say |pp++| */ } -@ Here's the |squash| procedure, which -takes advantage of the simplification that occurs when |k==1|. +@ And here's the |squash| procedure, which combines |big_app|${}_k$ and +|reduce| for matching numbers~|k|. @c static void @@ -3217,14 +3219,13 @@ scrap_pointer j, short k, eight_bits c, short d, short n) { - scrap_pointer i; /* pointers into scrap memory */ - if (k==1) { - j->cat=c; pp=(pp+d<scrap_base? scrap_base: pp+d); - @<Print a snapshot...@>@; - pp--; /* we next say |pp++| */ - return; + switch (k) { + case 1: big_app1(j); break; + case 2: big_app2(j); break; + case 3: big_app3(j); break; + case 4: big_app4(j); break; + default: confusion("squash"); } - for (i=j; i<j+k; i++) big_app1(i); reduce(j,k,c,d,n); } @@ -3333,7 +3334,7 @@ where appropriate. for (j=scrap_base; j<=lo_ptr; j++) { if (j!=scrap_base) app(' '); if (j->mathness % 4 == yes_math) app('$'); - app1(j); + app(tok_flag+(int)(j->trans-tok_start)); if (j->mathness / 4 == yes_math) app('$'); if (tok_ptr+6>tok_mem_end) overflow("token"); } @@ -3533,28 +3534,22 @@ Many of the special characters in a string must be prefixed by `\.\\' so that @^special string characters@> @<Append a string or...@>={@+ int count=-1; /* characters remaining before string break */ -if (next_control==constant) app_str("\\T{"@q}@>); +switch (next_control) { + case constant: app_str("\\T{"@q}@>); break; @.\\T@> -else if (next_control==string) { - count=20; app_str("\\.{"@q}@>); -} + case string: count=20; app_str("\\.{"@q}@>); break; @.\\.@> -else app_str("\\vb{"@q}@>); + default: app_str("\\vb{"@q}@>); @.\\vb@> +} while (id_first<id_loc) { if (count==0) { /* insert a discretionary break in a long string */ app_str(@q(@>@q{@>"}\\)\\.{"@q}@>); count=20; @q(@>@.\\)@> } -@^high-bit character handling@> - if((eight_bits)(*id_first)>0177) { - app_tok(quoted_char); - app_tok((eight_bits)(*id_first++)); - } - else { - switch (*id_first) { - case ' ':case '\\':case '#':case '%':case '$':case '^': - case '{': case '}': case '~': case '&': case '_': app('\\'); break; + switch (*id_first) { + case ' ':case '\\':case '#':case '%':case '$':case '^': + case '{': case '}': case '~': case '&': case '_': app('\\'); break; @.\\\ @> @.\\\\@> @.\\\#@> @@ -3566,12 +3561,16 @@ while (id_first<id_loc) { @.\\\~@> @.\\\&@> @.\\\_@> - case '@@': if (*(id_first+1)=='@@') id_first++; - else err_print("! Double @@ should be used in strings"); + case '@@': if (*(id_first+1)=='@@') id_first++; + else err_print("! Double @@ should be used in strings"); @.Double @@ should be used...@> + break; + default: /* high-bit character handling */ +@^high-bit character handling@> + if((eight_bits)(*id_first)>0177) + app_tok(quoted_char)@t;@>@; } - app_tok(*id_first++); - } + app_tok(*id_first++); count--; } app(@q{@>'}'); @@ -3596,15 +3595,13 @@ the \TEX/ string is treated as an expression. @<Append a \TEX/ string, without forming a scrap@>= app_str("\\hbox{"@q}@>); @^high-bit character handling@> -while (id_first<id_loc) - if((eight_bits)(*id_first)>0177) { - app_tok(quoted_char); - app_tok((eight_bits)(*id_first++)); - } - else { +while (id_first<id_loc) { + if((eight_bits)(*id_first)>0177) + app_tok(quoted_char)@t;@>@; + else if (*id_first=='@@') id_first++; - app_tok(*id_first++); - } + app_tok(*id_first++); +} app(@q{@>'}'); @ The function |app_cur_id| appends the current identifier to the @@ -4393,7 +4390,7 @@ if (next_control<=section_name) { if (next_control==begin_C) next_control=get_next(); else { this_section=cur_section; - @<Check that '=' or '==' follows this section name, and + @<Check that `\.{=}' or `\.{==}' follows this section name, and emit the scraps to start the section definition@>@; } while (next_control<=section_name) { @@ -4406,7 +4403,7 @@ if (next_control<=section_name) { @ The title of the section and an $\E$ or $\mathrel+\E$ are made into a scrap that should not take part in the parsing. -@<Check that '='...@>= +@<Check that `\.{=}'...@>= do next_control=get_next(); while (next_control=='+'); /* allow optional `\.{+=}' */ if (next_control!='=' && next_control!=eq_eq) @@ -4836,7 +4833,7 @@ name_pointer p) section_print(p->llink); out_str("\\I"); @.\\I@> tok_ptr=tok_mem+1; text_ptr=tok_start+1; scrap_ptr=scrap_info; init_stack; - app(p-name_dir+section_flag); make_output(); + app(section_flag+(int)(p-name_dir)); make_output(); footnote(cite_flag); footnote(0); /* |cur_xref| was set by |make_output| */ finish_line();@/ |