Show
Ignore:
Timestamp:
08/01/08 13:56:05 (5 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/CodeGen/Binary.hs

    r15616 r21673  
    1 {-# OPTIONS_GHC -fglasgow-exts #-} 
     1{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances -fno-warn-orphans -funbox-strict-fields -cpp #-} 
    22 
    3 module Pugs.CodeGen.Binary (genBinary) where 
     3module Pugs.CodeGen.Binary (genParseBinary) where 
    44import Pugs.Internals 
    55import Pugs.AST 
    6 import Pugs.Compile 
    7 import Pugs.PIL1 
    8 import DrIFT.Binary 
    9 import System.IO 
    10 import System.Directory 
     6import Data.Binary 
     7import qualified Data.ByteString.Lazy.Char8 as L 
    118 
    12 genBinary :: Eval Val 
    13 genBinary = do 
    14     penv <- compile () :: Eval PIL_Environment 
    15     io $ do 
    16         tmp         <- getTemporaryDirectory 
    17         (file, fh)  <- openBinaryTempFile tmp "pugs.bin" 
    18         bh          <- openBinIO fh 
    19         put_ bh penv 
    20         hClose fh 
    21         return $ VStr (unlines [file]) 
     9genParseBinary :: FilePath -> Eval Val 
     10genParseBinary file = doGenParseBinary file 
     11 
     12doGenParseBinary :: FilePath -> Eval Val 
     13doGenParseBinary file = do 
     14    pad  <- filterPrim =<< asks envGlobal 
     15    main <- asks envBody 
     16    return $ VStr (L.unpack $! encode (mkCompUnit file pad main))