home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / intercal.zip / BUGS next >
Text File  |  1996-06-22  |  4KB  |  78 lines

  1.             BUGS
  2.  
  3. There are still some known bugs in INTERCAL (and no doubt many we don't even
  4. suspect as yet).  The following list accumulates current bug reports and
  5. TO DO agenda items through the current release.
  6.  
  7. ESR = Eric S. Raymond
  8. SS  = Steve Swales
  9. LLH = Louis Howell
  10. BR = Brian Raiter
  11.  
  12. 1) (ESR) INTERCAL would be intrinsically a crock even if it worked right.
  13.  
  14. 2) (SS) The system library syslib.i does not appear to work 100% as advertised.
  15.    (ESR) Louis has corrected several bugs.  The gods alone know what others
  16.    are lurking in there... 
  17.  
  18. 3) (LLH) The lexical analyzer is not completely independent of newlines.
  19.    There is a conflict between the fact that newlines should be
  20.    ignored almost everywhere, and the facts that the error mechanism
  21.    wants to know about line numbers and the splat mechanism wants
  22.    statements from the original program.
  23.  
  24.    The way these issues are currently resolved by the compiler is
  25.    a bit over-complicated, but seems to work properly in almost
  26.    every respect.  I see only two problems:  First, splat operation
  27.    prints only the text line on which a typo was detected, not the
  28.    whole statement.  Second, for debugging purposes the text lines
  29.    are printed as comments in the degenerated C code.  These
  30.    comments are only properly aligned with the degenerated code
  31.    if the program has exactly one statement per line.  (See
  32.    pit/tests/testsplat.i for examples.)
  33.  
  34.    Neither of these problems is a big deal, which is why I haven't
  35.    worried about them too much.  The best solution I can see is
  36.    to make "phase 1" of the lexer into a preprocessor able to
  37.    correctly separate statements.  It could then either add or
  38.    remove newlines to put the program into one statement per line
  39.    format, or put markers between statements for the main lexer
  40.    to detect.  Either way, it would be a good bit of work for a
  41.    relatively small gain, and anyone trying it should make sure
  42.    the result isn't buggier than the current version.
  43.  
  44. 4) (BR) I have hacked up a fix to the problem with line numbers being off
  45.    due to statements sharing/spanning lines. The parser now stores the
  46.    starting line number for all tuples, not just the splatted
  47.    ones. Not only does this give synchronized lines in the comments in
  48.    the degenerated C code, but run-time error messages are just as
  49.    reliable as the parse/compile-time ones. The line number in the
  50.    error message is actually the line number of the next statement
  51.    (e.g., if the next statement is on the same line, the line number
  52.    of both statements will be used).
  53.  
  54.    Note that I said "just as reliable," as opposed to "fully
  55.    reliable". Since the lexer doesn't know where the line ends until
  56.    after it's already parsed the preamble (DO-PLEASE combo, line
  57.    label, oh-oh-seven number, etc) of the following line, it actually
  58.    stores as the starting line number the first non-whitespace of the
  59.    statement proper. So if a statement has its preamble on one line
  60.    and the rest of it on the next, the preamble will be beheaded.
  61.  
  62.    Still, it's a vast improvement, and as LLH points out, it's not
  63.    going to get much better without writing a preprocessing lexer that
  64.    can actually separate out the statements before any real parsing
  65.    begins. Until someone wants to do that, this will do nicely, I think.
  66.  
  67.    As a side bonus, splatting now shows the entire statement. (Er,
  68.    except when the statement both spans and shares a line. If a multi-
  69.    line statement ends on the same line as the beginning of the next
  70.    statement, the last part will get truncated. Again, not a case we
  71.    want to be encouraging people to explore anyway.)
  72.  
  73.             TO DO
  74.  
  75. 1. (ESR) Add more optimization templates, esp. idioms for +, -, *, /.
  76.  
  77. 2. (ESR) Forget this @!%$#! crock and take a long vacation.
  78.