From 508ead4cbb0892b230636bf39c4191ee4e5d4565 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 8 Jun 2017 16:47:25 -0700 Subject: [PATCH] Assign try statements --- src/Language/Python/Syntax.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index 8726e8c86..57843fb3b 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -62,6 +62,7 @@ type Syntax = , Statement.NoOp , Statement.Return , Statement.Throw + , Statement.Try , Statement.While , Statement.Yield , Language.Python.Syntax.Ellipsis @@ -118,6 +119,7 @@ statement = assertStatement <|> printStatement <|> raiseStatement <|> returnStatement + <|> tryStatement <|> whileStatement expressionStatement :: Assignment @@ -151,6 +153,10 @@ forStatement = makeTerm <$> symbol ForStatement <*> children (Statement.ForEach whileStatement :: Assignment whileStatement = makeTerm <$> symbol WhileStatement <*> children (Statement.While <$> expression <*> (makeTerm <$> location <*> many expression)) +-- TODO:: Assign try else clauses +tryStatement :: Assignment +tryStatement = makeTerm <$> symbol TryStatement <*> children (Statement.Try <$> expression <*> (many expression)) + exceptClause :: Assignment exceptClause = makeTerm <$> symbol ExceptClause <*> children (Statement.Catch <$> optional (makeTerm <$> location <*> many expression <* symbol AnonColon) <*> expression) finallyClause :: Assignment