Message6964

Author smokxx
Recipients fwierzbicki, smokxx
Date 2012-03-26.05:22:56
SpamBayes Score 2.25977e-07
Marked as misclassified No
Message-id <CAHGqr++6TVB_V+r+TJnDNtjLyYAofjuNwxLL==qGGwJkMhVK4A@mail.gmail.com>
In-reply-to <1332714391.84.0.288451837188.issue1866@psf.upfronthosting.co.za>
Content
Ah, I got it.

I did not run "jython" jar as is, I don't quite understand why current
jython outputs the error, because as I wrote in inital comment to the
issue, that error is not recorded (errors container is empty in
RecordingErrorHandler).

What if I just override BaseRecognizer's emitErrorMessage and make it do
nothing?

2012/3/26 Frank Wierzbicki <report@bugs.jython.org>

>
> Frank Wierzbicki <fwierzbicki@users.sourceforge.net> added the comment:
>
> 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 :)
>
> _______________________________________
> Jython tracker <report@bugs.jython.org>
> <http://bugs.jython.org/issue1866>
> _______________________________________
>
Files
File name Uploaded
unnamed smokxx, 2012-03-26.05:22:55
History
Date User Action Args
2012-03-26 05:22:56smokxxsetrecipients: + smokxx, fwierzbicki
2012-03-26 05:22:56smokxxlinkissue1866 messages
2012-03-26 05:22:56smokxxcreate