Skip to content

Commit

Permalink
fix(Internal.Token.Space): iadd mbetter error msg when whitespace par…
Browse files Browse the repository at this point in the history
…sers have not been initialised
  • Loading branch information
david-davies committed Nov 22, 2024
1 parent df12dd3 commit ae8a2c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Text/Gigaparsec/Internal/Token/Space.hs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ getMapRef wsMap = unsafeIOToRT $ do
Nothing -> do
tid <- myThreadIDKey
error $ concat [
"GigaParsec.Internal.Token.Space.getMapRef: "
"\n > Gigaparsec Error: Whitespace parser has not been initialised for this thread."
, "\n | This usually occurs if you have not used the `fully` combinator in `Text.Gigaparsec.Token.Lexer`."
, "\n | `fully` handles the initialisation of the whitespace parsers given by a lexer description."
, "\n | If you use the lexical descriptions, then any 'top-level' parser should be wrapped in the `fully` combinator."
, "\n | This includes any parser that is given to, for example, the `parse`, `parseFromFile`, and `parseRepl` functions in `Text.Gigaparsec`"
, "\n\n (Internal Error): Text.Gigaparsec.Internal.Token.Space.getMapRef: "
, "entry in `RefMap` not initialised for thread: "
, show tid
]
Expand Down

0 comments on commit ae8a2c8

Please sign in to comment.