1
1
mirror of https://github.com/github/semantic.git synced 2024-12-16 02:21:55 +03:00

Add object to AbstractValue

This commit is contained in:
joshvera 2018-11-16 16:11:39 -05:00
parent de126c7b94
commit fb0e7e3407
3 changed files with 5 additions and 0 deletions

View File

@ -299,6 +299,8 @@ class AbstractIntro value => AbstractValue term address value carrier where
-- | Extract the environment from any scoped object (e.g. classes, namespaces, etc). -- | Extract the environment from any scoped object (e.g. classes, namespaces, etc).
scopedEnvironment :: value -> Evaluator term address value carrier (Maybe address) scopedEnvironment :: value -> Evaluator term address value carrier (Maybe address)
object :: address -> Evaluator term address value carrier value
-- TODO rethink whether this function is necessary. -- TODO rethink whether this function is necessary.
makeNamespace :: ( AbstractValue term address value m makeNamespace :: ( AbstractValue term address value m

View File

@ -133,3 +133,4 @@ instance AbstractValue term address Abstract m where
liftComparison _ _ _ = pure Abstract liftComparison _ _ _ = pure Abstract
castToInteger _ = pure Abstract castToInteger _ = pure Abstract
object _ = pure Abstract

View File

@ -367,6 +367,8 @@ instance ( Member (Allocator address) sig
castToInteger (Float (Number.Decimal i)) = pure (Integer (Number.Integer (coefficient (normalize i)))) castToInteger (Float (Number.Decimal i)) = pure (Integer (Number.Integer (coefficient (normalize i))))
castToInteger i = throwValueError (NumericError i) castToInteger i = throwValueError (NumericError i)
object frameAddress = pure (Object frameAddress)
-- | The type of exceptions that can be thrown when constructing values in 'Value's 'MonadValue' instance. -- | The type of exceptions that can be thrown when constructing values in 'Value's 'MonadValue' instance.
data ValueError term address resume where data ValueError term address resume where
StringError :: Value term address -> ValueError term address Text StringError :: Value term address -> ValueError term address Text