
I'm using haskell-src to build a haskell compiler. I've compiled hscolour and haskell-src to java classes and used the result to colorize and report parsing errors in an eclipse editor. I use 1.0.1.3 and it reports unterminated comments on the token before the {- token so it is mildy informative and possibly an error in the implementation. haskell-src serves me well but i would like some better error reporting as "parse error" is quite non informative. I would like to avoid building my own parser and so would like to know what the options are for parsing haskell sources with an improved error reporting. I've no idea how i should share screenshots so i've uploaded to the first site i've found: http://imageshack.us/photo/my-images/853/scr1g.png/ http://imageshack.us/photo/my-images/706/scr2a.png/

As I understand it, haskell-src-exts is to be preferred to haskell-src since it is more actively maintained and parses more programs (including some GHC extensions). You may want to try switching to haskel-src-exts and see if that solves your problem. -Brent On Sun, Oct 16, 2011 at 06:27:47PM +0200, jean verdier wrote:
I'm using haskell-src to build a haskell compiler. I've compiled hscolour and haskell-src to java classes and used the result to colorize and report parsing errors in an eclipse editor. I use 1.0.1.3 and it reports unterminated comments on the token before the {- token so it is mildy informative and possibly an error in the implementation. haskell-src serves me well but i would like some better error reporting as "parse error" is quite non informative. I would like to avoid building my own parser and so would like to know what the options are for parsing haskell sources with an improved error reporting.
I've no idea how i should share screenshots so i've uploaded to the first site i've found: http://imageshack.us/photo/my-images/853/scr1g.png/ http://imageshack.us/photo/my-images/706/scr2a.png/
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Thanks for your reply. Haskell-src parses enough haskell for my needs so extended haskell parsing is not the problem atm. I am looking for parser that outputs better errors. I have run some quick parsing tests using haskell-src-exts using ghc and the error reporting is not better for me as it outputs the same wrong offset for unterminated comments and the parse errors are not much more informative:"Parse error: ;" but there are no semi in the original text, and some looks like overkill in simple haskell sources:"TemplateHaskell is not enabled" that is output for some unterminated root decl. I will keep haskell src for the time being, hoping that there is some already written parser that i can use but in the worst case i will write one myself. On Sun, 2011-10-16 at 12:50 -0400, Brent Yorgey wrote:
As I understand it, haskell-src-exts is to be preferred to haskell-src since it is more actively maintained and parses more programs (including some GHC extensions). You may want to try switching to haskel-src-exts and see if that solves your problem.
-Brent
On Sun, Oct 16, 2011 at 06:27:47PM +0200, jean verdier wrote:
I'm using haskell-src to build a haskell compiler. I've compiled hscolour and haskell-src to java classes and used the result to colorize and report parsing errors in an eclipse editor. I use 1.0.1.3 and it reports unterminated comments on the token before the {- token so it is mildy informative and possibly an error in the implementation. haskell-src serves me well but i would like some better error reporting as "parse error" is quite non informative. I would like to avoid building my own parser and so would like to know what the options are for parsing haskell sources with an improved error reporting.
I've no idea how i should share screenshots so i've uploaded to the first site i've found: http://imageshack.us/photo/my-images/853/scr1g.png/ http://imageshack.us/photo/my-images/706/scr2a.png/
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Mon, Oct 17, 2011 at 03:18, jean verdier
Haskell-src parses enough haskell for my needs so extended haskell parsing is not the problem atm. I am looking for parser that outputs better errors. I have run some quick parsing tests using
haskell-src-exts is where pretty much all work on parsers for Haskell is concentrated; if it's not handling something correctly, you should report that as a bug. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

I trust the parsers (haskell-src and haskell-src-exts) as i suppose that they output a correct ast from valid haskell sources and produce an error otherwise. The error reported have locations that are more or less correct (off by one token in some cases) and messages that i would not expect. Still i would not qualify those problems as bugs as those parsers are more like (Source -> Maybe AST) so the error info is not that important. Thus it's not handling things incorrectly IMHO. On Mon, 2011-10-17 at 03:53 -0400, Brandon Allbery wrote:
On Mon, Oct 17, 2011 at 03:18, jean verdier
wrote: Haskell-src parses enough haskell for my needs so extended haskell parsing is not the problem atm. I am looking for parser that outputs better errors. I have run some quick parsing tests using haskell-src-exts is where pretty much all work on parsers for Haskell is concentrated; if it's not handling something correctly, you should report that as a bug.
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (3)
-
Brandon Allbery
-
Brent Yorgey
-
jean verdier