From 3f1ceeed8b47343415db3b2cf44904e418676bea Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 12 Jun 2017 10:35:31 -0700 Subject: [PATCH] Update return statement assignments to accept empty return statements --- src/Language/Python/Syntax.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index 3cdb7f4fb..f0b48fa66 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -344,7 +344,7 @@ await :: Assignment await = makeTerm <$> symbol Await <*> children (Expression.Call <$> (makeTerm <$> symbol AnonAwait <*> (Syntax.Identifier <$> source)) <*> many expression) returnStatement :: Assignment -returnStatement = makeTerm <$> symbol ReturnStatement <*> (Statement.Return <$> children expressionList) +returnStatement = makeTerm <$> symbol ReturnStatement <*> children (Statement.Return <$> (expressionList <|> emptyTerm)) deleteStatement :: Assignment deleteStatement = makeTerm <$> symbol DeleteStatement <*> children (Expression.Call <$> deleteIdentifier <* symbol ExpressionList <*> children (many expression))