jira-wiki-markup-1.2.0: 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.

updateLastSpcPos :: JiraParser () Source #

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

notAfterString :: JiraParser Bool Source #

Returns true when the current parser position is either at the beginning of the document or if the preceding characters did not belong to a string.

afterString :: JiraParser Bool Source #

Returns True if the current parser position is directly after a word/string. Returns False if the parser is looking at the first character of the input.

afterSpace :: JiraParser Bool Source #

Returns True iff the character before the current parser position was a space.

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