Changeset 21677

Show
Ignore:
Timestamp:
08/01/08 14:20:21 (4 months ago)
Author:
audreyt
Message:

* Reflect data-dir changes.

Location:
src/Pugs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Embed/Perl5.hs

    r21673 r21677  
    1515import qualified Data.ByteString.UTF8 as Str 
    1616 
    17 evalPCR :: FilePath -> String -> String -> [(String, String)] -> IO String 
    18 evalPCR path match rule subrules = do 
    19     (inp, out, err, pid) <- initPCR path 
     17evalPCR :: [FilePath] -> String -> String -> [(String, String)] -> IO String 
     18evalPCR [path] match rule subrules = do 
     19    (inp, out, err, pid) <- initPCR $ head path 
    2020    (`mapM` subrules) $ \(name, rule) -> do 
    2121        let nameStr = escape name 
     
    357357nullEnv = unsafePerformIO (newStablePtr (error "undefined environment")) 
    358358 
    359 evalPCR :: FilePath -> String -> String -> [(String, String)] -> IO String 
    360 evalPCR path match rule subrules = do 
     359evalPCR :: [FilePath] -> String -> String -> [(String, String)] -> IO String 
     360evalPCR paths match rule subrules = do 
    361361    let bridgeMod   = "Pugs::Runtime::Match::HsBridge" 
    362362        bridgeFile  = "Pugs/Runtime/Match/HsBridge.pm"; 
    363     inv     <- evalPerl5 (unlines 
     363        incs        = map (\p -> "    unshift @INC, '"++p++"';") paths 
     364    inv     <- evalPerl5 (unlines $ 
    364365        [ "if (!$INC{'"++bridgeFile++"'}) {" 
    365         , "    unshift @INC, '"++path++"';" 
    366         , "    eval q[require '"++bridgeFile++"'] or die $@;" 
     366        ] ++ incs ++ 
     367        [ "    eval q[require '"++bridgeFile++"'] or die $@;" 
    367368        , "}" 
    368369        , "'"++bridgeMod++"'" 
  • src/Pugs/Prim/Match.hs

    r21673 r21677  
    3333doMatch :: String -> VRule -> Eval VMatch 
    3434doMatch cs rule@MkRulePGE{ rxRule = ruleStr } = do 
    35     pwd     <- io $ getDataFileName "blib6/pugs/perl5/lib" 
     35    pwd1    <- io $ getDataFileName "perl5/Pugs-Compiler-Rule/lib" 
     36    pwd2    <- io $ getDataFileName "third-party/Parse-Yapp/lib" 
    3637    glob    <- askGlobal 
    3738    let syms = [ (cast $ v_name var, entry) 
     
    4950    let ruleEngine | Just "PGE" <- rv   = evalPGE 
    5051                   | otherwise          = evalPCR 
    51     pge  <- io $ ruleEngine pwd cs text subrules 
     52    pge  <- io $ ruleEngine [pwd1, pwd2] cs text subrules 
    5253            `catchIO` (\e -> return $ show e) 
    5354    rv  <- tryIO Nothing $ fmap Just (readIO $ decodeUTF8 pge)