mirror of
https://github.com/github/semantic.git
synced 2024-12-19 12:51:52 +03:00
Abbreviate the definition of state.
This commit is contained in:
parent
91f149310d
commit
a433fe8072
@ -291,8 +291,7 @@ runAssignment toNode source = (\ assignment state -> disamb Left (Right . minimu
|
|||||||
Children{} -> None (makeError node)
|
Children{} -> None (makeError node)
|
||||||
Source -> None (makeError node)
|
Source -> None (makeError node)
|
||||||
|
|
||||||
state | _:_ <- expectedSymbols, all ((== Regular) . symbolType) expectedSymbols = dropAnonymous initialState
|
state = if not (null expectedSymbols) && all ((== Regular) . symbolType) expectedSymbols then dropAnonymous initialState else initialState
|
||||||
| otherwise = initialState
|
|
||||||
expectedSymbols | Choose choices _ <- assignment = (toEnum :: Int -> grammar) <$> IntMap.keys choices
|
expectedSymbols | Choose choices _ <- assignment = (toEnum :: Int -> grammar) <$> IntMap.keys choices
|
||||||
| otherwise = []
|
| otherwise = []
|
||||||
makeError :: HasCallStack => Maybe (Base ast ast) -> Error grammar
|
makeError :: HasCallStack => Maybe (Base ast ast) -> Error grammar
|
||||||
|
Loading…
Reference in New Issue
Block a user