1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00

Clearer error message for children assignment.

This commit is contained in:
Rob Rix 2017-04-13 10:50:00 -04:00
parent 3de5f3aaf9
commit a0322cf652

View File

@ -82,6 +82,7 @@ runAssignment = iterFreer (\ assignment yield nodes -> case (assignment, skipAno
_ -> Error ["No rule to match " <> show node] _ -> Error ["No rule to match " <> show node]
(Rule symbol, []) -> Error [ "Expected " <> show symbol <> " but got end of input." ] (Rule symbol, []) -> Error [ "Expected " <> show symbol <> " but got end of input." ]
(Content, []) -> Error [ "Expected leaf node but got end of input." ] (Content, []) -> Error [ "Expected leaf node but got end of input." ]
(Children _, []) -> Error [ "Expected branch node but got end of input." ]
_ -> Error ["No rule to match at end of input."]) _ -> Error ["No rule to match at end of input."])
. fmap ((Result .) . flip (,)) . fmap ((Result .) . flip (,))
where skipAnonymous = dropWhile ((/= Regular) . symbolType . nodeSymbol . roseValue) where skipAnonymous = dropWhile ((/= Regular) . symbolType . nodeSymbol . roseValue)