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

Rename resolve to ref.

This commit is contained in:
Rob Rix 2018-12-07 11:45:29 -05:00
parent 23e3a688f7
commit 3c2a4241e8
3 changed files with 19 additions and 19 deletions

View File

@ -77,23 +77,23 @@ class (Show1 constr, Foldable constr) => Evaluatable constr where
v <- throwUnspecializedError $ UnspecializedError ("Eval unspecialized for " <> liftShowsPrec (const (const id)) (const id) 0 expr "")
rvalBox v
resolve :: ( AbstractValue term address value m
, Carrier sig m
, Declarations term
, Member (Reader (CurrentFrame address)) sig
, Member (Reader (CurrentScope address)) sig
, Member (Reader ModuleInfo) sig
, Member (Reader Span) sig
, Member (Resumable (BaseError (EvalError address value))) sig
, Member (Resumable (BaseError (HeapError address))) sig
, Member (Resumable (BaseError (ScopeError address))) sig
, Member (State (Heap address address value)) sig
, Member (State (ScopeGraph address)) sig
, Ord address
)
=> (term -> Evaluator term address value m value)
-> (constr term -> Evaluator term address value m (Maybe (Slot address)))
resolve _ _ = pure Nothing
ref :: ( AbstractValue term address value m
, Carrier sig m
, Declarations term
, Member (Reader (CurrentFrame address)) sig
, Member (Reader (CurrentScope address)) sig
, Member (Reader ModuleInfo) sig
, Member (Reader Span) sig
, Member (Resumable (BaseError (EvalError address value))) sig
, Member (Resumable (BaseError (HeapError address))) sig
, Member (Resumable (BaseError (ScopeError address))) sig
, Member (State (Heap address address value)) sig
, Member (State (ScopeGraph address)) sig
, Ord address
)
=> (term -> Evaluator term address value m value)
-> (constr term -> Evaluator term address value m (Maybe (Slot address)))
ref _ _ = pure Nothing
traceResolve :: (Show a, Show b, Member Trace sig, Carrier sig m) => a -> b -> Evaluator term address value m ()

View File

@ -169,7 +169,7 @@ instance Evaluatable Identifier where
reference (Reference name) (Declaration name)
LvalMember <$> lookupDeclaration (Declaration name)
resolve _ (Identifier name) = do
ref _ (Identifier name) = do
reference (Reference name) (Declaration name)
Just <$> lookupDeclaration (Declaration name)

View File

@ -527,7 +527,7 @@ instance Evaluatable MemberAccess where
-- Throw a ReferenceError since we're attempting to reference a name within a value that is not an Object.
throwEvalError (ReferenceError lhsValue rhs)
resolve eval MemberAccess{..} = do
ref eval MemberAccess{..} = do
name <- maybeM (throwEvalError NoNameError) (declaredName lhs)
reference (Reference name) (Declaration name)
lhsValue <- eval lhs