Changeset 21673 for src/Pugs/Prim/Eval.hs
- Timestamp:
- 08/01/08 13:56:05 (4 months ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Eval.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Eval.hs
r16627 r21673 18 18 import Pugs.Prim.Keyed 19 19 import Pugs.Types 20 import Pugs.Prelude 20 21 import DrIFT.YAML 21 22 import Data.Yaml.Syck 23 import Data.Binary (decode) 22 24 import qualified Data.ByteString.Char8 as Bytes 23 25 … … 50 52 let file | '.' `elem` mod = mod 51 53 | 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) 53 57 if loaded then opEval style pathName "" else do 54 58 -- %*INC{mod} = { relname => file, pathname => pathName } … … 65 69 ends <- fromVal =<< readRef endAV 66 70 clearRef endAV 67 rv <- tryFastEval pathName (pathName ++ ".yml") 71 rv <- case mod of 72 "Test" -> shortcutToTestPM 73 _ -> tryFastEval pathName (pathName ++ ".yml") 68 74 endAV' <- findSymRef (cast "@*END") glob 69 75 doArray (VRef endAV') (`array_unshift` ends) 70 76 return rv 71 77 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 72 89 tryFastEval pathName pathNameYml = do 90 io $ print pathNameYml 73 91 ok <- io $ doesFileExist pathNameYml 74 92 if not ok then slowEval pathName else do
