logo       

RE: bugs in happy: msg#00027

lang.haskell.glasgow.bugs

Subject: RE: bugs in happy


> I tried to write a monadic lexer and parser just to find that:
>
> - omitting %name defaults to happyParse. However this name is used
> internally in a different function at a different location,
> leading to a
> "Multiply declarations of `Parser.happyParse'" error form
> GHC. It doesn't
> change if I give any of the -a -c -g flags.

True, thanks for pointing it out.

> - the documentation on the web is outdated (version 1.11)

The version number is incorrect, the docs are really for version 1.13.

> - the documentation for monadic parsers (Section 2.5) says
> that the type
> for happyError is [Token] -> P a which I naively believed.
> It's P a. Later
> in the example you deceptively suggest to define
>
> happyError tokens = failE "Parse error"
>
> but, as above, there are not tokens.

If you specify %lexer as well as %monad, then the type of happyError
becomes P a. I suspect this is what you're doing.

Cheers,
Simon


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise