File: Weave.changes
Last Changed by Pavel on September 15, 1985 4:10:19 pm PDT
003033: Change the banner line.
@x
@d banner=='This is WEAVE, Version 2.7'
@y
@d banner=='This is Weave 2.7 for Cedar 6.0'
@z
003464: Define read←ln and write←ln as macros, expanding to themselves without the underscores so that PasMesa doesn't throw up on them.
@x
@d end←of←WEAVE = 9999 {go here to wrap it up}
@y
@d end←of←WEAVE = 9999 {go here to wrap it up}
@d read←ln == readln
@d write←ln == writeln
@z
003716: Allow for external procedure and function declarations for things implemented directly in Cedar, rather than in Pascal.
@x
var @<Globals in the outer block@>@/
@<Error handling procedures@>@/
@y
var @<Globals in the outer block@>@/
@<External procedure declarations for things implemented directly in Cedar@>@/
@<Error handling procedures@>@/
@z
008116: Up the buf←size to something reasonable.
@x
@!buf←size=100; {maximum length of input line}
@!longest←name=400; {module names shouldn't be longer than this}
@!long𡤋uf←size=500; {|buf←size+longest←name|}
@y
@!buf←size=5000; {maximum length of input line}
@!longest←name=400; {module names shouldn't be longer than this}
@!long𡤋uf←size=5400; {|buf←size+longest←name|}
@z
008378: TeX needs more cross-references.
@x
@!max←refs=20000; {number of cross references; must be less than 65536}
@y
@!max←refs=25000; {number of cross references; must be less than 65536}
@z
013661: Allow for eight-bit characters in the input files.
@x
@d last←text𡤌har=127 {ordinal number of the largest element of |text𡤌har|}
@y
@d last←text𡤌har=255 {ordinal number of the largest element of |text𡤌har|}
@z
019341: Pretend that we have the MIT character set.
@x
for i:=1 to @'37 do xchr[i]:=' ';
@y
for i:=1 to @'37 do xchr[i]:=chr(i);
@z
020988: Hook up tty open call to Cedar.
@x
rewrite(term←out,'TTY:'); {send |term←out| output to the terminal}
@y
tty←rewrite(term←out); {send |term←out| output to the terminal}
@z
022012: Hook up file open calls to Cedar.
@x
begin reset(web𡤏ile); reset(change𡤏ile);
@y
begin file←reset(web𡤏ile, 'web '); file←reset(change𡤏ile, 'changes ');
@z
022302: Hook up more file open calls to Cedar.
@x
rewrite(tex𡤏ile);
@y
file←rewrite(tex𡤏ile, 'tex ');
@z
026191: Report error locations using character counts instead of line numbers.
@x
begin if changing then print('. (change file ')@+else print('. (');
print←ln('l.', line:1, ')');
if loc>=limit then l:=limit else l:=loc;
@y
begin if loc>=limit then l:=limit else l:=loc;
if changing then
print←ln('. (change file pos:', file←get←pos(change𡤏ile)-(limit-l)-2:1, ')')
else print←ln('. (pos:', file←get←pos(web𡤏ile)-(limit-l)-2:1, ')');
@z
035848: Change declaration of xmem from array of explicit record type into array of named record type, so that the Cedar compiler won't find a type mismatch.
@x
@ @<Globals...@>=
@!xmem:array[xref←number] of packed record@t@>@/
@!num𡤏ield: sixteen𡤋its; {module number plus zero or |def𡤏lag|}
@!xlink𡤏ield: sixteen𡤋its; {pointer to the previous cross reference}
end;
@y
@ @<Types...@>=
@!xmem←record=packed record@t@>@/
@!num𡤏ield: sixteen𡤋its; {module number plus zero or |def𡤏lag|}
@!xlink𡤏ield: sixteen𡤋its; {pointer to the previous cross reference}
end;
@ @<Globals...@>=
@!xmem:array[xref←number] of xmem←record;
@z
084826: Remove declaration of the unreferenced variable, c
@x
@!c,@!d:ASCII𡤌ode; {characters from the buffer}
@y
@!d:ASCII𡤌ode; {character from the buffer}
@z
131827: Remove declaration of the unreferenced variable, k
@x
@!j:0..max←scraps; {runs through final scraps}
@!k:0..long𡤋uf←size; {index into |buffer|}
@y
@!j:0..max←scraps; {runs through final scraps}
@z
167121: Compute a sixteen𡤋its intermediate result so that the Cedar compiler won't get a signed/unsigned ambiguity. This piece of code is in the procedure Phase←II, which is conveniently already in a change, below. We declare the new variable as a local variable in that procedure.
@x
if num(cur←xref)<>module𡤌ount+def𡤏lag then
@y
mod𡤌ount←plus�𡤏lag := module𡤌ount+def𡤏lag;
if num(cur←xref)<>mod𡤌ount←plus�𡤏lag then
@z
181950: Encapsulate Phase III in a procedure so we can make the main program smaller. As is, it doesn't fit in a single Mesa module (sigh). ALSO, declare the new variable for change 167121.
@x
procedure Phase←II;
begin @<Phase II:...@>;
end;
@y
procedure Phase←II;
var mod𡤌ount←plus�𡤏lag: sixteen𡤋its;
begin @<Phase II:...@>;
end;
@#
procedure Phase←III;
begin @<Phase III:...@>;
end;
@z
182130: The rest of the job of encapsulating Phase III.
@x
Phase←I; Phase←II;@/
@<Phase III:...@>;
@y
Phase←I; Phase←II; Phase←III;@/
@z
182283: Close files.
@x
@t\4\4@>{here files should be closed if the operating system requires it}
@y
file𡤌lose(web𡤏ile); file𡤌lose(change𡤏ile);
file𡤌lose(tex𡤏ile);
@z
182357: Add a final carriage return after the job history
@x
@<Print the job |history|@>;
@y
@<Print the job |history|@>;
new←line;
@z
183401: Add Cedar forward declarations. These are here, rather than in the .mod file, because their types refer to a macro, namely `text𡤏ile'.
@x
@* System-dependent changes.
This module should be replaced, if necessary, by changes to the program
that are necessary to make \.{WEAVE} work at a particular installation.
It is usually best to design your change file so that all changes to
previous modules preserve the module numbering; then everybody's version
will be consistent with the printed program. More extensive changes,
which introduce new modules, can be inserted here; then only the index
itself will get a new module number.
@^system dependencies@>
@y
@* System-dependent changes.
Here at PARC, any Pascal output by Tangle must be transliterated into Cedar
by McCreight's PasMesa compiler before it can be executed. Rather than
incorporate the funny features of Pascal-H into PasMesa, we instead here
declare some procedures |external| that we never intend to implement in
Pascal at all. Instead, these procedures are written by hand in Cedar, and
are linked in with the translated Pascal program by the Cedar binding process.
@^changed modules@>
@^system dependencies@>


@<External procedure declarations for things implemented directly in Cedar@>=
procedure tty←rewrite(var f: text𡤏ile); external; {set up for output to terminal}
procedure file←reset(var f: text𡤏ile; ext: alfa); external; {set up for input from file}
procedure file←rewrite(var f: text𡤏ile; ext: alfa); external; {set up for output to file}
procedure file𡤌lose(var f: text𡤏ile); external; {close a file}
function file←get←pos(var f: text𡤏ile):integer; external; {return character count}
@z