mirror of
https://github.com/github/semantic.git
synced 2024-12-15 10:02:27 +03:00
Add object to AbstractValue
This commit is contained in:
parent
de126c7b94
commit
fb0e7e3407
@ -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).
|
||||
scopedEnvironment :: value -> Evaluator term address value carrier (Maybe address)
|
||||
|
||||
object :: address -> Evaluator term address value carrier value
|
||||
|
||||
|
||||
-- TODO rethink whether this function is necessary.
|
||||
makeNamespace :: ( AbstractValue term address value m
|
||||
|
@ -133,3 +133,4 @@ instance AbstractValue term address Abstract m where
|
||||
liftComparison _ _ _ = pure Abstract
|
||||
|
||||
castToInteger _ = pure Abstract
|
||||
object _ = pure Abstract
|
||||
|
@ -367,6 +367,8 @@ instance ( Member (Allocator address) sig
|
||||
castToInteger (Float (Number.Decimal i)) = pure (Integer (Number.Integer (coefficient (normalize 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.
|
||||
data ValueError term address resume where
|
||||
StringError :: Value term address -> ValueError term address Text
|
||||
|
Loading…
Reference in New Issue
Block a user