Changeset 22988 for src

Show
Ignore:
Timestamp:
11/12/08 09:59:51 (8 weeks ago)
Author:
audreyt
Message:

* GHC 6.10 support, part 1 of 3: Adjust for Map.lookup's new signature.

Location:
src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/Paths_Pugs.hs

    r21746 r22988  
    88getDataFileName :: FilePath -> IO FilePath 
    99getDataFileName fn = do 
    10     dir <- Map.lookup "sourcedir" config 
     10    dir <- case Map.lookup "sourcedir" config of 
     11       Just rv -> return rv 
     12       _       -> fail "Cannot find 'sourcedir' in config!" 
    1113    rvf <- doesFileExist $ dir </> fn 
    1214    rvd <- doesDirectoryExist $ dir </> fn 
  • src/Pugs/CodeGen.hs

    r21848 r22988  
    8888            hPutStrLn stderr $ "*** The backend '" ++ s ++ "' is deprecated." 
    8989            hPutStrLn stderr $ "    Please use '" ++ key ++ "' instead." 
    90             Map.lookup key generators 
    91         key -> Map.lookup key generators 
     90            lookupGenerator key 
     91        key -> lookupGenerator key 
     92    where 
     93    lookupGenerator :: String -> IO Generator 
     94    lookupGenerator k = case Map.lookup k generators of 
     95        Just g -> return g 
     96        _      -> fail $ "Cannot find generator: " ++ k 
    9297 
    9398codeGen :: String -> FilePath -> Env -> IO String 
  • src/Pugs/Prim/Yaml.hs

    r15777 r22988  
    5454            spec'   <- io . newTVarIO $ Map.fromList (vals :: [(String, Val)]) 
    5555            spec    <- stm . readTVar $ spec' 
    56             rule    <- fromVal =<< Map.lookup "rule" spec 
    57             global  <- fromVal =<< Map.lookup "global" spec 
    58             stringify <- fromVal =<< Map.lookup "stringify" spec 
    59             adverbs <- Map.lookup "adverbs" spec 
     56            rule    <- case Map.lookup "rule" spec of 
     57                Just v -> fromVal v  
     58                _      -> fail "Cannot find the 'rule' spec" 
     59            global  <- case Map.lookup "global" spec of 
     60                Just v -> fromVal v  
     61                _      -> fail "Cannot find the 'global' spec" 
     62            stringify <- case Map.lookup "stringify" spec of 
     63                Just v -> fromVal v  
     64                _      -> fail "Cannot find the 'stringify' spec" 
     65            adverbs <- case Map.lookup "adverbs" spec of 
     66                Just v -> fromVal v  
     67                _      -> fail "Cannot find the 'adverbs' spec" 
    6068            return $ VRule MkRulePGE{rxRule=rule, rxGlobal=global, rxStringify=stringify, rxAdverbs=adverbs} 
    6169        Just x   -> error ("can't deserialize: " ++ unpackBuf x)