jira-wiki-markup-0.1.1: Handle Jira wiki markup

Text.Jira.Parser.Core

Description

Core components of the Jira wiki markup parser.

Synopsis

# Jira parser and state

Jira Parsec parser

Parser state used to keep track of various parameteres.

Constructors

 ParserState FieldsstateInLink :: Boolwhether the parser is within a linkstateInList :: Boolwhether the parser is within a liststateInTable :: Boolwhether the parser is within a tablestateLastStrPos :: Maybe SourcePosposition at which the last string ended

Default parser state (i.e., start state)

Parses a string with the given Jira parser.

withStateFlag :: (Bool -> ParserState -> ParserState) -> JiraParser a -> JiraParser a Source #

Set a flag in the parser to True before running a parser, then set the flag's value to False.

# String position tracking

Updates the state, marking the current input position as the end of a string.

Checks whether the parser is directly after a string.

# Parsing helpers

Succeeds if the parser is looking at the end of a paragraph.

notFollowedBy' :: Show a => JiraParser a -> JiraParser () Source #

Variant of parsec's notFollowedBy function which properly fails even if the given parser does not consume any input (like eof does).

Parses an empty line, i.e., a line with no chars or whitespace only.

Skip zero or more space chars.