mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Ensure productivity for catch rules at end.
This commit is contained in:
parent
30b6309cd1
commit
81f72193e0
@ -356,7 +356,7 @@ instance (Eq grammar, Eq (ast (AST ast grammar))) => Alternative (Assignment ast
|
||||
atEnd :: Assignment ast grammar z -> Maybe (Assignment ast grammar z)
|
||||
atEnd (Tracing _ (Choose _ _ atEnd) `Then` continue) = continue <$> atEnd
|
||||
atEnd (Tracing _ (Many rule) `Then` continue) = Just (pure <$> rule <|> pure [] >>= continue)
|
||||
atEnd rule@(Tracing _ (Catch _ _) `Then` _) = Just rule
|
||||
atEnd (Tracing _ (Catch during handler) `Then` continue) = (>>= continue) <$> atEnd during <|> Just (location >>= \ (_ :. span :. Nil) -> handler (Error span (Right <$> firstSet during) Nothing) >>= continue)
|
||||
atEnd (Tracing _ (Label inner _) `Then` continue) = (>>= continue) <$> atEnd inner
|
||||
atEnd _ = Nothing
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user