Changeset 15297 for src/Pugs/Compile.hs

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

* Revert the previous patch; everything back to normal.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile.hs

    r15296 r15297  
    1 {-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances -fno-warn-orphans -funbox-strict-fields -cpp -fno-warn-deprecations -fallow-overlapping-instances -foverloaded-strings #-} 
     1{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances -fno-warn-orphans -funbox-strict-fields -cpp -fno-warn-deprecations -fallow-overlapping-instances #-} 
    22 
    33{-| 
     
    8989            decls   <- eachM cvList $ \(i, cv) -> do 
    9090                compile (("&*END_" ++ show i), cv) :: Comp [PIL_Decl] 
    91             compile ("&*END" :: String, concat decls) 
     91            compile ("&*END", concat decls) 
    9292        canCompile ((_:twigil:_), _) | not (isAlphaNum twigil) = return [] 
    9393        canCompile (name, [(_, sym)]) = do 
     
    186186          -- XXX - kludge. 
    187187          decl = App (_Var func) Nothing [(Val (VStr pkg))] 
    188           func = "&" ++ (capitalize (cast sym)) ++ "::_create" 
     188          func = "&" ++ (capitalize sym) ++ "::_create" 
    189189          capitalize []     = [] 
    190190          capitalize (c:cs) = toUpper c:cs 
     
    287287    -- XXX: pragmas? 
    288288    compile (Var name) = return $ _PVar name 
    289     compile (Syn syn exps) | sigil:"::()" <- cast syn = do 
     289    compile (Syn (sigil:"::()") exps) = do 
    290290        compile $ App (_Var "&Pugs::Internals::symbolic_deref") Nothing $ 
    291             (Val . _VStr $ sigil:""):exps 
    292     compile (App (Var var) (Just inv) args) | var == cast (__"&goto") = do 
     291            (Val . VStr $ sigil:""):exps 
     292    compile (App (Var var) (Just inv) args) | var == cast "&goto" = do 
    293293        cxt     <- askTCxt 
    294294        funC    <- compile inv 
     
    325325    compile (Syn "\\[]" exps) = do 
    326326        compile (App (_Var "&circumfix:[]") Nothing exps) 
    327     compile (Syn syn exps) | name@(sigil:"{}") <- cast syn, (sigil ==) `any` "$@%&" = do 
     327    compile (Syn name@(sigil:"{}") exps) | (sigil ==) `any` "$@%&" = do 
    328328        compile (App (_Var $ "&circumfix:" ++ name) Nothing exps) 
    329329    compile (Syn "\\{}" exps) = do 
     
    338338        (lhsC, rhsC) <- enterLValue $ compile exps 
    339339        return $ PBind [lhsC] rhsC 
    340     compile (Syn syn [lhs, exp]) | last (cast syn) == '=' = do 
    341         let op = "&infix:" ++ init (cast syn) 
     340    compile (Syn syn [lhs, exp]) | last syn == '=' = do 
     341        let op = "&infix:" ++ init syn 
    342342        compile $ Syn "=" [lhs, App (_Var op) Nothing [lhs, exp]] 
    343343    compile (Syn "but" [obj, block]) = 
     
    363363    condC   <- enter (CxtItem $ mkType "Bool") $ compile cond 
    364364    bodyC   <- enter CxtVoid $ compile body 
    365     funC    <- compile (_Var $ "&statement_control:" ++ cast name) 
     365    funC    <- compile (_Var $ "&statement_control:" ++ name) 
    366366    return . PStmt . PExp $ PApp cxt funC Nothing [pBlock condC, bodyC] 
    367367compLoop exp = compError exp 
     
    373373compConditional (Syn name exps) = do 
    374374    [condC, trueC, falseC] <- compile exps 
    375     funC    <- compile $ _Var ("&statement_control:" ++ cast name) 
     375    funC    <- compile $ _Var ("&statement_control:" ++ name) 
    376376    cxt     <- askTCxt 
    377377    return $ PApp cxt funC Nothing [condC, PThunk trueC, PThunk falseC]