From fb43de8fced626510bbc77146b7fef3a6f67bb9c Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 23 Mar 2018 09:04:11 -0700 Subject: [PATCH] Little formatting/cleanup for clarity --- src/Language/PHP/Syntax.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Language/PHP/Syntax.hs b/src/Language/PHP/Syntax.hs index ab6b7b125..c7acee877 100644 --- a/src/Language/PHP/Syntax.hs +++ b/src/Language/PHP/Syntax.hs @@ -364,17 +364,16 @@ instance Evaluatable Namespace where eval Namespace{..} = go names where names = toList (freeVariables (subterm namespaceName)) - go [] = fail "expected at least one free variable in namespaceName, found none" - go [name] = letrec' name $ \addr -> do + go [name] = letrec' name $ \addr -> subtermValue namespaceBody *> makeNamespace name addr go (name:xs) = letrec' name $ \addr -> go xs <* makeNamespace name addr + makeNamespace name addr = do namespaceEnv <- Env.head <$> getEnv v <- namespace name namespaceEnv - assign addr v - pure v + v <$ assign addr v letrec' name body = do addr <- lookupOrAlloc name v <- localEnv id (body addr)