mirror of
https://github.com/github/semantic.git
synced 2024-12-11 08:45:48 +03:00
Fix up parts of Evaluatable Class; not sure about the klass
declaration
This commit is contained in:
parent
d76fcb73a7
commit
8c26fbfb61
@ -210,22 +210,21 @@ instance Evaluatable Class where
|
|||||||
|
|
||||||
supers <- for classSuperclasses $ \superclass -> do
|
supers <- for classSuperclasses $ \superclass -> do
|
||||||
name <- maybeM (throwEvalError NoNameError) (declaredName (subterm superclass))
|
name <- maybeM (throwEvalError NoNameError) (declaredName (subterm superclass))
|
||||||
scope <- associatedScope (Declaration name)
|
associatedScope (Declaration name)
|
||||||
(scope,) <$> subtermAddress superclass
|
|
||||||
|
|
||||||
let imports = (Import,) <$> (fmap pure . catMaybes $ fst <$> supers)
|
let imports = (Import,) <$> (fmap pure . catMaybes $ supers)
|
||||||
current = maybe mempty (fmap (Lexical, ) . pure . pure) currentScope'
|
current = maybe mempty (fmap (Lexical, ) . pure . pure) currentScope'
|
||||||
edges = Map.fromList (imports <> current)
|
edges = Map.fromList (imports <> current)
|
||||||
childScope <- newScope edges
|
childScope <- newScope edges
|
||||||
declare (Declaration name) span (Just childScope)
|
declare (Declaration name) span (Just childScope)
|
||||||
|
|
||||||
withScope childScope $ do
|
-- withScope childScope $ do
|
||||||
(_, addr) <- letrec name $ do
|
-- (_, addr) <- letrec name $ do
|
||||||
void $ subtermValue classBody
|
-- void $ subtermValue classBody
|
||||||
classBinds <- Env.head <$> getEnv
|
-- classBinds <- Env.head <$> getEnv
|
||||||
klass name (snd <$> supers) classBinds
|
-- klass (Declaration name) (catMaybes supers) classBinds -- TODO: Update klass definition
|
||||||
bind name addr
|
-- pure (Rval addr)
|
||||||
pure (Rval addr)
|
rvalBox unit
|
||||||
|
|
||||||
-- | A decorator in Python
|
-- | A decorator in Python
|
||||||
data Decorator a = Decorator { decoratorIdentifier :: !a, decoratorParamaters :: ![a], decoratorBody :: !a }
|
data Decorator a = Decorator { decoratorIdentifier :: !a, decoratorParamaters :: ![a], decoratorBody :: !a }
|
||||||
|
Loading…
Reference in New Issue
Block a user