Show
Ignore:
Timestamp:
09/21/06 00:52:34 (2 years ago)
Author:
audreyt
Message:

* Pugs.Prim.Match: Allow selection of PGE instead of PCR by

setting an environment variable, PUGS_REGEX_ENGINE, to "pge"
or "PGE".

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Match.hs

    r13373 r13513  
    4747        return (name, text) 
    4848    text <- ruleWithAdverbs rule 
    49     pge  <- liftIO $ evalPCR pwd (encodeUTF8 cs) (encodeUTF8 text) subrules 
     49    rv   <- liftIO $ fmap (fmap (fmap toUpper)) (getEnv "PUGS_REGEX_ENGINE") 
     50    let ruleEngine | Just "PGE" <- rv   = evalPGE 
     51                   | otherwise          = evalPCR 
     52    pge  <- liftIO $ ruleEngine pwd (encodeUTF8 cs) (encodeUTF8 text) subrules 
    5053            `catchIO` (\e -> return $ show e) 
    5154    rv  <- tryIO Nothing $ fmap Just (readIO $ decodeUTF8 pge)