[MLton] bug in mllex?

Stephen Weeks MLton@mlton.org
Thu, 14 Apr 2005 08:15:16 -0700

> I believe mllex is generating values for the internal yypos value
> that are off by one.  (The generated code initialises a variable
> yygone0 to be equal to 1, and I think this should probably be zero.)

On the bottom of page 8 of the mllex documentation:

  Bug.  The position of the first character in the file is reported as
  2 (unless the %posarg feature is used).  To preserve compatibility,
  this bug has not been fixed.

I think this is lame.  I have no problem with changing the code and
docs (zero also seems right to me) if there are no objections.

I'd never noticed since I always report column numbers in error
messages, and those are relative to the position at the beginning of
the line, so it doesn't matter what position the file starts at (as
long as it's not too close to maxInt :-).