Show
Ignore:
Timestamp:
08/01/08 13:56:05 (4 months ago)
Author:
audreyt
Message:

* Import Pugs 6.2.13.11 from Hackage into our source tree.
* Highlights:

  • Much faster startup time
  • Slightly faster compilation time (mostly due to refactored Pugs.AST.Internals)
  • Portable-to-Win32 readline thanks to Haskeline
Files:
1 modified

Legend:

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

    r16627 r21673  
    1818import Pugs.Prim.Keyed 
    1919import Pugs.Types 
     20import Pugs.Prelude 
    2021import DrIFT.YAML 
    2122import Data.Yaml.Syck 
     23import Data.Binary (decode) 
    2224import qualified Data.ByteString.Char8 as Bytes 
    2325 
     
    5052    let file | '.' `elem` mod = mod 
    5153             | otherwise      = (concat $ intersperse (getConfig "file_sep") $ split "::" mod) ++ ".pm" 
    52     pathName    <- requireInc incs file (errMsg file incs) 
     54    pathName    <- case mod of 
     55        "Test"  -> return "Test.pm" 
     56        _       -> requireInc incs file (errMsg file incs) 
    5357    if loaded then opEval style pathName "" else do 
    5458        -- %*INC{mod} = { relname => file, pathname => pathName } 
     
    6569        ends    <- fromVal =<< readRef endAV 
    6670        clearRef endAV 
    67         rv <- tryFastEval pathName (pathName ++ ".yml") 
     71        rv <- case mod of 
     72            "Test"  -> shortcutToTestPM 
     73            _       -> tryFastEval pathName (pathName ++ ".yml") 
    6874        endAV'  <- findSymRef (cast "@*END") glob 
    6975        doArray (VRef endAV') (`array_unshift` ends) 
    7076        return rv 
    7177    where 
     78    shortcutToTestPM = do 
     79        globTVar    <- asks envGlobal 
     80        let MkCompUnit _ _ glob ast = decode (testByteStringLazy) 
     81        -- Inject the global bindings 
     82        stm $ do 
     83            glob' <- readMPad globTVar 
     84            writeMPad globTVar (glob `unionPads` glob') 
     85 
     86        -- | PEStatic   { pe_type :: !Type, pe_proto :: !VRef, pe_flags :: !EntryFlags, pe_store :: !(TVar VRef) } 
     87        evl <- asks envEval 
     88        evl ast 
    7289    tryFastEval pathName pathNameYml = do 
     90        io $ print pathNameYml 
    7391        ok <- io $ doesFileExist pathNameYml 
    7492        if not ok then slowEval pathName else do