1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

ruby: implement Send

This commit is contained in:
Charlie Somerville 2018-04-05 16:01:11 +10:00
parent 4f30c84add
commit 1b998409d3

View File

@ -44,7 +44,12 @@ instance Ord1 Send where liftCompare = genericLiftCompare
instance Show1 Send where liftShowsPrec = genericLiftShowsPrec instance Show1 Send where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Send where instance Evaluatable Send where
eval (Send _ _ _ _) = fail "send unimplemented!" eval Send{..} = do
recvEnv <- case sendReceiver of
Just recv -> subtermValue recv >>= scopedEnvironment
Nothing -> getEnv -- send to implicit self
func <- localEnv (mappend recvEnv) (subtermValue sendSelector)
call func (map subtermValue sendArgs) -- TODO pass through sendBlock
data Require a = Require { requireRelative :: Bool, requirePath :: !a } data Require a = Require { requireRelative :: Bool, requirePath :: !a }
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1) deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1)