1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Show the symbol when choice fails.

This commit is contained in:
Rob Rix 2017-04-26 11:58:03 -04:00
parent ffbca016db
commit c85081ea6b

View File

@ -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