1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Drop anonymous nodes before catches whose bodies would drop anonymous nodes.

This prevents handlers capturing tokens that would otherwise have been skipped altogether.
This commit is contained in:
Rob Rix 2017-08-06 16:14:55 -04:00
parent de18f9c860
commit 1635baf667

View File

@ -197,6 +197,7 @@ nodeError expected (Node actual _ span) = Error span expected (Just (Right actua
firstSet :: Assignment ast grammar a -> [grammar] firstSet :: Assignment ast grammar a -> [grammar]
firstSet = iterFreer (\ assignment _ -> case assignment of firstSet = iterFreer (\ assignment _ -> case assignment of
Choose symbols _ -> symbols Choose symbols _ -> symbols
Catch during _ -> firstSet during
_ -> []) . ([] <$) _ -> []) . ([] <$)