@@ -38,7 +38,7 @@ TODO:
3838module Text.Pandoc.Readers.LaTeX ( readLaTeX,
3939 rawLaTeXInline,
4040 rawLaTeXBlock,
41− inlineCommand,
41+ inlineCommand
4242 ) where
4343
4444import Control.Applicative (many, optional, (<|>))
@@ -66,6 +66,8 @@ import Text.Pandoc.Parsing hiding (many, optional, withRaw,
6666 mathInline, mathDisplay, macro,
6767 space, (<|>), spaces, blankline)
6868import Text.Pandoc.Shared
69+import Text.Pandoc.Readers.LaTeX.Types (Macro(..), Tok(..),
70+ TokType(..), Line, Column)
6971import Text.Pandoc.Walk
7072import Text.Pandoc.Error (PandocError(PandocParsecError, PandocMacroLoop))
7173
@@ -113,9 +115,6 @@ testParser p t = do
113115 Left e -> error (show e)
114116 Right r -> return r
115117
116−data Macro = Macro Int (Maybe [Tok]) [Tok]
117− deriving Show
118−
119118data LaTeXState = LaTeXState{ sOptions :: ReaderOptions
120119 , sMeta :: Meta
121120 , sQuoteContext :: QuoteContext
@@ -228,13 +227,6 @@ rawLaTeXInline = mzero
228227inlineCommand :: PandocMonad m => ParserT String ParserState m Inlines
229228inlineCommand = mzero
230229
231−data TokType = CtrlSeq Text | Spaces | Newline | Symbol | Word | Comment |
232− Esc1 | Esc2 | Arg Int
233− deriving (Eq, Ord, Show)
234−
235−data Tok = Tok (Line, Column) TokType Text
236− deriving (Eq, Ord, Show)
237−
238230tokenize :: Text -> [Tok]
239231tokenize = totoks (1, 1)
240232