aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Haddock
diff options
context:
space:
mode:
authorDavid Lazar <lazar6@illinois.edu>2013-03-29 10:22:11 -0700
committerDavid Lazar <lazar6@illinois.edu>2013-03-29 10:22:11 -0700
commit7424454acef153176a14c3f95e925d5edd6b2e87 (patch)
treefda104aae2a4b7ba3fc2747a844faafea4358c22 /src/Text/Pandoc/Readers/Haddock
parent7cb8b60910ede36bba3598f85a06ddde6fc545d0 (diff)
downloadpandoc-7424454acef153176a14c3f95e925d5edd6b2e87.tar.gz
Haddock reader: improved error reporting.
Diffstat (limited to 'src/Text/Pandoc/Readers/Haddock')
-rw-r--r--src/Text/Pandoc/Readers/Haddock/Lex.x3
-rw-r--r--src/Text/Pandoc/Readers/Haddock/Parse.y6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Haddock/Lex.x b/src/Text/Pandoc/Readers/Haddock/Lex.x
index 902ac84c0..9d686c885 100644
--- a/src/Text/Pandoc/Readers/Haddock/Lex.x
+++ b/src/Text/Pandoc/Readers/Haddock/Lex.x
@@ -19,7 +19,8 @@
module Text.Pandoc.Readers.Haddock.Lex (
Token(..),
LToken,
- tokenise
+ tokenise,
+ tokenPos
) where
import Data.Char
diff --git a/src/Text/Pandoc/Readers/Haddock/Parse.y b/src/Text/Pandoc/Readers/Haddock/Parse.y
index 26d7c287d..c45e09113 100644
--- a/src/Text/Pandoc/Readers/Haddock/Parse.y
+++ b/src/Text/Pandoc/Readers/Haddock/Parse.y
@@ -46,7 +46,7 @@ import Data.Sequence (viewr, ViewR(..))
PARA { (TokPara,_) }
STRING { (TokString $$,_) }
-%monad { Maybe }
+%monad { Either [LToken] }
%name parseParas doc
%name parseString seq
@@ -126,8 +126,8 @@ strings :: { String }
| STRING strings { $1 ++ $2 }
{
-happyError :: [LToken] -> Maybe a
-happyError toks = Nothing
+happyError :: [LToken] -> Either [LToken] a
+happyError toks = Left toks
para' :: Inlines -> Blocks
para' (Many ils) =