mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Show the symbol when choice fails.
This commit is contained in:
parent
ffbca016db
commit
c85081ea6b
@ -111,7 +111,7 @@ runAssignment = iterFreer (\ assignment yield state -> case (assignment, dropAno
|
|||||||
yield c (advanceState state)
|
yield c (advanceState state)
|
||||||
Choose choices -> case IntMap.lookup (fromEnum symbol) choices of
|
Choose choices -> case IntMap.lookup (fromEnum symbol) choices of
|
||||||
Just a -> yield a state
|
Just a -> yield a state
|
||||||
Nothing -> Error ["Expected " <> showChoices choices <> " but got " <> show subtree]
|
Nothing -> Error ["Expected " <> showChoices choices <> " but got " <> show symbol]
|
||||||
_ -> Error ["No rule to match " <> show subtree]
|
_ -> Error ["No rule to match " <> show subtree]
|
||||||
(Symbol s, AssignmentState{}) -> Error [ "Expected " <> show s <> " but got end of input." ]
|
(Symbol s, AssignmentState{}) -> Error [ "Expected " <> show s <> " but got end of input." ]
|
||||||
(Location, state@AssignmentState{..}) -> yield (Info.Range stateOffset stateOffset :. Info.SourceSpan statePos statePos :. Nil) state
|
(Location, state@AssignmentState{..}) -> yield (Info.Range stateOffset stateOffset :. Info.SourceSpan statePos statePos :. Nil) state
|
||||||
|
Loading…
Reference in New Issue
Block a user