Changeset 9480
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Eval.hs
r9383 r9480 176 176 VControl c -> retControl c 177 177 _ -> action 178 179 {-|180 Perform the given evaluation in an /LValue/ context.181 -}182 enterLValue :: Eval a -> Eval a183 enterLValue = local (\e -> e{ envLValue = True })184 {-|185 Perform the given evaluation in an /RValue/ (i.e. non-/LValue/) context.186 -}187 enterRValue :: Eval a -> Eval a188 enterRValue = local (\e -> e{ envLValue = False })189 190 191 178 192 179 evalRef :: VRef -> Eval Val -
src/Pugs/Eval/Var.hs
r8931 r9480 376 376 inferExpType (Syn "=>" _) = return $ mkType "Pair" 377 377 inferExpType exp@(Syn "{}" [_, idxExp]) = if isSimpleExp exp 378 then fromVal =<< e valExp exp378 then fromVal =<< enterRValue (evalExp exp) 379 379 else fmap typeOfCxt (inferExpCxt idxExp) 380 380 inferExpType exp@(Syn "[]" [_, idxExp]) = if isSimpleExp exp 381 then fromVal =<< e valExp exp381 then fromVal =<< enterRValue (evalExp exp) 382 382 else fmap typeOfCxt (inferExpCxt idxExp) 383 383 inferExpType (Syn "sub" [exp]) = inferExpType exp -
src/Pugs/Monads.hs
r8705 r9480 14 14 15 15 module Pugs.Monads ( 16 enterLValue, enterRValue, 16 17 enterLex, enterContext, enterEvalContext, enterPackage, enterCaller, 17 18 enterGiven, enterWhen, enterWhile, genSymPrim, genSymCC, … … 47 48 return $ ma `mplus` mb 48 49 50 {-| 51 Perform the given evaluation in an /LValue/ context. 52 -} 53 enterLValue :: Eval a -> Eval a 54 enterLValue = local (\e -> e{ envLValue = True }) 55 {-| 56 Perform the given evaluation in an /RValue/ (i.e. non-/LValue/) context. 57 -} 58 enterRValue :: Eval a -> Eval a 59 enterRValue = local (\e -> e{ envLValue = False }) 49 60 50 61 {-|
