diff options
Diffstat (limited to 'bbcode/src')
| -rw-r--r-- | bbcode/src/Text/BBCode.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bbcode/src/Text/BBCode.hs b/bbcode/src/Text/BBCode.hs index d0c9974..f2a9570 100644 --- a/bbcode/src/Text/BBCode.hs +++ b/bbcode/src/Text/BBCode.hs | |||
| @@ -25,7 +25,7 @@ import Data.Function (on) | |||
| 25 | import Control.Applicative | 25 | import Control.Applicative |
| 26 | 26 | ||
| 27 | import Text.BBCode.Lexer (BBToken(..), token) | 27 | import Text.BBCode.Lexer (BBToken(..), token) |
| 28 | import Data.Attoparsec.Text (parseOnly, endOfInput) | 28 | import Data.Attoparsec.Text (parseOnly, endOfInput, endOfLine) |
| 29 | 29 | ||
| 30 | import Data.Tree | 30 | import Data.Tree |
| 31 | import Data.Tree.Zipper (TreePos, Empty, Full) | 31 | import Data.Tree.Zipper (TreePos, Empty, Full) |
| @@ -72,7 +72,7 @@ instance Exception BBCodeError | |||
| 72 | 72 | ||
| 73 | bbcode :: Text -> Either BBCodeError DomForest | 73 | bbcode :: Text -> Either BBCodeError DomForest |
| 74 | -- ^ Parse BBCode | 74 | -- ^ Parse BBCode |
| 75 | bbcode t = fmap dom $ first LexerError (parseOnly (many token <* endOfInput) t) >>= first TreeError . rose | 75 | bbcode t = fmap dom $ first LexerError (parseOnly (many token <* many endOfLine <* endOfInput) t) >>= first TreeError . rose |
| 76 | 76 | ||
| 77 | -- | Errors in input encountered during parsing of lexed token-stream | 77 | -- | Errors in input encountered during parsing of lexed token-stream |
| 78 | data TreeError = MismatchedTags Text Text -- ^ Closing tags label does not match opening tags | 78 | data TreeError = MismatchedTags Text Text -- ^ Closing tags label does not match opening tags |
