aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockParse.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/HaddockParse.y')
-rw-r--r--src/HaddockParse.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HaddockParse.y b/src/HaddockParse.y
index 668e7d28..0c5ebf49 100644
--- a/src/HaddockParse.y
+++ b/src/HaddockParse.y
@@ -3,6 +3,8 @@ module HaddockParse (parseParas, parseString) where
import HaddockLex
import HaddockTypes
+
+import MonadError
}
%tokentype { Token }
@@ -18,6 +20,8 @@ import HaddockTypes
PARA { TokPara }
STRING { TokString $$ }
+%monad { Either String }
+
%name parseParas doc
%name parseString seq
@@ -53,5 +57,7 @@ elem :: { ParsedDoc }
| '[' seq ']' { DocMonospaced $2 }
{
-happyError toks = error ("parse error in doc string: " ++ show (take 3 toks))
+happyError :: [Token] -> Either String a
+happyError toks =
+ throwError ("parse error in doc string: " ++ show (take 3 toks))
}