summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2021-04-16 12:49:28 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2021-04-16 12:49:28 +0000
commit611b225a456949639e46d4ccb7d458761c3dc818 (patch)
tree23077732a961b5fcd9c25530d594a0ac2cd6fb1a /Build/source/texk/web2c/cwebdir/cweav-w2c.ch
parent296df34bd02be9e066be5af0f934d493916b2c67 (diff)
[CWEB] New release 4.3.
This release introduces new features to CWEB 4: * Former option '-t' is now called '-c'. - New option '-t' for CWEAVE when dealing with 'typename' in C++ templates. - New option '-k' for CTANGLE to keep '-separators in numeric literals. * Support for "variadic macros" along "variadic functions". * @d is printed similar to #define (and vice versa): - '#' is no longer printed in boldface. - Spacing is similar in most cases. * Support for extended C99/C++ numeric literals: - hexadecimal, octal, and -- new! -- binary numbers. - NOTE: 'cwebmac.tex 4.3' is NOT compatible with CWEAVE 4.2 and older and vice versa. * Long parameter lists in ANSI function definitions are indented similar to old-style function parameters. - Option '-i' works similar for old-style and modern function headers. * Additional C99/C++ keywords -- from 'alignas' to 'thread_local' -- are supported internally. * '@i'nclude file 'iso_types.w' for numeric types (in addition to 'c++lib.w'). * Countless code modifications, including some corrections amd improvements. Thanks and cudos to Github user "@texdraft" for numerous contributions to this feature release! git-svn-id: svn://tug.org/texlive/trunk@58884 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/cweav-w2c.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/cweav-w2c.ch82
1 files changed, 38 insertions, 44 deletions
diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
index 3f63105075a..26c6c6699f8 100644
--- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
@@ -17,15 +17,15 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
@x
-\def\title{CWEAVE (Version 4.2)}
+\def\title{CWEAVE (Version 4.3)}
@y
-\def\title{CWEAVE (Version 4.2 [\TeX~Live])}
+\def\title{CWEAVE (Version 4.3 [\TeX~Live])}
@z
@x
- \centerline{(Version 4.2)}
+ \centerline{(Version 4.3)}
@y
- \centerline{(Version 4.2 [\TeX~Live])}
+ \centerline{(Version 4.3 [\TeX~Live])}
@z
@x
@@ -41,9 +41,9 @@
@z
@x
-@d banner "This is CWEAVE (Version 4.2)"
+@d banner "This is CWEAVE (Version 4.3)"
@y
-@d banner "This is CWEAVE, Version 4.2"
+@d banner "This is CWEAVE, Version 4.3"
/* will be extended by the \TeX~Live |versionstring| */
@z
@@ -252,14 +252,14 @@ tex_puts("cwebma");
@c
static void
-print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */
+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' */
@c
#if 0
-static void
-print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */
+@t\4\4@>static void
+print_text( /* prints a token list for debugging; not used in |main| */
@z
@x
@@ -281,16 +281,13 @@ static void print_text(text_pointer p);
@x
@<Cases for |exp|@>=
if (cat1==lbrace || cat1==int_like || cat1==decl) {
- make_underlined(pp); big_app1(pp); big_app(indent); app(indent);
+ make_underlined(pp); big_app(dindent); big_app1(pp);
reduce(pp,1,fn_decl,0,1);
}
@y
@<Cases for |exp|@>=
if(cat1==lbrace || cat1==int_like || cat1==decl) {
- make_underlined(pp); big_app1(pp);
- if (indent_param_decl) {
- big_app(indent); app(indent);
- }
+ make_underlined(pp); if (indent_param_decl) big_app(dindent); big_app1(pp);
reduce(pp,1,fn_decl,0,1);
}
@z
@@ -301,8 +298,7 @@ if (cat1==comma) {
big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
}
else if (cat1==ubinop) {
- big_app1(pp); big_app('{'); big_app1(pp+1); big_app('}');
- reduce(pp,2,decl_head,-1,34);
+ big_app1_insert(pp,'{'); big_app('}'); reduce(pp,2,decl_head,-1,34);
}
else if (cat1==exp && cat2!=lpar && cat2!=exp && cat2!=cast) {
make_underlined(pp+1); squash(pp,2,decl_head,-1,35);
@@ -312,7 +308,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_app1(pp); big_app(indent); app(indent); reduce(pp,1,fn_decl,0,38);
+ big_app(dindent); big_app1(pp); reduce(pp,1,fn_decl,0,38);
}
else if (cat1==semi) squash(pp,2,decl,-1,39);
@y
@@ -321,7 +317,7 @@ if (cat1==comma) {
big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
}
else if (cat1==ubinop) {
- big_app1(pp); big_app('{'); big_app1(pp+1); big_app('}');
+ big_app1_insert(pp,'{'); big_app('}');
reduce(pp,2,decl_head,-1,34);
}
else if (cat1==exp && cat2!=lpar && cat2!=exp && cat2!=cast) {
@@ -332,10 +328,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_app1(pp);
- if (indent_param_decl) {
- big_app(indent); app(indent);
- }
+ if (indent_param_decl) big_app(dindent); big_app1(pp);
reduce(pp,1,fn_decl,0,38);
}
else if (cat1==semi) squash(pp,2,decl,-1,39);
@@ -344,31 +337,26 @@ else if (cat1==semi) squash(pp,2,decl,-1,39);
@x
@ @<Cases for |decl|@>=
if (cat1==decl) {
- big_app1(pp); big_app(force); big_app1(pp+1);
- reduce(pp,2,decl,-1,40);
+ big_app1_insert(pp,force); reduce(pp,2,decl,-1,40);
}
else if (cat1==stmt || cat1==function) {
- big_app1(pp); big_app(big_force);
- big_app1(pp+1); reduce(pp,2,cat1,-1,41);
+ big_app1_insert(pp,big_force); reduce(pp,2,cat1,-1,41);
}
@y
@ @<Cases for |decl|@>=
if (cat1==decl) {
- big_app1(pp); big_app(force); big_app1(pp+1);
- reduce(pp,2,decl,-1,40);
+ big_app1_insert(pp,force); reduce(pp,2,decl,-1,40);
}
else if (cat1==stmt || cat1==function) {
- big_app1(pp);
- if(order_decl_stmt) big_app(big_force);
- else big_app(force);
- big_app1(pp+1); reduce(pp,2,cat1,-1,41);
+ big_app1_insert(pp,order_decl_stmt ? big_force : force);
+ reduce(pp,2,cat1,-1,41);
}
@z
@x
@ @<Cases for |fn_decl|@>=
if (cat1==decl) {
- big_app1(pp); big_app(force); big_app1(pp+1); reduce(pp,2,fn_decl,0,51);
+ big_app1_insert(pp,force); reduce(pp,2,fn_decl,0,51);
}
else if (cat1==stmt) {
big_app1(pp); app(outdent); app(outdent); big_app(force);
@@ -377,19 +365,25 @@ else if (cat1==stmt) {
@y
@ @<Cases for |fn_decl|@>=
if (cat1==decl) {
- big_app1(pp); big_app(force); big_app1(pp+1); reduce(pp,2,fn_decl,0,51);
+ big_app1_insert(pp,force); reduce(pp,2,fn_decl,0,51);
}
else if (cat1==stmt) {
big_app1(pp);
if (indent_param_decl) {
app(outdent); app(outdent);
}
- big_app(force);
- big_app1(pp+1); reduce(pp,2,function,-1,52);
+ big_app(force); big_app1(pp+1); reduce(pp,2,function,-1,52);
}
@z
@x
+ big_app1_insert(pp,dindent); reduce(pp,2,fn_decl,0,73);
+@y
+ big_app1(pp); if (indent_param_decl) big_app(dindent);
+ big_app1(pp+1); reduce(pp,2,fn_decl,0,73);
+@z
+
+@x
overflow("token");
@y
overflow(_("token"));
@@ -620,17 +614,17 @@ finish_line(); fclose(active_file); active_file=NULL;
@x
@** Index.
@y
-@** Extensions to \.{CWEB}. The following sections introduce new or improved
-features that have been created by numerous contributors over the course of a
-quarter century.
+@** 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.
Care has been taken to keep the original section numbering intact, so this new
-material should nicely integrate with the original ``\&{263.~Index}.''
+material should nicely integrate with the original ``\&{272.~Index}.''
@* Formatting alternatives.
-\.{CWEAVE} indents declarations after old-style function definitions.
-With the \.{-i} option they will come out flush left. You won't see
-any difference if you use ANSI-style function definitions.
+\.{CWEAVE} indents declarations after old-style function definitions and
+long parameter lists of modern function definitions.
+With the \.{-i} option they will come out flush left.
@d indent_param_decl flags['i'] /* should formal parameter declarations be indented? */
@@ -664,7 +658,7 @@ if((tex_file=fopen(tex_file_name,"r"))!=NULL) {
fatal(_("! Cannot open output file "),check_file_name);
@.Cannot open output file@>
- if (temporary_output) @<Compare the temporary output...@>@;
+ if (check_for_change) @<Compare the temporary output...@>@;
fclose(tex_file); tex_file=NULL;
fclose(check_file); check_file=NULL;