jira-wiki-markup-1.1.1: Handle Jira wiki markup

Copyright© 2019–2020 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@zeitkraut.de>
Stabilityalpha
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Text.Jira.Parser.Core

Contents

Description

Core components of the Jira wiki markup parser.

Synopsis

Jira parser and state

type JiraParser = Parsec Text ParserState Source #

Jira Parsec parser

data ParserState Source #

Parser state used to keep track of various parameteres.

Constructors

ParserState 

Fields

defaultState :: ParserState Source #

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

parseJira :: JiraParser a -> Text -> Either ParseError a Source #

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

updateLastStrPos :: JiraParser () Source #

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

notAfterString :: JiraParser Bool Source #

Checks whether the parser is directly after a string.

Parsing helpers

endOfPara :: JiraParser () Source #

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).

blankline :: JiraParser () Source #

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

skipSpaces :: JiraParser () Source #

Skip zero or more space chars.

parameters :: JiraParser (Maybe Text, [Parameter]) Source #

Parses a set of panel parameters