From 3fa80d509505174a413dc624bed211e859ddd660 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 10 Oct 2019 10:30:42 -0400 Subject: [PATCH] Fix Rob's suggestions. --- semantic-python/src/Language/Python/Core.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/semantic-python/src/Language/Python/Core.hs b/semantic-python/src/Language/Python/Core.hs index 387fc4dd3..95349d972 100644 --- a/semantic-python/src/Language/Python/Core.hs +++ b/semantic-python/src/Language/Python/Core.hs @@ -241,7 +241,6 @@ instance Compile Py.FunctionDefinition where } cc = do -- Compile each of the parameters, then the body. parameters' <- traverse param parameters - -- BUG: ignoring the continuation here body' <- compile body (pure none) -- Build a lambda. located <- locate it (lams parameters' body') @@ -263,11 +262,10 @@ instance Compile Py.Identifier where instance Compile Py.IfStatement where compile it@Py.IfStatement{ condition, consequence, alternative} cc = - locate it =<< (if' - <$> compile condition (pure none) - <*> compile consequence cc - <*> foldr clause cc alternative - ) + locate it =<< if' + <$> compile condition (pure none) + <*> compile consequence cc + <*> foldr clause cc alternative where clause (R1 Py.ElseClause{ body }) _ = compile body cc clause (L1 Py.ElifClause{ condition, consequence }) rest = if' <$> compile condition (pure none) <*> compile consequence cc <*> rest