file: Tangle.changes
Modified by Lyle Ramshaw, October 27, 1983 9:23 pm
Pavel, September 14, 1985 3:56:50 pm PDT
002591: Change the banner line.
@x
@d banner=='This is TANGLE, Version 2.7'
@y
@d banner=='This is Tangle 2.7 for Cedar 6.0'
@z
003074: Define read←ln and write←ln as macros, expanding to themselves without the underscores, so that later hackery about leaving in underscores works.
@x
@d end←of←TANGLE = 9999 {go here to wrap it up}
@y
@d end←of←TANGLE = 9999 {go here to wrap it up}
@d read←ln == readln
@d write←ln == writeln
@z
003339: 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
007644: Up the buf←size to something reasonable.
@x
@!buf←size=100; {maximum length of input line}
@y
@!buf←size=5000; {maximum length of input line}
@z
008411: Reset max←id←length to a large value, to avoid truncation of identifiers. Also, up the unambig←length because leaving in the underscores makes things more ambiguous.
@x
@!max←id←length=12; {long identifiers are chopped to this length, which must
not exceed |line←length|}
@!unambig←length=7; {identifiers must be unique if chopped to this length}
{note that 7 is more strict than \PASCAL's 8, but this can be varied}
@y
@!max←id←length=72; {long identifiers are chopped to this length, which must
not exceed |line←length|}
@!unambig←length=12; {identifiers must be unique if chopped to this length}
{note that 7 is more strict than \PASCAL's 8, but this can be varied}
@z
013556: 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
019237: Assume 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
020884: Change multi-arg call to rewrite into an appropriate Cedar procedure.
@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
021837: 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 still more file open calls to Cedar.
@x
rewrite(Pascal𡤏ile); rewrite(pool);
@y
file←rewrite(Pascal𡤏ile, 'pas '); file←rewrite(pool, 'pool ');
@z
026004: Report Phase I 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
026693: Report Phase II error locations using character counts as well.
@x
begin print←ln('. (l.',line:1,')');
@y
begin print←ln('. (pos:',file←get←pos(Pascal𡤏ile)+out←ptr:1,')');
@z
042434: Hackery! I would prefer that the "←" characters be left in the identifier names. Stripping them out just makes the Mesa source look ugly.
@x
while (i<id←loc)and(s<unambig←length) do
begin if buffer[i]<>"←" then
@y
while (i<id←loc)and(s<unambig←length) do
begin
@z
044962: More hackery! Once again, please just ignore "←" in identifier names.
@x
begin c:=byte←mem[w,k];
if c<>"←" then
begin if c>="a" then c:=c-@'40; {convert to uppercase}
@y
begin c:=byte←mem[w,k];
begin if c>="a" then c:=c-@'40; {convert to uppercase}
@z
086335: Still more hackery! Once again, please just ignore "←" in identifier names.
@x
if out𡤌ontrib[k]>="a" then out𡤌ontrib[k]:=out𡤌ontrib[k]-@'40
else if out𡤌ontrib[k]="←" then decr(k);
@y
if out𡤌ontrib[k]>="a" then out𡤌ontrib[k]:=out𡤌ontrib[k]-@'40;
@z
126031: 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(Pascal𡤏ile); file𡤌lose(pool);
@z
126105: Add a final carriage return after the job history
@x
@<Print the job |history|@>;
@y
@<Print the job |history|@>;
new←line;
@z
127715: Add Cedar forward declarations.
@x
@* System-dependent changes.
This module should be replaced, if necessary, by changes to the program
that are necessary to make \.{TANGLE} 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←reset(var f: text𡤏ile); external; {set up for input from terminal}
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