aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-05 23:55:38 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-05 23:55:38 +0000
commit4b4060b8ef64da355070ee016235ad3f1d4b1f9f (patch)
treef16da87914ecc7e091bd03a652e48106900df5d3 /src/Text/Pandoc/Shared.hs
parentd5e8ab71a49477db9e887499ed9513c7276ebbad (diff)
downloadpandoc-4b4060b8ef64da355070ee016235ad3f1d4b1f9f.tar.gz
Simplified parsing of reference keys and notes in markdown and RST
readers: + The Reference data structure from Text.Pandoc.Shared is no longer needed, since + referenceKey and noteBlock parses return strings (as many blank lines as are occuried by the key or note) and update state themselves. + getPosition and setPosition are now used to ensure that error messages will give the correct line number. + This yields cleaner (and slightly faster) code, with more accurate parsing error messages. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1012 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 12a2fa102..397e681ea 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -72,10 +72,6 @@ module Text.Pandoc.Shared (
testStringWith,
ParserState (..),
defaultParserState,
- Reference (..),
- isNoteBlock,
- isKeyBlock,
- isLineClump,
HeaderType (..),
ParserContext (..),
QuoteContext (..),
@@ -543,26 +539,6 @@ defaultParserState =
stateColumns = 80,
stateHeaderTable = [] }
--- | References from preliminary parsing.
-data Reference
- = KeyBlock [Inline] Target -- ^ Key for reference-style link (label URL title)
- | NoteBlock String [Block] -- ^ Footnote reference and contents
- | LineClump String -- ^ Raw clump of lines with blanks at end
- deriving (Eq, Read, Show)
-
--- | Auxiliary functions used in preliminary parsing.
-isNoteBlock :: Reference -> Bool
-isNoteBlock (NoteBlock _ _) = True
-isNoteBlock _ = False
-
-isKeyBlock :: Reference -> Bool
-isKeyBlock (KeyBlock _ _) = True
-isKeyBlock _ = False
-
-isLineClump :: Reference -> Bool
-isLineClump (LineClump _) = True
-isLineClump _ = False
-
data HeaderType
= SingleHeader Char -- ^ Single line of characters underneath
| DoubleHeader Char -- ^ Lines of characters above and below