diff --git a/src/Data/Syntax/Statement.hs b/src/Data/Syntax/Statement.hs index a315442f8..14236d0de 100644 --- a/src/Data/Syntax/Statement.hs +++ b/src/Data/Syntax/Statement.hs @@ -102,7 +102,7 @@ instance Show1 DoWhile where liftShowsPrec = genericLiftShowsPrec -- Exception handling -newtype Throw a = Throw [a] +newtype Throw a = Throw a deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable) instance Eq1 Throw where liftEq = genericLiftEq diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index f4969cfbd..043e2b14c 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -294,7 +294,7 @@ deleteStatement = makeTerm <$> symbol DeleteStatement <*> children (Expression.C where deleteIdentifier = makeTerm <$> symbol AnonDel <*> (Syntax.Identifier <$> source) raiseStatement :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location) -raiseStatement = makeTerm <$> symbol RaiseStatement <*> children (Statement.Throw <$> (many expression)) +raiseStatement = makeTerm <$> symbol RaiseStatement <*> children (Statement.Throw <$> (makeTerm <$> location <*> (many expression))) ifStatement :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location) ifStatement = makeTerm <$> symbol IfStatement <*> children (Statement.If <$> expression <*> statement <*> (flip (foldr makeElif) <$> many elifClause <*> optionalElse))