Make another parse error more informative
authorIan Lynagh <igloo@earth.li>
Sun, 8 Aug 2010 19:33:40 +0000 (19:33 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 8 Aug 2010 19:33:40 +0000 (19:33 +0000)
compiler/parser/RdrHsSyn.lhs

index 4c1da58..90220d3 100644 (file)
@@ -362,7 +362,7 @@ splitCon ty
    split (L _ (HsAppTy t u)) ts = split t (u : ts)
    split (L l (HsTyVar tc))  ts = do data_con <- tyConToDataCon l tc
                                     return (data_con, mk_rest ts)
    split (L _ (HsAppTy t u)) ts = split t (u : ts)
    split (L l (HsTyVar tc))  ts = do data_con <- tyConToDataCon l tc
                                     return (data_con, mk_rest ts)
-   split (L l _) _             = parseError l "parse error in data/newtype declaration"
+   split (L l _) _             = parseErrorSDoc l (text "parse error in constructor in data/newtype declaration:" <+> ppr ty)
 
    mk_rest [L _ (HsRecTy flds)] = RecCon flds
    mk_rest ts                   = PrefixCon ts
 
    mk_rest [L _ (HsRecTy flds)] = RecCon flds
    mk_rest ts                   = PrefixCon ts