Changeset 4333 for src/Pugs/Prim/Code.hs

Show
Ignore:
Timestamp:
06/03/05 02:36:06 (4 years ago)
Author:
theorbtwo
svk:copy_cache_prev:
5929
Message:

Code::pos method (not quite working?)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Code.hs

    r4270 r4333  
    33import Pugs.AST 
    44import Pugs.Internals 
     5 
     6{- On Code -} 
    57 
    68op1CodeAssoc :: Val -> Eval Val 
     
    2325    code <- fromVal v 
    2426    expToEvalVal $ subBody code 
     27 
     28op1CodePos :: Val -> Eval Val 
     29op1CodePos v = do 
     30    code <- fromVal v 
     31    let env = subEnv code 
     32    case env of 
     33        Nothing  -> return VUndef 
     34        Just env -> return $ castV $ show $ envPos env 
     35 
     36{- On Code::Exp -} 
     37 
     38