Skip to content

Commit

Permalink
[ fix ] nonexhaustive yikes
Browse files Browse the repository at this point in the history
  • Loading branch information
pigworker committed Oct 1, 2024
1 parent 20326a1 commit 09cb9cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Language/Ask/ChkRaw.hs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ chkParse (Make Pse (ParseProb c sm) m () ss (ls, rs)) = do
ns :-/ (mempty ::- Make Pse (ParseProb c Nothing) (Stub True) (Need, False)
([] :-/ Stop) ([], []))
:-\ xs)
subs _ _ = gripe $ Bland "There's something I don't understand about this parse tree."
ps <- foldMap prods <$> gamma
case m of
Stub b -> case ss of
Expand Down
1 change: 1 addition & 0 deletions lib/Language/Ask/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ data Gripe
| ParseNotTheWanted Con
| ParseNoMake String
| ParseStubSub
| Bland String
| FAIL
deriving Show

Expand Down
1 change: 1 addition & 0 deletions lib/Language/Ask/Printing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ ppGripe (ParseNotTheWanted c) = return $ concat
ppGripe (ParseNoMake s) = return $ concat
["This doesn't make ", s, "."]
ppGripe ParseStubSub = return "Don't give subtrees until you've chosen a production."
ppGripe (Bland x) = return x

ppGripe FAIL = return $
"It went wrong but I've forgotten how. Please ask a human for help."
Expand Down

0 comments on commit 09cb9cd

Please sign in to comment.