Ticket #187 (closed bug report: fixed)

Opened 5 years ago

Last modified 5 years ago

Pattern fixities not resolved

Reported by: NeilMitchell2 Owned by: nibro
Priority: major Milestone: Full document support
Component: parser Version: 1.3.0
Keywords: Cc:

Description

HSE doesn't resolve pattern fixities.

Prelude Language.Haskell.Exts> parseFileContents "a = case b of x:y:z -> c" Loading package haskell-src-exts-1.3.2 ... linking ... done. ParseOk? (Module (SrcLoc? {srcFilename = "<unknown>.hs", srcLine = 1, srcColumn = 1}) (ModuleName? "Main") [] Nothing (Just [EVar (UnQual? (Ident "main"))]) [] [Pat Bind (SrcLoc? {srcFilename = "<unknown>.hs", srcLine = 1, srcColumn = 1}) (PVar ( Ident "a")) Nothing (UnGuardedRhs? (Case (Var (UnQual? (Ident "b"))) [Alt (SrcLoc? {srcFilename = "<unknown>.hs", srcLine = 1, srcColumn = 15}) (PInfixApp (PInfixA pp (PVar (Ident "x")) (Special Cons) (PVar (Ident "y"))) (Special Cons) (PVar (I dent "z"))) (UnGuardedAlt? (Var (UnQual? (Ident "c")))) (BDecls [])])) (BDecls []) ])

The relevant bit is:

(PInfixApp (PInfixApp "x" (Special Cons) "y") (Special Cons) "z")

Note that it should be the x:(y:z), but HSE has given (x:y):z.

Change History

Changed 5 years ago by nibro

  • status changed from new to closed
  • resolution set to fixed

A lot of copy-paste from how it's done for expressions, took me all of 10 minutes. Works in 1.3.4, case closed.

Note: See TracTickets for help on using tickets.