Changeset 5030 for src/Pugs/CodeGen

Show
Ignore:
Timestamp:
06/27/05 21:28:19 (3 years ago)
Author:
autrijus
svk:copy_cache_prev:
6880
Message:

* include prelude bindings in PIL output.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/CodeGen/PIL.hs

    r5029 r5030  
    88import Pugs.Compile 
    99 
    10 {-| Compiles the current environment to PIR code. -} 
    1110genPIL :: Eval Val 
    1211genPIL = do 
     12    glob        <- askGlobal 
    1313    main        <- asks envBody 
     14    globPIL     <- compile glob :: Eval [PIL Decl] 
    1415    mainPIL     <- compile main :: Eval (PIL [Stmt]) 
    15     return . VStr $ show mainPIL 
     16    return . VStr . unlines $ 
     17        [ "PIL_Environment" 
     18        , "    { pilMain = (" ++ show mainPIL ++ ")" 
     19        , "    , pilGlob = (" ++ show globPIL ++ ")" 
     20        , "    }" 
     21        ]