Ticket #1215 (closed bug: fixed)
GHC fails to respect the maximal munch rule while lexing "qualified reservedids"
| Reported by: | Stefan O'Rear <stefanor@…> | Owned by: | simonmar |
|---|---|---|---|
| Priority: | low | Milestone: | 6.8.1 |
| Component: | Compiler (Parser) | Version: | 6.6 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Easy (less than 1 hour) | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The following program I believe is legal haskell 98:
module Main where t = 2 defaul _ = return () main = Main.default
since Main.default is an illegal lexeme, but Main.defaul is a perfectly good qvarid. however ghci rejects it:
Bar.hs:5:12: parse error on input `default'
Something very similar to this is documented, but only in the qvarsym case. This appears fairly easy to fix using extra rules in the lexer; a flex lexer that does what I consider correct can be found at http://members.cox.net/stefanor/h98lexer.l.
Change History
Note: See
TracTickets for help on using
tickets.
