From e3e420503ea73cfd24a355bdaf21d0fa2db4f02a Mon Sep 17 00:00:00 2001 From: Oleg Grenrus <oleg.grenrus@iki.fi> Date: Mon, 11 Sep 2023 17:08:07 +0300 Subject: [PATCH] Resolve #48: Add Exception ParseError instance --- ChangeLog.md | 1 + src/Text/Parsec/Error.hs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index e47ca63..d834800 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,7 @@ - Change the position comparison in `mergeError` to not compare source names. This doesn't alter reported error positions when only a single source is parsed. This fixes performance issue caused by long source names. +- Add `Exception ParseError` instance ### 3.1.16.0 diff --git a/src/Text/Parsec/Error.hs b/src/Text/Parsec/Error.hs index 8421609..e518001 100644 --- a/src/Text/Parsec/Error.hs +++ b/src/Text/Parsec/Error.hs @@ -25,6 +25,7 @@ module Text.Parsec.Error , mergeError ) where +import Control.Exception ( Exception ) import Data.List ( nub, sort ) import Data.Typeable ( Typeable ) import qualified Data.Monoid as Mon @@ -170,6 +171,9 @@ instance Eq ParseError where where messageStrs = map messageString . errorMessages +-- | @since 3.1.17.0 +instance Exception ParseError + -- Language independent show function -- TODO -- GitLab