ghc misreports the error line

Simon Marlow simonmar at microsoft.com
Wed Oct 24 05:57:25 EDT 2001


> > module Test where
> 
> > chars = "
> > foo
> > bar"
> 
> > this line is in error and it is line 7
> 
> ghc test.lhs
> test.lhs:5: parse error on input `in'
> 
> It turns out that in the script I am writing
> (semi-automatic generation of a grammar file)
> being able to use the above notation for multilined
> strings is much clearer than its equivalent using
> (++) etc. I've noticed this notation doesn't work with
> hugs, so I might be violating the Haskell 98 spec.

You *are* violating the Haskell 98 spec, I'm afraid :)

This is a bug in GHC's parser, it shouldn't accept strings containing
newline characters.  We know about the bug, but thanks for reporting it
anyhow.

Cheers,
	Simon




More information about the Glasgow-haskell-bugs mailing list