summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/ctwill-w2c.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/ctwill-w2c.ch248
1 files changed, 144 insertions, 104 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
index f194af2c139..7fe1b3585a4 100644
--- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
@@ -35,9 +35,9 @@
@z
@x
-\def\title{CWEAVE (Version 4.3)}
+\def\title{CWEAVE (Version 4.4)}
@y
-\def\title{CTWILL (Version 4.3 [\TeX~Live])}
+\def\title{CTWILL (Version 4.4 [\TeX~Live])}
@z
@x
@@ -47,9 +47,9 @@
@z
@x
- \centerline{(Version 4.3)}
+ \centerline{(Version 4.4)}
@y
- \centerline{(Version 4.3 [\TeX~Live])}
+ \centerline{(Version 4.4 [\TeX~Live])}
@z
@x
@@ -76,7 +76,7 @@ Crusius, and others who have contributed improvements.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.
-@d banner "This is CWEAVE (Version 4.3)"
+@d banner "This is CWEAVE (Version 4.4)"
@y
This is the \.{CTWILL} program by D. E. Knuth, based
on \.{CWEAVE} by Silvio Levy and D.~E. Knuth. It is also based on
@@ -93,14 +93,14 @@ can be found in Knuth's article ``Mini-indexes for literate programs,''
reprinted in {\sl Digital Typography\/} (1999), 225--245.
A kind of ``user manual'' for \.{CTWILL} can be found in the appendix
-{\bf 272.~Mogrify \.{CWEAVE} into \.{CTWILL}} and beyond, together
+{\bf 271.~Mogrify \.{CWEAVE} into \.{CTWILL}} and beyond, together
with additional material specific to \.{CTWILL}. % FIXME
Until then, \.{CWEAVE}'s sequence of sections will be preserved.
The ``banner line'' defined here should be changed whenever \.{CTWILL} is
modified. The version number parallels the corresponding version of \.{CWEAVE}.
-@d banner "This is CTWILL, Version 4.3"
+@d banner "This is CTWILL, Version 4.4"
/* will be extended by the \TeX~Live |versionstring| */
@z
@@ -123,6 +123,14 @@ modified. The version number parallels the corresponding version of \.{CWEAVE}.
@z
@x
+@d max_refs 20000 /* number of cross-references; must be less than 65536 */
+@d max_scraps 2000 /* number of tokens in \CEE/ texts being parsed */
+@y
+@d max_refs 65535 /* number of cross-references; must be less than 65536 */
+@d max_scraps 5000 /* number of tokens in \CEE/ texts being parsed */
+@z
+
+@x
turned on during the first phase.
@<Private...@>=
@@ -138,6 +146,18 @@ turned on during the first phase---NOT!
@z
@x
+@d max_toks 20000 /* number of symbols in \CEE/ texts being parsed;
+ must be less than 65536 */
+@d max_texts 4000 /* number of phrases in \CEE/ texts being parsed;
+ must be less than 10240 */
+@y
+@d max_toks 65535 /* number of symbols in \CEE/ texts being parsed;
+ must be less than 65536 */
+@d max_texts 10239 /* number of phrases in \CEE/ texts being parsed;
+ must be less than 10240 */
+@z
+
+@x
@ Here are the three procedures needed to complete |id_lookup|:
@y
@ Here are the three procedures needed to complete |id_lookup|:
@@ -147,7 +167,7 @@ turned on during the first phase---NOT!
@x
p->ilk=t; init_node(p);
@y
- struct perm_meaning *q=p-name_dir+cur_meaning;
+ struct perm_meaning *q=get_meaning(p);
p->ilk=t; init_node(p);
q->stamp=0;
q->link=NULL;
@@ -157,15 +177,30 @@ turned on during the first phase---NOT!
@z
@x
+@ And here's a small helper function to simplify the code.
+
+@d update_node(p) (p)->xref=(void *)xref_ptr
+@y
+@ And here are two small helper functions to simplify the code.
+
+@d update_node(p) (p)->xref=(void *)xref_ptr
+@d get_meaning(p) (p)-name_dir+cur_meaning
+@z
+
+@x
id_lookup("extern",NULL,int_like);
@y
+@#
ext_loc=id_lookup("extern",NULL,int_like)-name_dir;
+@#
@z
@x
id_lookup("int",NULL,raw_int);
@y
+@#
int_loc=id_lookup("int",NULL,raw_int)-name_dir;
+@#
@z
@x
@@ -281,24 +316,24 @@ skip_TeX(void)
@z
@x
- case translit_code: err_print("! Use @@l in limbo only"); continue;
+ case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
- case translit_code: err_print(_("! Use @@l in limbo only")); continue;
+ case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
@x
- case underline: xref_switch=def_flag; continue;
+ case underline: xref_switch=def_flag; continue;
@y
- case underline: xref_switch=def_flag; continue;
- case temp_meaning: temp_switch=true-temp_switch; continue;
- case right_start: right_start_switch=true; continue;
+ case underline: xref_switch=def_flag; continue;
+ case temp_meaning: temp_switch=!temp_switch; continue;
+ case right_start: right_start_switch=true; continue;
@z
@x
- case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
+ case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
@y
- case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
- case meaning: case suppress:
+ case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
+ case meaning: case suppress:
@z
@x
@@ -326,11 +361,9 @@ skip_TeX(void)
@z
@x
-static void
skip_restricted(void)
{
@y
-static void
skip_restricted(void)
{ int c=ccode[(eight_bits)*(loc-1)];
@z
@@ -356,9 +389,9 @@ skip_restricted(void)
@z
@x
- if (loc>=limit) err_print("! Verbatim string didn't end");
+if (loc>=limit) err_print("! Verbatim string didn't end");
@y
- if (loc>=limit) err_print(_("! Verbatim string didn't end"));
+if (loc>=limit) err_print(_("! Verbatim string didn't end"));
@z
@x
@@ -405,15 +438,15 @@ skip_restricted(void)
@z
@x
- err_print("! Missing left identifier of @@s");
+ err_print("! Missing left identifier of @@s");
@y
- err_print(_("! Missing left identifier of @@s"));
+ err_print(_("! Missing left identifier of @@s"));
@z
@x
- err_print("! Missing right identifier of @@s");
+ err_print("! Missing right identifier of @@s");
@y
- err_print(_("! Missing right identifier of @@s"));
+ err_print(_("! Missing right identifier of @@s"));
@z
@x
@@ -470,7 +503,7 @@ tex_puts(proofing?"ctproofma":"ctwima");
@y
@d out(c)
{if (ms_mode) { /* outputting to |ministring_buf| */
- if (ministring_ptr<&ministring_buf[max_tex_chars])
+ if (ministring_ptr<ministring_buf_end)
*ministring_ptr++=c;
} else {
if (out_ptr>=out_buf_end) break_out();
@@ -493,7 +526,7 @@ the section is changed, we output `\.{\\*}' just after the number.
@z
@x
- if(changed_section[n]) out_str ("\\*");
+ if (changed_section[n]) out_str("\\*");
@.\\*@>
@y
@z
@@ -569,13 +602,13 @@ null_scrap.trans=&tok_start[0];
@z
@x
-@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */
+@d inner_tok_flag (5*id_flag) /* signifies a token list in `\pb' */
@c
static void
print_text( /* prints a token list for debugging; not used in |main| */
@y
-@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */
+@d inner_tok_flag (5*id_flag) /* signifies a token list in `\pb' */
@<Predecl...@>=
#if 0
@@ -840,9 +873,9 @@ if (cat1==decl_head) {
@z
@x
- if (tok_ptr+6>tok_mem_end) overflow("token");
+ if (tok_ptr+6>tok_mem_end) overflow("token");
@y
- if (tok_ptr+6>tok_mem_end) overflow(_("token"));
+ if (tok_ptr+6>tok_mem_end) overflow(_("token"));
@z
@x
@@ -937,9 +970,9 @@ to \.{\\PB}. Although \.{ctwimac} ignores \.{\\PB}, other macro packages
@z
@x
-reset_input(); if (show_progress) fputs("\nWriting the output file...",stdout);
+if (show_progress) fputs("\nWriting the output file...",stdout);
@y
-reset_input(); if (show_progress) fputs(_("\nWriting the output file..."),stdout);
+if (show_progress) fputs(_("\nWriting the output file..."),stdout);
@z
@x
@@ -1000,7 +1033,7 @@ flush_buffer(out_ptr,false,false);
case '@@': out('@@'); break;
@y
case '@@': out('@@'); break;
- case temp_meaning: temp_switch=true-temp_switch; break;
+ case temp_meaning: temp_switch=!temp_switch; break;
case right_start: right_start_switch=true; break;
@z
@@ -1176,19 +1209,18 @@ the index section itself---NOT!
@z
@x
-@ @<Tell about changed sections@>= {
- /* remember that the index is already marked as changed */
- k_section=0;
- while (!changed_section[++k_section]);
- out_str("\\ch ");
+@ @<Tell about changed sections@>=
+/* remember that the index is already marked as changed */
+k_section=0;
+while (!changed_section[++k_section]);
+out_str("\\ch ");
@.\\ch@>
- out_section(k_section);
- while (k_section<section_count) {
- while (!changed_section[++k_section]);
- out_str(", "); out_section(k_section);
- }
- out('.');
+out_section(k_section);
+while (k_section<section_count) {
+ while (!changed_section[++k_section]);
+ out_str(", "); out_section(k_section);
}
+out('.');
@y
@ No need to tell about changed sections.
@z
@@ -1201,11 +1233,13 @@ the index section itself---NOT!
@x
@ @<Output the name...@>=
+switch (cur_name->ilk) {@+char *j;@+@t}\6{\4@>
@y
@ We don't format the index completely; the \.{twinx} program does the
rest of the job.
@<Output the name...@>=
+switch (cur_name->ilk) {
@z
@x
@@ -1215,6 +1249,12 @@ rest of the job.
@z
@x
+ else {
+@y
+ else {@+char *j;@+@t}\6{@>
+@z
+
+@x
case wildcard: out_str("\\9");@+ goto not_an_identifier;
@y
case roman: out_str(" ");@+ goto not_an_identifier;
@@ -1238,12 +1278,7 @@ not_an_identifier: out_name(cur_name,false); goto name_done;
@x
out_name(cur_name,true);
@y
-if (proofing) out_name(cur_name,true);
-else {@+char *j;
- out('{');
- for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++) out(*j);
- out('}');
-}
+out_name(cur_name,proofing);
@z
@x
@@ -1298,15 +1333,15 @@ else {@+char *j;
@x
@** Index.
@y
-@q Section 272. @>
+@q Section 271. @>
@** Mogrify {\tentex CWEAVE} into {\tentex CTWILL}. The following sections
introduce material that is specific to \.{CTWILL}.
Care has been taken to keep the original section numbering of \.{CWEAVE}
up to this point intact, so this new material should nicely integrate
-with the original ``\&{272.~Index}.''
+with the original ``\&{271.~Index}.''
-@q Section 2->273. @>
+@q Section 2->272. @>
@* {\tentex CTWILL} user manual.
Here is a sort of user manual for \.{CTWILL}---which is exactly like
\.{CWEAVE} except that it produces much better documentation, for which you
@@ -1356,12 +1391,12 @@ please do so.
understanding this method, you will understand how to fix it when things
go wrong. Every identifier has a current ``meaning,'' consisting of its
abstract type and the number of the section in which it was most recently
-defined. For example, if your \Cee\ program says `|char *s|' in section~3,
-the meaning of~|s| gets changed to `\&{char} $*$, \S3' while \.{CTWILL}
+defined. For example, if your \Cee\ program says `\&{char}~$*$|s|' in section~3,
+the meaning of~|s| gets changed to `\&{char}~$*$,~\S3' while \.{CTWILL}
is processing that section. If you refer to~|s| in section~10, and if
|s|~hasn't been redefined in the meantime, and if section~10 doesn't
wind up on the same two-page spread as section~3, the mini-index generated
-by section~10 will say ``|s|: \&{char}~$*$, \S3.''
+by section~10 will say ``|s|:~\&{char}~$*$,~\S3.''
The current meaning of every identifier is initially `\.{\\uninitialized}'.
Then \.{CTWILL} reads the \.{.aux} file for your job, if any; this
@@ -1428,7 +1463,7 @@ with `\.=', the mini-index entry will contain an equals sign instead
of a colon; for example,
$$\.{@@\$buf\_size \{PROG\}10 =\\T\{200\}@@>}$$
generates either `$\\{buf\_size}=200$, \S10' or
-`$\\{buf\_size}=200$, {\sc PROG}\S10', depending on whether
+`$\\{buf\_size}=200$, {\sc PROG}~\S10', depending on whether
`{\sc PROG}' is or isn't the title of the current program. If the
\TeX\ part is `\.{\\zip}', the mini-index entry will contain neither
colon nor equals, just a comma. The program name and section number
@@ -1467,7 +1502,7 @@ which are quite different from the change files you set up for tangling.
@d max_tex_chars 50 /* limit on the \TeX\ part of a meaning */
-@q Section 25->274. @>
+@q Section 25->273. @>
@* Temporary and permanent meanings.
\.{CTWILL} has special data structures to keep track of current
and temporary meanings. These structures were not designed for maximum
@@ -1485,33 +1520,39 @@ typedef struct {
char tex_part[max_tex_chars]; /* \TeX\ part of meaning */
} meaning_struct;
-@q Section 26->275. @>
+@q Section 26->274. @>
@ @<Private...@>=
-struct perm_meaning {
+static struct perm_meaning {
meaning_struct perm; /* current meaning of an identifier */
int stamp; /* last section number in which further output suppressed */
struct perm_meaning *link; /* another meaning to output in this section */
} cur_meaning[max_names]; /* the current ``permanent'' meanings */
static struct perm_meaning *top_usage; /* first meaning to output in this section */
static meaning_struct temp_meaning_stack[max_meanings]; /* the current ``temporary'' meanings */
+static meaning_struct *temp_meaning_stack_end=temp_meaning_stack+max_meanings-1;
+ /* end of |temp_meaning_stack| */
static meaning_struct *temp_meaning_ptr; /* first available slot in |temp_meaning_stack| */
static meaning_struct *max_temp_meaning_ptr; /* its maximum value so far */
static name_pointer title_code[max_titles]; /* program names seen so far */
+static name_pointer *title_code_end=title_code+max_titles-1;
+ /* end of |title_code| */
static name_pointer *title_code_ptr; /* first available slot in |title_code| */
static char ministring_buf[max_tex_chars]; /* \TeX\ code being generated */
+static char *ministring_buf_end=ministring_buf+max_tex_chars-1;
+ /* end of |ministring_buf| */
static char *ministring_ptr; /* first available slot in |ministring_buf| */
static boolean ms_mode; /* are we outputting to |ministring_buf|? */
-@q Section 27->276. @>
+@q Section 27->275. @>
@ @<Set init...@>=
max_temp_meaning_ptr=temp_meaning_stack;
title_code_ptr=title_code;
ms_mode=false;
-@q Section 277. @>
+@q Section 276. @>
@ @<Predec...@>=@+static void new_meaning(name_pointer);
-@q Section 30->278. @>
+@q Section 30->277. @>
@ The |new_meaning| routine changes the current ``permanent meaning''
when an identifier is redeclared. It gets the |tex_part| from
|ministring_buf|.
@@ -1521,11 +1562,11 @@ static void
new_meaning(
name_pointer p)
{
- struct perm_meaning *q=p-name_dir+cur_meaning;
+ struct perm_meaning *q=get_meaning(p);
ms_mode=false;
if (q->stamp!=section_count) {
if (*(ministring_ptr-1)==' ') ministring_ptr--;
- if (ministring_ptr>=&ministring_buf[max_tex_chars])
+ if (ministring_ptr>=ministring_buf_end)
strcpy(ministring_buf,"\\zip"); /* ignore |tex_part| if too long */
@.\\zip@>
else *ministring_ptr='\0';
@@ -1536,7 +1577,7 @@ new_meaning(
@<Write the new meaning to the \.{.aux} file@>@;
}
-@q Section 75->279. @>
+@q Section 75->278. @>
@ @<Process a user-generated meaning@>=
{ char *first=id_first;
while (xisspace(*first)) first++;
@@ -1556,25 +1597,25 @@ new_meaning(
loc=id_loc+2;
}
-@q Section 76->280. @>
+@q Section 76->279. @>
@ @<Suppress mini-index entry@>=
{ char *first=id_first,*last=id_loc;
while (xisspace(*first)) first++;
while (xisspace(*(last-1))) last--;
if (first<last) {
- struct perm_meaning *q=id_lookup(first,last,normal)-name_dir+cur_meaning;
+ struct perm_meaning *q=get_meaning(id_lookup(first,last,normal));
q->stamp=section_count; /* this is what actually suppresses output */
}
}
-@q Section 77->281. @>
+@q Section 77->280. @>
@ @<Digest...@>=
{ meaning_struct *m;
- struct perm_meaning *q=p-name_dir+cur_meaning;
+ struct perm_meaning *q=get_meaning(p);
if (temp_switch) {
m=temp_meaning_ptr++;
if (temp_meaning_ptr>max_temp_meaning_ptr) {
- if (temp_meaning_ptr>&temp_meaning_stack[max_meanings])
+ if (temp_meaning_ptr>=temp_meaning_stack_end)
overflow(_("temp meanings"));
max_temp_meaning_ptr=temp_meaning_ptr;
}
@@ -1590,7 +1631,7 @@ new_meaning(
}
}
-@q Section 141->282/3. @>
+@q Section 141->281/2. @>
@* Make ministrings.
\.{CTWILL} needs the following procedure, which appends tokens of a
translated text until coming to |tok_loc|, then suppresses text that may
@@ -1606,25 +1647,24 @@ static boolean app_supp(
{ token_pointer j;
if (ident_seen && **p>=tok_flag)
switch (**(**p-tok_flag+tok_start)) {
- case '(': app('(');@+app('\\');@+app(',');@+app(')'); goto catch14;
- case '[': app('[');@+app('\\');@+app(',');@+app(']'); goto catch14;
+ case '(': app_str("(\\,)"); goto catch14;
+ case '[': app_str("[\\,]"); goto catch14;
}
- for (j=*p;j<*(p+1);j++) {
+ for (j=*p;j<*(p+1);j++)
if (*j<tok_flag) {
if (*j==inserted) break;
if (j==tok_loc) ident_seen=true;
else app(*j);
} else if (*j>=inner_tok_flag) confusion(_("inner"));
else if (app_supp(*j-tok_flag+tok_start)) goto catch14;
- }
return false;
catch14: return *(*(p+1)-1)=='9'; /* was production 14 used? */
}
-@q Section 284. @>
+@q Section 283. @>
@ @<Predec...@>=@+static boolean app_supp(text_pointer);
-@q Section 142->285. @>
+@q Section 142->284. @>
@ The trickiest part of \.{CTWILL} is the procedure |make_ministring(l)|,
which tries to figure out a symbolic form of definition after
|make_underlined(pp+l)| has been called. We rely heavily on the
@@ -1655,14 +1695,14 @@ make_ministring(
cur_mathness=maybe_math; /* restore it */
}
-@q Section 286. @>
+@q Section 285. @>
@ @<Predec...@>=@+static void make_ministring(int);
-@q Section 43->287. @>
+@q Section 43->286. @>
@ @<Private...@>=
static sixteen_bits int_loc, ext_loc; /* locations of special reserved words */
-@q Section 143->288. @>
+@q Section 143->287. @>
@ Here we use the fact that a |decl_head| comes from |int_like| only in
production~27, whose translation is fairly easy to recognize. (Well,
production 28 has been added for \CPLUSPLUS/, but we hope that doesn't
@@ -1703,7 +1743,7 @@ else {
@<Append tokens for type |q|@>@;
}
-@q Section 144->289. @>
+@q Section 144->288. @>
@ @<Append tokens for type |q|@>=
cur_mathness=no_math; /* it was |maybe_math| */
if (*(q+1)==*q+8 && *(*q+1)==' ' && *(*q+3)==' ') {
@@ -1715,13 +1755,13 @@ while (ast_count) {
big_app('{');@+app('*');@+app('}');@+ast_count--;
}
-@q Section 253->290. @>
+@q Section 253->289. @>
@ @<Private...@>=
static boolean is_macro; /* it's a macro def, not a format def */
static boolean def_diff; /* |false| iff the current macro has parameters */
static name_pointer id_being_defined; /* the definee */
-@q Section 257->291. @>
+@q Section 257->290. @>
@ @<Make ministring for a new macro@>=
{
ms_mode=true; ministring_ptr=ministring_buf;
@@ -1739,14 +1779,14 @@ static name_pointer id_being_defined; /* the definee */
new_meaning(id_being_defined);
}
-@q Section 246->292. @>
+@q Section 246->291. @>
@* Process {\tentex .aux} files.
@<Private...@>=
static FILE *aux_file;
static char aux_file_name[max_file_name_length]; /* name of \.{.aux} file */
-@q Section 247->293. @>
+@q Section 247->292. @>
@ @<Read the \.{.aux} file, if present; then open it for output@>=
memcpy(aux_file_name,tex_file_name,strlen(tex_file_name)-4);
strcat(aux_file_name,".bux");
@@ -1767,7 +1807,7 @@ if (include_depth) { /* at least one new file was opened */
if ((aux_file=fopen(aux_file_name,"wb"))==NULL)
fatal(_("! Cannot open aux output file "),aux_file_name);
-@q Section 31->294. @>
+@q Section 31->293. @>
@ @<Write the new meaning to the \.{.aux} file@>=
{@+int n=q->perm.prog_no;
fprintf(aux_file,"@@$%.*s %.*s",@|
@@ -1777,7 +1817,7 @@ if ((aux_file=fopen(aux_file_name,"wb"))==NULL)
fprintf(aux_file," %s@@>\n",q->perm.tex_part);
}
-@q Section 268->295. @>
+@q Section 268->294. @>
@* Usage of identifiers.
The following code is performed for each identifier parsed during
a section. Variable |top_usage| is always nonzero; it has the sentinel
@@ -1788,20 +1828,20 @@ placed on the list, unless they are reserved and their current
\TeX\ meaning is uninitialized.
@<Flag the usage of this identifier, for the mini-index@>=
-{ struct perm_meaning *q=p-name_dir+cur_meaning;
- if (!(abnormal(p)) || strcmp(q->perm.tex_part,"\\uninitialized")!=0)
+{ struct perm_meaning *q=get_meaning(p);
+ if (!abnormal(p) || strcmp(q->perm.tex_part,"\\uninitialized")!=0)
if (q->link==NULL) {
q->link=top_usage;
top_usage=q;
}
}
-@q Section 269->296. @>
+@q Section 269->295. @>
@ @<Output information about usage of id's defined in other sections@>=
{ struct perm_meaning *q;
while (temp_meaning_ptr>temp_meaning_stack) {
out_mini(--temp_meaning_ptr);
- q=temp_meaning_ptr->id-name_dir+cur_meaning;
+ q=get_meaning(temp_meaning_ptr->id);
q->stamp=section_count; /* suppress output from ``permanent'' data */
}
while (top_usage!=usage_sentinel) {
@@ -1812,7 +1852,7 @@ placed on the list, unless they are reserved and their current
}
}
-@q Section 270->297. @>
+@q Section 270->296. @>
@ @c static void
out_mini(
meaning_struct *m)
@@ -1831,20 +1871,20 @@ out_mini(
out(' '); out_str(m->tex_part); finish_line();
}
-@q Section 271->298. @>
+@q Section 271->297. @>
@ @<Predec...@>=@+static void out_mini(meaning_struct *);
-@q Section 272->299. @>
+@q Section 272->298. @>
@ Compare this code with section |@<Output the name...@>|.
@<Mini-output...@>=
-switch (cur_name->ilk) {@+char *j;
+switch (cur_name->ilk) {@+char *j;@+@t}\6{\4@>
case normal: case func_template:
if (is_tiny(cur_name)) out_str("\\|");
else {
for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++)
if (xislower(*j)) goto lowcase;
- out_str("\\."); break;
+ goto allcaps;
lowcase: out_str("\\\\");
}
break;
@@ -1853,7 +1893,7 @@ lowcase: out_str("\\\\");
@.\\\\@>
case wildcard: out_str("\\9"); break;
@.\\9@>
- case typewriter: out_str("\\.");
+ case typewriter: allcaps: out_str("\\.");
@.\\.@>
case roman: break;
case custom:
@@ -1868,7 +1908,7 @@ lowcase: out_str("\\\\");
out_name(cur_name,true);
name_done:@;
-@q Section 28->300. @>
+@q Section 28->299. @>
@* Handle program title.
Here's a routine that converts a program title from the buffer
into an internal number for the |prog_no| field of a meaning.
@@ -1891,17 +1931,17 @@ It advances |loc| past the title found.
} else err_print(_("! Title should be enclosed in braces or doublequotes"));
last=++loc;
if (last>limit) err_print(_("! Title name didn't end"));
- if (title_code_ptr==&title_code[max_titles]) overflow(_("titles"));
+ if (title_code_ptr==title_code_end) overflow(_("titles"));
*title_code_ptr=id_lookup(first,last,title);
for (p=title_code;true;p++) if (*p==*title_code_ptr) break;
if (p==title_code_ptr) title_code_ptr++;
return p-title_code;
}
-@q Section 301. @>
+@q Section 300. @>
@ @<Predec...@>=@+static sixteen_bits title_lookup(void);
-@q Section 29->302. @>
+@q Section 29->301. @>
@ @<Give a default title to the program, if necessary@>=
if (title_code_ptr==title_code) { /* no \.{\\def\\title} found in limbo */
char *saveloc=loc,*savelimit=limit; /* save */
@@ -1914,7 +1954,7 @@ if (title_code_ptr==title_code) { /* no \.{\\def\\title} found in limbo */
loc=saveloc; limit=savelimit; /* restore */
}
-@q Section 303. @>
+@q Section 302. @>
@** Extensions to {\tentex CWEB}. The following sections introduce new or
improved features that have been created by numerous contributors over the
course of a quarter century.