From 6010bcb439d557d7490f16918486e0b7d013f4f5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 26 Apr 2017 11:39:32 -0400 Subject: [PATCH] Show a better error for committed choice at end of input. --- src/Data/Syntax/Assignment.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 192d19bcd..5640eed19 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -113,6 +113,7 @@ runAssignment = iterFreer (\ assignment yield state -> case (assignment, dropAno (Location, AssignmentState{..}) -> yield (Info.Range stateOffset stateOffset :. Info.SourceSpan statePos statePos :. Nil) state (Source, AssignmentState{}) -> Error [ "Expected leaf node but got end of input." ] (Children _, AssignmentState{}) -> Error [ "Expected branch node but got end of input." ] + (Choose choices, AssignmentState{}) -> Error [ "Expected " <> showChoices choices <> " but got end of input." ] _ -> Error ["No rule to match at end of input."]) . fmap (\ a state -> Result (state, a)) where showChoices :: IntMap.IntMap b -> Text