{
-{-# OPTIONS -fno-warn-unused-binds -fno-warn-unused-matches -fno-warn-missing-signatures #-}
+{-# OPTIONS -fno-warn-unused-binds -fno-warn-unused-matches -fno-warn-missing-signatures -fno-warn-incomplete-patterns #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
#include "HsVersions.h"
+import Distribution.Package hiding ( depends )
import PackageConfig
import Lexer
import Module
import ErrUtils ( mkLocMessage )
import SrcLoc
import Outputable
-import Panic ( GhcException(..) )
-import Control.Exception ( throwDyn )
+import Panic
}
}
pkgid :: { PackageIdentifier }
- : CONID '{' VARID '=' STRING ',' VARID '=' version '}'
- { PackageIdentifier{ pkgName = unpackFS $5,
- pkgVersion = $9 } }
+ : CONID '{' VARID '=' CONID STRING ',' VARID '=' version '}'
+ {% case unpackFS $5 of
+ "PackageName" ->
+ return $ PackageIdentifier {
+ pkgName = PackageName (unpackFS $6),
+ pkgVersion = $10
+ }
+ _ -> happyError
+ }
version :: { Version }
: CONID '{' VARID '=' intlist ',' VARID '=' strlist '}'
let loc = mkSrcLoc (mkFastString conf_filename) 1 0
case unP parse (mkPState buf loc dflags) of
PFailed span err ->
- throwDyn (InstallationError (showSDoc (mkLocMessage span err)))
+ ghcError (InstallationError (showSDoc (mkLocMessage span err)))
POk _ pkg_details -> do
return pkg_details