tagsoup-parsec-0.0.7: Tokenizes Tag, so [ Tag ] can be used as parser input.

Text.HTML.TagSoup.Parsec

Synopsis

Documentation

type TagParser str = GenParser (Tag str) ()Source

The Tag parser, using Tag as the token.

type TagParserSt str = GenParser (Tag str)Source

A stateful tag parser This is a new type alias to allow backwards compatibility with old code.

type WholeTag str = (Tag str, [Tag str], Tag str)Source

A type represent the TagOpen, any inner tags , and the TagClose.

tParse :: (StringLike str, Show str) => TagParser str a -> [Tag str] -> aSource

Used to invoke parsing of Tags.

tStParse :: (StringLike str, Show str) => TagParserSt str st a -> st -> [Tag str] -> aSource

Simply run a stateful tag parser

openTag :: (StringLike str, Show str) => str -> TagParserSt str st (Tag str)Source

openTag matches a TagOpen with the given name. It is not case sensitive.

maybeOpenTag :: (StringLike str, Show str) => str -> TagParserSt str st (Maybe (Tag str))Source

maybeOpenTag will return Just the tag if it gets a TagOpen with he given name, It will return Nothing otherwise. It is not case sensitive.

eitherOpenTag :: (StringLike str, Show str) => str -> TagParserSt str st (Either (Tag str) (Tag str))Source

either a Right TagOpen or a Left arbitary tag.

notOpenTag :: (StringLike str, Show str) => str -> TagParserSt str st (Tag str)Source

notOpenTag will match any tag which is not a TagOpen with the given name. It is not case sensitive.

allOpenTags :: (StringLike str, Show str) => str -> TagParserSt str st [Tag str]Source

allOpenTags will return all TagOpen with the given name. It is not case sensitive.

wholeTag :: (StringLike str, Show str) => str -> TagParserSt str st (WholeTag str)Source

wholeTag matches a TagOpen with the given name, then all intervening tags, until it reaches a TagClose with the given name. It is not case sensitive.

maybeWholeTag :: (StringLike str, Show str) => str -> TagParserSt str st (Maybe (WholeTag str))Source

maybeWholeTag will return Just the tag if it gets a WholeTag with he given name, It will return Nothing otherwise. It is not case sensitive.

eitherWholeTag :: (StringLike str, Show str) => str -> TagParserSt str st (Either (Tag str) (WholeTag str))Source

either a Right WholeTag or a Left arbitary tag.

allWholeTags :: (StringLike str, Show str) => str -> TagParserSt str st [WholeTag str]Source

allWholeTags will return all WholeTag with the given name. It is not case sensitive.

closeTag :: (StringLike str, Show str) => str -> TagParserSt str st (Tag str)Source

closeTag matches a TagClose with the given name. It is not case sensitive.

maybeCloseTag :: (StringLike str, Show str) => str -> TagParserSt str st (Maybe (Tag str))Source

maybeCloseTag will return Just the tag if it gets a TagClose with he given name, It will return Nothing otherwise. It is not case sensitive.

eitherCloseTag :: (StringLike str, Show str) => str -> TagParserSt str st (Either (Tag str) (Tag str))Source

either a Right TagClose or a Left arbitary tag.

notCloseTag :: (StringLike str, Show str) => str -> TagParserSt str st (Tag str)Source

notCloseTag will match any tag which is not a TagClose with the given name. It is not case sensitive.

allCloseTags :: (StringLike str, Show str) => str -> TagParserSt str st [Tag str]Source

allCloseTags will return all TagClose with the given name. It is not case sensitive.

maybeP :: Show tok => GenParser tok st a -> GenParser tok st (Maybe a)Source

maybeP takes a parser, and becomes its Maybe equivalent -- returning Just if it matches, and Nothing if it doesn't.

allP :: GenParser tok st (Maybe a) -> GenParser tok st [a]Source

allP takes a parser which returns a Maybe value, and returns a list of matching tokens.

eitherP :: Show tok => GenParser tok st a -> GenParser tok st (Either tok a)Source

eitherP takes a parser, and becomes its Either equivalent -- returning Right if it matches, and Left of anyToken if it doesn't.