X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fext-core%2FParsecParser.hs;h=41a18a5c3084aedeebf89b832c2114bda9e2d43f;hp=9acb13862ec0a394fe68b5151f0f6405992e7a50;hb=8bfeb25ae78e99c7014113468b0057342db4208f;hpb=c287bea94592fffe63f85831ab651c28d64e4d6e diff --git a/utils/ext-core/ParsecParser.hs b/utils/ext-core/ParsecParser.hs index 9acb138..41a18a5 100644 --- a/utils/ext-core/ParsecParser.hs +++ b/utils/ext-core/ParsecParser.hs @@ -141,12 +141,10 @@ coreCdef = do tys <- sepBy coreAtySaturated whiteSpace return $ Constr dataConName tBinds tys -coreTRep :: Parser (Maybe Ty) +coreTRep :: Parser Ty -- note that the "=" is inside here since if there's -- no rhs for the newtype, there's no "=" -coreTRep = optionMaybe (do - symbol "=" - try coreType) +coreTRep = symbol "=" >> try coreType coreType :: Parser Ty coreType = coreForallTy <|> (do @@ -222,13 +220,12 @@ coreTcon = data CoercionTy = TransC | InstC | SymC | UnsafeC | LeftC | RightC symCo, transCo, unsafeCo, instCo, leftCo, rightCo :: Parser CoercionTy --- Would be better not to wire these in quite this way. Sigh -symCo = string "ghczmprim:GHCziPrim.sym" >> return SymC -transCo = string "ghczmprim:GHCziPrim.trans" >> return TransC -unsafeCo = string "ghczmprim:GHCziPrim.CoUnsafe" >> return UnsafeC -leftCo = string "ghczmprim:GHCziPrim.left" >> return LeftC -rightCo = string "ghczmprim:GHCziPrim.right" >> return RightC -instCo = string "ghczmprim:GHCziPrim.inst" >> return InstC +symCo = string "%sym" >> return SymC +transCo = string "%trans" >> return TransC +unsafeCo = string "%unsafe" >> return UnsafeC +leftCo = string "%left" >> return LeftC +rightCo = string "%right" >> return RightC +instCo = string "%inst" >> return InstC coreForallTy :: Parser Ty coreForallTy = do