Changeset 15297 for src/Pugs/CodeGen

Show
Ignore:
Timestamp:
02/18/07 15:59:02 (21 months ago)
Author:
audreyt
Message:

* Revert the previous patch; everything back to normal.

Location:
src/Pugs/CodeGen
Files:
6 modified

Legend:

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

    r15296 r15297  
    1111genJSON = do 
    1212    penv <- compile () :: Eval PIL_Environment 
    13     return . _VStr . unlines $ [showJSON penv] 
     13    return . VStr . unlines $ [showJSON penv] 
  • src/Pugs/CodeGen/PIL1.hs

    r15296 r15297  
    1010genPIL1 = do 
    1111    penv <- compile () 
    12     return . _VStr . unlines $ 
     12    return . VStr . unlines $ 
    1313        [ "PIL_Environment" 
    1414        , "    { pilMain = (" ++ show (pilMain penv) ++ ")" 
  • src/Pugs/CodeGen/PIL2.hs

    r15296 r15297  
    1717genPIL2 = do 
    1818    penv <- compile () 
    19     return . _VStr . unlines $ 
     19    return . VStr . unlines $ 
    2020        [ "PIL_Environment" 
    2121        , "    { pilMain = (" ++ show (pilMain penv) ++ ")" 
     
    2727genPIL2Perl5 = do 
    2828    penv <- compile () :: Eval PIL_Environment 
    29     return . _VStr . unlines $ [showPerl5 penv] 
     29    return . VStr . unlines $ [showPerl5 penv] 
    3030 
    3131genPIL2JSON :: Eval Val 
    3232genPIL2JSON = do 
    3333    penv <- compile () :: Eval PIL_Environment 
    34     return . _VStr . unlines $ [showJSON penv] 
     34    return . VStr . unlines $ [showJSON penv] 
    3535 
    3636genPIL2YAML :: Eval Val 
     
    3838    penv <- compile () :: Eval PIL_Environment 
    3939    yaml <- liftIO (showYaml penv) 
    40     return . _VStr . unlines $ [yaml] 
     40    return . VStr . unlines $ [yaml] 
  • src/Pugs/CodeGen/PIR.hs

    r15296 r15297  
    162162instance Translate PIL_Literal Expression where 
    163163    trans (PVal (VBool bool)) = return $ ExpLit (LitInt (toInteger $ fromEnum bool)) 
    164     trans (PVal (VStr str)) = return $ ExpLit (LitStr (cast str)) 
     164    trans (PVal (VStr str)) = return $ ExpLit (LitStr str) 
    165165    trans (PVal (VInt int)) = return $ ExpLit (LitInt int) 
    166166    trans (PVal (VNum num)) = return $ ExpLit (LitNum num) 
     
    168168    -- trans (PVal (VList [])) = return $ LitInt 0 -- XXX Wrong 
    169169    trans (PVal (VCode code)) 
    170         | MkCode{ subBody = Syn syn [ Ann _ exp ] } <- code 
    171         , syn == cast "block"  
     170        | MkCode{ subBody = Syn "block" [ Ann _ exp ] } <- code 
    172171        , App (Var var) Nothing [] <- exp 
    173172        = fmap ExpLV (trans (PVar $ cast var)) 
     
    374373genPIR_YAML = genPIRWith $ \globPIR mainPIR _ -> do 
    375374    yaml <- liftIO (showYaml (mainPIR, globPIR)) 
    376     return (_VStr yaml) 
     375    return (VStr yaml) 
    377376 
    378377{-| Compiles the current environment to PIR code. -} 
     
    380379genPIR = genPIRWith $ \globPIR mainPIR penv -> do 
    381380    libs        <- liftIO $ getLibs 
    382     return . _VStr . unlines $ 
     381    return . VStr . unlines $ 
    383382        [ "#!/usr/bin/env parrot" 
    384383        , renderStyle (Style PageMode 0 0) $ preludePIR $+$ vcat 
  • src/Pugs/CodeGen/Perl5.hs

    r15296 r15297  
    1111genPerl5 = do 
    1212    penv <- compile () :: Eval PIL_Environment 
    13     return . _VStr . unlines $ [showPerl5 penv] 
     13    return . VStr . unlines $ [showPerl5 penv] 
  • src/Pugs/CodeGen/YAML.hs

    r15296 r15297  
    1818    main <- asks envBody 
    1919    yaml <- liftIO $ f $ mkCompUnit "<unused>" pad main 
    20     return $ _VStr yaml 
     20    return $ VStr yaml 
    2121 
    2222genYAML :: Eval Val 
     
    2424    penv <- compile () :: Eval PIL_Environment 
    2525    yaml <- liftIO (showYaml penv) 
    26     return $ _VStr yaml 
     26    return $ VStr yaml