A Parsec parser type that parses
Symbols and keeps track of the
position within the input stream. Unlike Parsec's default position
tracking, this parser keeps track of the range of whitespace between two
- class Symbol s where
- collapse :: Symbol s => (s -> Bool) -> [s] -> [(s, Bounds)]
- type P s = ParsecT [(s, Bounds)] Range
- satisfy :: (Monad m, Symbol s) => (s -> Bool) -> P s m s
- pToken :: (Monad m, Symbol s, Eq s) => s -> P s m s
- getPos :: Monad m => P s m Range
Symbols form input for parsers. Minimal complete definition:
Unparses a symbol, converting it back to text.
Yields the size of a symbol. Default implementation is
length . unparse.
Given a predicate that tells what tokens to discard, keeps only the meaningful tokens and couples them with position information.
A parser that works on symbols coupled with token information. The state maintains the current position in the stream. This position is the range of whitespace between two tokens.
Recognise a symbol matching a predicate.