1
1
mirror of https://github.com/github/semantic.git synced 2025-01-01 19:55:34 +03:00

Evaluate Expression.Delete using ref.

This commit is contained in:
Rob Rix 2018-12-10 09:52:51 -05:00
parent 3d2ced84c3
commit 0adaad3ba0

View File

@ -353,11 +353,7 @@ instance Ord1 Delete where liftCompare = genericLiftCompare
instance Show1 Delete where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Delete where
eval eval _ (Delete a) = do
valueRef <- eval a
case valueRef of
LvalMember addr -> dealloc addr >> rvalBox unit
Rval val -> throwEvalError (DerefError val)
eval _ ref (Delete a) = ref a >>= dealloc >> rvalBox unit
-- | A sequence expression such as Javascript or C's comma operator.
data SequenceExpression a = SequenceExpression { firstExpression :: !a, secondExpression :: !a }