home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
intercal.zip
/
BUGS
next >
Wrap
Text File
|
1996-06-22
|
4KB
|
78 lines
BUGS
There are still some known bugs in INTERCAL (and no doubt many we don't even
suspect as yet). The following list accumulates current bug reports and
TO DO agenda items through the current release.
ESR = Eric S. Raymond
SS = Steve Swales
LLH = Louis Howell
BR = Brian Raiter
1) (ESR) INTERCAL would be intrinsically a crock even if it worked right.
2) (SS) The system library syslib.i does not appear to work 100% as advertised.
(ESR) Louis has corrected several bugs. The gods alone know what others
are lurking in there...
3) (LLH) The lexical analyzer is not completely independent of newlines.
There is a conflict between the fact that newlines should be
ignored almost everywhere, and the facts that the error mechanism
wants to know about line numbers and the splat mechanism wants
statements from the original program.
The way these issues are currently resolved by the compiler is
a bit over-complicated, but seems to work properly in almost
every respect. I see only two problems: First, splat operation
prints only the text line on which a typo was detected, not the
whole statement. Second, for debugging purposes the text lines
are printed as comments in the degenerated C code. These
comments are only properly aligned with the degenerated code
if the program has exactly one statement per line. (See
pit/tests/testsplat.i for examples.)
Neither of these problems is a big deal, which is why I haven't
worried about them too much. The best solution I can see is
to make "phase 1" of the lexer into a preprocessor able to
correctly separate statements. It could then either add or
remove newlines to put the program into one statement per line
format, or put markers between statements for the main lexer
to detect. Either way, it would be a good bit of work for a
relatively small gain, and anyone trying it should make sure
the result isn't buggier than the current version.
4) (BR) I have hacked up a fix to the problem with line numbers being off
due to statements sharing/spanning lines. The parser now stores the
starting line number for all tuples, not just the splatted
ones. Not only does this give synchronized lines in the comments in
the degenerated C code, but run-time error messages are just as
reliable as the parse/compile-time ones. The line number in the
error message is actually the line number of the next statement
(e.g., if the next statement is on the same line, the line number
of both statements will be used).
Note that I said "just as reliable," as opposed to "fully
reliable". Since the lexer doesn't know where the line ends until
after it's already parsed the preamble (DO-PLEASE combo, line
label, oh-oh-seven number, etc) of the following line, it actually
stores as the starting line number the first non-whitespace of the
statement proper. So if a statement has its preamble on one line
and the rest of it on the next, the preamble will be beheaded.
Still, it's a vast improvement, and as LLH points out, it's not
going to get much better without writing a preprocessing lexer that
can actually separate out the statements before any real parsing
begins. Until someone wants to do that, this will do nicely, I think.
As a side bonus, splatting now shows the entire statement. (Er,
except when the statement both spans and shares a line. If a multi-
line statement ends on the same line as the beginning of the next
statement, the last part will get truncated. Again, not a case we
want to be encouraging people to explore anyway.)
TO DO
1. (ESR) Add more optimization templates, esp. idioms for +, -, *, /.
2. (ESR) Forget this @!%$#! crock and take a long vacation.