mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Merge the atEnd cases.
This commit is contained in:
parent
960e7f06d6
commit
cb75a9bd41
@ -337,7 +337,7 @@ instance (Eq grammar, Eq (ast (AST ast grammar))) => Alternative (Assignment ast
|
||||
(_, Alt rs) -> rebuild (Alt (pure l <> (continueR <$> rs))) id
|
||||
_ | Just (sl, cl) <- choices l
|
||||
, Just (sr, cr) <- choices r
|
||||
-> rebuild (Choose (sl `union` sr) (IntMap.unionWith (<|>) cl cr) (atEnd l <|> atEnd r)) id
|
||||
-> rebuild (Choose (sl `union` sr) (IntMap.unionWith (<|>) cl cr) ((<|>) <$> atEnd l <*> atEnd r)) id
|
||||
| otherwise -> rebuild (Alt [l, r]) id
|
||||
where distribute :: (l ~ lr, r ~ lr) => AssignmentF ast grammar lr -> Assignment ast grammar a
|
||||
distribute a = rebuild a (uncurry (<|>) . (continueL &&& continueR))
|
||||
|
Loading…
Reference in New Issue
Block a user