Safe Haskell | None |
---|
Tokenizer for ACE. Tokens retain source locations (line and column).
- tokenize :: Text -> Either String [Token]
- tokenizer :: Parser ([Token], (Int, Int))
- token :: (Int, Int) -> Parser (Token, (Int, Int))
- number :: (Int, Int) -> Parser (Token, (Int, Int))
- quotedString :: (Int, Int) -> Parser (Token, (Int, Int))
- period :: (Int, Int) -> Parser (Token, (Int, Int))
- comma :: (Int, Int) -> Parser (Token, (Int, Int))
- questionMark :: (Int, Int) -> Parser (Token, (Int, Int))
- word :: (Int, Int) -> Parser (Token, (Int, Int))
- genitive :: (Int, Int) -> Parser (Maybe (Token, (Int, Int)))
- manyWithPos :: (Monad m, Alternative m) => ((t, t1) -> m (a, (t, t1))) -> ((t, t1) -> m (Maybe (a, (t, t1)))) -> (t, t1) -> m ([a], (t, t1))
- spaces :: (Int, Int) -> Parser (Int, Int)
Documentation
word :: (Int, Int) -> Parser (Token, (Int, Int))Source
Parse a word, which is any sequence of non-whitespace words containing none of the other token characters.
genitive :: (Int, Int) -> Parser (Maybe (Token, (Int, Int)))Source
Parse the Saxon genitive ' or 's. This is ran after parsing every token, but is expected to fail most of the time.
manyWithPos :: (Monad m, Alternative m) => ((t, t1) -> m (a, (t, t1))) -> ((t, t1) -> m (Maybe (a, (t, t1)))) -> (t, t1) -> m ([a], (t, t1))Source
Like many
, but retains the current source position and supports
postfix-parsing of the genitive apostrophe.