Changeset 13917 for src/Pugs/AST.hs

Show
Ignore:
Timestamp:
10/05/06 14:31:18 (2 years ago)
Author:
audreyt
Message:

* Pugs.AST: Int(x=>1), Int(4) etc are all disallowed

for now (explicit coercion comes later). This makes
non-dotted-new-disallowed.t pass.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/AST.hs

    r13903 r13917  
    216216mergeStmts x y = Stmts x y 
    217217 
     218isImplicitTopic :: String -> Bool 
    218219isImplicitTopic "subst" = True 
    219220isImplicitTopic "match" = True 
     
    282283    , subReturns    = typ 
    283284    , subLValue     = False 
    284     , subParams     = [] 
     285    , subParams     = [defaultArrayParam, defaultHashParam{ paramName = cast "%" }] 
    285286    , subBindings   = [] 
    286287    , subSlurpLimit = [] 
    287     , subBody       = Prim . const . expToEvalVal $ exp 
     288    , subBody       = Prim $ \v -> do 
     289        list <- mapM fromVals v :: Eval [VList] 
     290        case concat list of 
     291            []  -> expToEvalVal $ exp 
     292            xs  -> retError ("Cannot coerce to " ++ name) xs 
    288293    , subCont       = Nothing 
    289294    , subPreBlocks = []