1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Clean up this sketch

This commit is contained in:
Rick Winfrey 2018-12-12 16:58:06 -08:00
parent d0afae8cba
commit 869789ce48

View File

@ -638,16 +638,11 @@ instance Evaluatable New where
slot <- lookupDeclaration (Declaration name) slot <- lookupDeclaration (Declaration name)
classVal <- deref slot classVal <- deref slot
classFrame <- maybeM (throwEvalError $ ScopedEnvError classVal) =<< scopedEnvironment classVal classFrame <- maybeM (throwEvalError $ ScopedEnvError classVal) =<< scopedEnvironment classVal
classScope
instanceMembers <- getRelations classScope InstanceOf
objectFrame <- newFrame objectScope (Map.singleton Superclass $ Map.singleton assocScope classFrame) objectFrame <- newFrame objectScope (Map.singleton Superclass $ Map.singleton assocScope classFrame)
objectVal <- object objectFrame objectVal <- object objectFrame
void . withScopeAndFrame objectFrame $ do void . withScopeAndFrame objectFrame $ do
for_ instanceMembers $ \member ->
declare member span Default Nothing
let constructorName = Name.name "constructor" let constructorName = Name.name "constructor"
reference (Reference constructorName) (Declaration constructorName) reference (Reference constructorName) (Declaration constructorName)
constructor <- deref =<< lookupDeclaration (Declaration $ constructorName) constructor <- deref =<< lookupDeclaration (Declaration $ constructorName)