1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Assign raise statements as Throw, with single list node

This commit is contained in:
Rick Winfrey 2017-06-08 10:17:34 -07:00
parent 8c611c1078
commit e4f2fa1f32
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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))