Re: Suboptimal error message
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> May 19, 2005
- 400 views
On Wed, 18 May 2005 23:27:01 +0200, Juergen Luethje <j.lue at gmx.de> wrote: >Robert Craig wrote: >>> Syntax error - expected to see possibly this ..., not a variable > >Uuhhh, I didn't know that. <scratching my head like Stan Laurel> >Wouldn't it be better not to allow things like that? Or would that >require heavy changes of the interpreter? FYI, the 2.4 error was Syntax error - expected to see possibly '=', not a variable Of course all the code involved here is now public domain (eu.ex and/or parser.e and/or and emit.e), albeit packaged specially. An interesting thing to attempt would be to backtrack at the error point (add zero overhead in the non-error case, please), possibly looking through the most recently added var names for something rather suspicious (probably including user-defined types). I'm sure Rob would thank you if you came up with something clever in that area. You might even get close to perfection here: point at the comma and say "that comma should probably not be there"? (But I doubt it Regards, Pete