Skip to content

Commit

Permalink
CWEB - release 4.6, 2021-12-26.
Browse files Browse the repository at this point in the history
This new release of CWEB 4 mainly deals with three issues:

* Restore '\T' macro for backward compatibility.

    CWEB 4.3 introduced a huge incompatibility between CWEAVE and
    CWEBMAC.TEX for numeric constants.

    Instead of working with '/' for the single special case of 'hex
    exponent' (as in '0x1FFFFp10'), CWEAVE splits off the 'p' part from
    '\T' and CWEBMAC.TEX formats the 'hex exponent' with macro '\p'.
    All of this is, of course, yet another kludge.

* Review 'prod.w' and cleanup index.

    The 'Examples' should not create entries in the index.

    Moreover, the original 'prod.w' had several severe problems when
    formatted with 'cweave -e prod; pdftex prod', because quite a few
    arguments of '\malt' and '\maltt' where not {group}ed correctly.

* Make 'squash' fully orthogonal on parameter 'k'.

    Now 'squash(pp,k,...)' always works as abbreviation for 'big_app${k}(pp);
    reduce(pp,k,...)' as described in the TeX part of section 118.

    The former special case 'k==1' gets shifted to 'reduce' with special
    value 'k==0'. This variant never is preceded by 'big_app1(pp)' and skips
    several internal commands.

And as always, tons of minor changes, fixes, and redactions were made.
  • Loading branch information
ascherer committed Dec 26, 2021
1 parent bc5703f commit a457dcc
Show file tree
Hide file tree
Showing 26 changed files with 364 additions and 355 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of CWEB.
# It is distributed WITHOUT ANY WARRANTY, express or implied.
# Version 4.5 --- July 2021
# Version 4.6 --- December 2021

# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth

Expand Down Expand Up @@ -78,7 +78,7 @@ ALL = common.w ctangle.w cweave.w prod.w \
cwebman.tex cwebmac.tex comm-vms.ch ctang-vms.ch \
cweav-vms.ch comm-man.ch ctang-man.ch cweav-man.ch \
comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \
comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \
comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \
comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \
comm-w32.ch ctang-w32.ch cweav-w32.ch \
comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w iso_types.w
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cweb 4.5
# cweb 4.6

people have been accumulating several decades of experience with
[cweb](http://www-cs-faculty.stanford.edu/~uno/cweb.html), and we know that
Expand All @@ -19,19 +19,19 @@ details in the
besides for further development, this ‘project’ is used as an – obviously
incomplete – repository of original release versions of levy/knuth
[cweb](http://www-cs-faculty.stanford.edu/~uno/cweb.html). you can either
compile these sources directly or stick the recent version “cweb-4.5” into my
compile these sources directly or stick the recent version “cweb-4.6” into my
[cwebbin](https://github.com/ascherer/cwebbin), which introduces convenient
extensions and prepares cweb for inclusion in the “tex live” distribution.

## call for help

recently i spotted versions 2.7 and 2.8 in
[utah](http://ftp.math.utah.edu/pub/tex/pub/cweb/) – and there's even "the"
[original cweb 2.8](ftp://ftp.cs.stanford.edu/pub/cweb2.8) in stanford –, but
[original cweb 2.8](http://ftp.cs.stanford.edu/pub/cweb2.8) in stanford –, but
the intermediate versions 3.0 and 3.1 are still missing in my collection. i
could scrape them from
[amiga](ftp://91.204.149.69/Amiga/CD%20images/Aminet%20Set/1%20(Jan%201995)/AMINET/DEV/C/)
[amiga](http://aminet.net/search?query=cweb)
a/o [atari
archives](ftp://ftp.cstug.cz/pub/CTAN/systems/atari/lindner-tex/cweb-3.0-1.2.zoo),
archives](http://ftp.cstug.cz/pub/CTAN/systems/atari/lindner-tex/cweb-3.0-1.2.zoo),
but i'd rather have the respective originals. in case you can direct me to
appropriate archive servers, i'd be really grateful.
4 changes: 2 additions & 2 deletions comm-bs.ch
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ boolean ispref) /* are we adding a prefix or a full name? */
@x Section 63.
static int section_name_cmp(
char **pfirst, /* pointer to beginning of comparison string */
int len, /* length of string */
size_t len, /* length of string */
name_pointer r) /* section name being compared */
{
char *first=*pfirst; /* beginning of comparison string */
Expand All @@ -192,7 +192,7 @@ name_pointer r) /* section name being compared */
@y
static int section_name_cmp(
char huge** pfirst, /* pointer to beginning of comparison string */
int len, /* length of string */
size_t len, /* length of string */
name_pointer r) /* section name being compared */
{
char huge* first=*pfirst; /* beginning of comparison string */
Expand Down
4 changes: 2 additions & 2 deletions comm-mac.ch
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ No changes to CTANGLE or CWEAVE are needed.
(Contributed 13 Oct 2000 by [email protected]; slightly edited by Don Knuth)
@x in limbo, change the title page document to specify Mac version
\centerline{(Version 4.5)}
\centerline{(Version 4.6)}
@y
\centerline{(Version 4.5 for MacOS)}
\centerline{(Version 4.6 for MacOS)}
@z
@x section 23: Make input_ln accept \n, \r, \n\r, or \r\n as line endings
Expand Down
8 changes: 4 additions & 4 deletions comm-ql.ch
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c'
@x
\def\v{\char'174} % vertical (|) in typewriter font

\def\title{Common code for CTANGLE and CWEAVE (Version 4.5)}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.6)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
\centerline{(Version 4.5)}
\centerline{(Version 4.6)}
\vfill}
\def\botofcontents{\vfill
\noindent
@y
\def\v{\char'174} % vertical (|) in typewriter font
\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.5)}
\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.6)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
\centerline{(Version 4.5)}
\centerline{(Version 4.6)}
\vfill}
\def\botofcontents{\vfill
\noindent
Expand Down
4 changes: 2 additions & 2 deletions comm-vms.ch
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ modified:
#include <stdbool.h> /* definition of |@!bool|, |@!true| and |@!false| */
#include <stddef.h> /* definition of |@!ptrdiff_t| */
#include <stdint.h> /* definition of |@!uint8_t| and |@!uint16_t| */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <stdio.h> /* definition of |@!printf| and friends */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <string.h> /* definition of |@!strlen|, |@!strcmp| and so on */
@y
#include ctype /* definition of |@!isalpha|, |@!isdigit| and so on */
/* VMS searches text libraries faster */
#include stdbool /* definition of |@!bool|, |@!true| and |@!false| */
#include stddef /* definition of |@!ptrdiff_t| */
#include stdint /* definition of |@!uint8_t| and |@!uint16_t| */
#include stdlib /* definition of |@!getenv| and |@!exit| */
#include stdio /* definition of |@!printf| and friends */
#include stdlib /* definition of |@!getenv| and |@!exit| */
#include string /* definition of |@!strlen|, |@!strcmp| and so on */
@z
Expand Down
2 changes: 1 addition & 1 deletion common.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*:3*/
Expand Down
8 changes: 4 additions & 4 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
% Version 4.5 --- July 2021 (works also with later versions)
% Version 4.6 --- December 2021 (works also with later versions)

% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth

Expand All @@ -12,8 +12,8 @@

% Permission is granted to copy and distribute modified versions of this
% document under the conditions for verbatim copying, provided that the
% entire resulting derived work is distributed under the terms of a
% permission notice identical to this one.
% entire resulting derived work is given a different name and distributed
% under the terms of a permission notice identical to this one.

% Amendments to 'common.h' resulting in this updated version were created
% by numerous collaborators over the course of many years.
Expand Down Expand Up @@ -46,8 +46,8 @@ extern int phase; /* which phase are we in? */
#include <stdbool.h> /* definition of |@!bool|, |@!true| and |@!false| */
#include <stddef.h> /* definition of |@!ptrdiff_t| */
#include <stdint.h> /* definition of |@!uint8_t| and |@!uint16_t| */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <stdio.h> /* definition of |@!printf| and friends */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <string.h> /* definition of |@!strlen|, |@!strcmp| and so on */

@ Code related to the character set:
Expand Down
6 changes: 3 additions & 3 deletions common.w
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
% Version 4.5 --- July 2021
% Version 4.6 --- December 2021

% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth

Expand All @@ -22,12 +22,12 @@

\def\v{\char'174} % vertical (|) in typewriter font

\def\title{Common code for CTANGLE and CWEAVE (Version 4.5)}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.6)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
\centerline{(Version 4.5)}
\centerline{(Version 4.6)}
\vfill}
\def\botofcontents{\vfill
\noindent
Expand Down
4 changes: 2 additions & 2 deletions ctang-bs.ch
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ by using "huge" pointers.
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.

@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"
@y
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.

@d banner "This is CTANGLE (Version 4.5pc/big)"
@d banner "This is CTANGLE (Version 4.6pc/big)"
@z


Expand Down
4 changes: 2 additions & 2 deletions ctang-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ that allows >64K arrays. If you need lots of bytes and toks, try the
alternate change files with -bs suffix instead of -pc.
@x section 1
@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"
@y
@d banner "This is CTANGLE (Version 4.5pc)"
@d banner "This is CTANGLE (Version 4.6pc)"
@z
@x section 17
@d max_bytes 90000 /* the number of bytes in identifiers,
Expand Down
8 changes: 4 additions & 4 deletions ctang-ql.ch
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c -=500000 ctangle_c"
@x
\def\title{CTANGLE (Version 4.5)}
\def\title{CTANGLE (Version 4.6)}
@y
\def\title{CTANGLE (QL Version 4.5)}
\def\title{CTANGLE (QL Version 4.6)}
@z
@x section 1
@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"
@y
@d banner "This is CTANGLE (QL Version 4.5)"
@d banner "This is CTANGLE (QL Version 4.6)"
@z
@x
Expand Down
8 changes: 4 additions & 4 deletions ctang-vms.ch
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ created:
(these changes not necessary for initial bootstrapping)
@x section 1 (01-FEB-1992 ST)
@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"
@y
@d banner "This is CTANGLE (VAX/VMS Version 4.5)"
@d banner "This is CTANGLE (VAX/VMS Version 4.6)"
@z
@x section 4 (01-FEB-1992 ST)
#include <ctype.h> /* definition of |@!isalpha|, |@!isdigit| and so on */
#include <stdbool.h> /* definition of |@!bool|, |@!true| and |@!false| */
#include <stddef.h> /* definition of |@!ptrdiff_t| */
#include <stdint.h> /* definition of |@!uint8_t| and |@!uint16_t| */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <stdio.h> /* definition of |@!printf| and friends */
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */
#include <string.h> /* definition of |@!strlen|, |@!strcmp| and so on */
@y
#include ctype /* definition of |@!isalpha|, |@!isdigit| and so on */
/* VMS searches text libraries faster */
#include stdbool /* definition of |@!bool|, |@!true| and |@!false| */
#include stddef /* definition of |@!ptrdiff_t| */
#include stdint /* definition of |@!uint8_t| and |@!uint16_t| */
#include stdlib /* definition of |@!getenv| and |@!exit| */
#include stdio /* definition of |@!printf| and friends */
#include stdlib /* definition of |@!getenv| and |@!exit| */
#include string /* definition of |@!strlen|, |@!strcmp| and so on */
@z
4 changes: 2 additions & 2 deletions ctang-w32.ch
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This is the change file for CWEB's CTANGLE under Win32
Changes necessary for compiling with Borland C/C++
@x section 1
@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"
@y
@d banner "This is CTANGLE (Version 4.5win32)"
@d banner "This is CTANGLE (Version 4.6win32)"
@z
@x
Expand Down
6 changes: 3 additions & 3 deletions ctangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*:4*/
#line 67 "ctangle.w"

#define banner "This is CTANGLE (Version 4.5)" \
#define banner "This is CTANGLE (Version 4.6)" \

#define ctangle false
#define cweave true \
Expand Down Expand Up @@ -1583,8 +1583,8 @@ if(loc> limit&&get_line()==false)return;
while(*loc!='@')loc++;
if(loc++<=limit){
char c= *loc++;
if(ccode[(eight_bits)c]==new_section)break;
switch(ccode[(eight_bits)c]){
case new_section:return;
case translit_code:/*102:*/
#line 1516 "ctangle.w"

Expand Down
12 changes: 6 additions & 6 deletions ctangle.w
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
% Version 4.5 --- July 2021
% Version 4.6 --- December 2021

% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth

Expand All @@ -27,11 +27,11 @@
\mathchardef\RA="3221 % right arrow
\mathchardef\BA="3224 % double arrow

\def\title{CTANGLE (Version 4.5)}
\def\title{CTANGLE (Version 4.6)}
\def\topofcontents{\null\vfill
\centerline{\titlefont The {\ttitlefont CTANGLE} processor}
\vskip 15pt
\centerline{(Version 4.5)}
\centerline{(Version 4.6)}
\vfill}
\def\botofcontents{\vfill
\noindent
Expand Down Expand Up @@ -61,7 +61,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements.
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.

@d banner "This is CTANGLE (Version 4.5)"
@d banner "This is CTANGLE (Version 4.6)"

@c
@<Include files@>@/
Expand All @@ -75,7 +75,7 @@ is modified.
two phases: First it reads the source file, saving the \CEE/ code in
compressed form; then it shuffles and outputs the code.

Please read the documentation for \.{common}, the set of routines common
Please read the documentation for \.{COMMON}, the set of routines common
to \.{CTANGLE} and \.{CWEAVE}, before proceeding further.

@c
Expand Down Expand Up @@ -1493,8 +1493,8 @@ skip_limbo(void)
while (*loc!='@@') loc++;
if (loc++<=limit) {
char c=*loc++;
if (ccode[(eight_bits)c]==new_section) break;
switch (ccode[(eight_bits)c]) {
case new_section: return;
case translit_code: @<Read in transliteration of a character@>@; break;
case format_code: case '@@': break;
case control_text: if (c=='q' || c=='Q') {
Expand Down
4 changes: 2 additions & 2 deletions cweav-bs.ch
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ This file contributed by Barry Schwartz, [email protected], 28 Jun 94.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.

@d banner "This is CWEAVE (Version 4.5)"
@d banner "This is CWEAVE (Version 4.6)"
@y
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.

@d banner "This is CWEAVE (Version 4.5pc/big)"
@d banner "This is CWEAVE (Version 4.6pc/big)"
@z


Expand Down
4 changes: 2 additions & 2 deletions cweav-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ that allows >64K arrays. (If you need lots more bytes, try the alternate
change files that have -bs in their name instead of -pc.)
@x section 1
@d banner "This is CWEAVE (Version 4.5)"
@d banner "This is CWEAVE (Version 4.6)"
@y
@d banner "This is CWEAVE (Version 4.5pc)"
@d banner "This is CWEAVE (Version 4.6pc)"
@z
@x section 17
Expand Down
Loading

0 comments on commit a457dcc

Please sign in to comment.