mirror of
https://github.com/github/semantic.git
synced 2024-12-24 07:25:44 +03:00
Replace instances of name "__self"
with __semantic_self
This commit is contained in:
parent
0c22d4da4b
commit
d0a571e851
@ -172,7 +172,7 @@ defineSelf :: ( AbstractValue term address value m
|
||||
)
|
||||
=> Evaluator term address value m ()
|
||||
defineSelf = do
|
||||
let self = Declaration $ X.name "__self"
|
||||
let self = Declaration X.__semantic_self
|
||||
-- TODO: Should `self` be given a special Relation?
|
||||
declare self Default emptySpan Nothing
|
||||
slot <- lookupDeclaration self
|
||||
|
@ -111,7 +111,7 @@ instance ( FreeVariables term
|
||||
withScopeAndFrame frameAddress $ do
|
||||
case maybeThis of
|
||||
Just object -> do
|
||||
slot <- lookupDeclaration (Declaration $ name "__self")
|
||||
slot <- lookupDeclaration (Declaration __semantic_self)
|
||||
assign slot object
|
||||
Nothing -> pure ()
|
||||
for_ (zip names params) $ \(name, param) -> do
|
||||
|
@ -13,7 +13,7 @@ import Prologue
|
||||
import Proto3.Suite.Class
|
||||
import Reprinting.Tokenize hiding (Superclass)
|
||||
import Data.Span (emptySpan)
|
||||
import Data.Abstract.Name as Name
|
||||
import Data.Abstract.Name (__semantic_self)
|
||||
|
||||
data Function a = Function { functionContext :: ![a], functionName :: !a, functionParameters :: ![a], functionBody :: !a }
|
||||
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, ToJSONFields1, Named1, Message1, NFData1)
|
||||
@ -91,9 +91,8 @@ instance Evaluatable Method where
|
||||
associatedScope <- declareFunction name span
|
||||
|
||||
params <- withScope associatedScope $ do
|
||||
let self = Name.name "__self"
|
||||
-- TODO: Should we give `self` a special Relation?
|
||||
declare (Declaration self) Default emptySpan Nothing
|
||||
declare (Declaration __semantic_self) Default emptySpan Nothing
|
||||
for methodParameters $ \paramNode -> do
|
||||
param <- maybeM (throwEvalError $ NoNameError paramNode) (declaredName paramNode)
|
||||
param <$ declare (Declaration param) Default span Nothing
|
||||
|
@ -701,6 +701,5 @@ instance Ord1 This where liftCompare = genericLiftCompare
|
||||
instance Show1 This where liftShowsPrec = genericLiftShowsPrec
|
||||
instance Evaluatable This where
|
||||
eval _ _ This = do
|
||||
let name = Name.name "__self"
|
||||
reference (Reference name) (Declaration name)
|
||||
deref =<< lookupDeclaration (Declaration name)
|
||||
reference (Reference __semantic_self) (Declaration __semantic_self)
|
||||
deref =<< lookupDeclaration (Declaration __semantic_self)
|
||||
|
@ -76,7 +76,7 @@ instance Evaluatable Send where
|
||||
Nothing ->
|
||||
pure (Name.name "call")
|
||||
|
||||
let self = lookupDeclaration (Declaration $ Name.name "__self") >>= deref
|
||||
let self = lookupDeclaration (Declaration __semantic_self) >>= deref
|
||||
lhsValue <- maybe self eval sendReceiver
|
||||
lhsFrame <- Abstract.scopedEnvironment lhsValue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user