diff options
author | David Lazar <lazar6@illinois.edu> | 2013-03-29 10:22:11 -0700 |
---|---|---|
committer | David Lazar <lazar6@illinois.edu> | 2013-03-29 10:22:11 -0700 |
commit | 7424454acef153176a14c3f95e925d5edd6b2e87 (patch) | |
tree | fda104aae2a4b7ba3fc2747a844faafea4358c22 /src/Text/Pandoc/Readers/Haddock | |
parent | 7cb8b60910ede36bba3598f85a06ddde6fc545d0 (diff) | |
download | pandoc-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.x | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Haddock/Parse.y | 6 |
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) = |