Underscores in qualified names in HsParser
Ross Paterson
ross at soi.city.ac.uk
Mon Jul 15 05:54:46 EDT 2002
Anders Lau Olsen <alauo at mip.sdu.dk> writes:
> HsParser is confused by the combination of qualified names and
> identifiers starting with underscores. For example:
>
> module M where
>
> _f _ _ = 0
>
> x = 0 `M._f` 0 -- parse error at '.'
>
> y = M._f 0 0 -- parses as M . (_f 0 0)
>
> I have tested this only for GHC 5.02. For what it's worth, I am pretty
> sure the later versions behave the same, and that the fix is to
> replace line 336 in Lexer.hs
>
> | isLower c -> do -- qualified varid?
>
> with
>
> | isLower c || c == '_' -> do -- qualified varid?
Thanks for the report and fix. I've applied this change in CVS.
More information about the Glasgow-haskell-bugs
mailing list