Message6963

Author fwierzbicki
Recipients fwierzbicki, smokxx
Date 2012-03-25.22:26:31
SpamBayes Score 2.008095e-06
Marked as misclassified No
Message-id <1332714391.84.0.288451837188.issue1866@psf.upfronthosting.co.za>
In-reply-to
Content
So starting with a file with an error:

def a foo():
<end of file>

CPython gives:

  File "error.py", line 1
    def a foo():
            ^
SyntaxError: invalid syntax

Current Jython gives:


  File "error.py", line 1
    def a foo():
         ^
SyntaxError: mismatched input 'foo' expecting LPAREN

And Jython with your patch gives:

line 1:6 mismatched input 'foo' expecting LPAREN
  File "error.py", line 1
    def a foo():
         ^
SyntaxError: mismatched input 'foo' expecting LPAREN

The trouble with your patch is that it causes two error messages in the output - the first from ANTLR at the top

line 1:6 mismatched input 'foo' expecting LPAREN

and the python style at the bottom:

  File "error.py", line 1
    def a foo():
         ^
SyntaxError: mismatched input 'foo' expecting LPAREN

The bottom Python style is what we want, and so the top ANTLR error message is extraneous -- if you could rework the patch to avoid the extra output (basically you'd need to override ANTLR's reportError message and leave out the call to displayRecognitionError call then this  would be an acceptable patch. Thanks for working on this! I'd love to get others working in the parser -- it clearly needs more eyes :)
History
Date User Action Args
2012-03-25 22:26:31fwierzbickisetmessageid: <1332714391.84.0.288451837188.issue1866@psf.upfronthosting.co.za>
2012-03-25 22:26:31fwierzbickisetrecipients: + fwierzbicki, smokxx
2012-03-25 22:26:31fwierzbickilinkissue1866 messages
2012-03-25 22:26:31fwierzbickicreate