liquid-0.1.0.1: Liquid template language library

Safe HaskellNone
LanguageHaskell2010

Text.Liquid.Parser

Synopsis

Documentation

between Source

Arguments

:: Parser b

open tag parser

-> Parser b

close tag parser

-> Parser a

match middle parser

-> Parser a 

Match middle parser, around explicit start and end parsers

stripped :: Parser a -> Parser a Source

Match parser between whitespace

tag :: Parser a -> Parser a Source

Match given parser for a tag

outputTag :: Parser a -> Parser a Source

Match given parser for output block

tagWith Source

Arguments

:: Parser a

initial tag type, e.g. for

-> Parser b

follow on parser, e.g. variable

-> Parser b 

Match given tag name (e.g. for, case) with following parser

mapT :: Parser [Char] -> Parser Text Source

Convert match into text

var :: Parser Text Source

Match variables (without indices, including underscore or hash)

parseBoxedInt :: Parser Int Source

Parse a positive integer within square brackets, e.g. "[123]", NOT "[123.1]"

varIndexSection :: Parser (NonEmpty VarIndex) Source

Parse a variable section with an optional indexing An array index MUST be preceded by an object index ...hence Maybe do comprehension

variable :: Parser Expr Source

Parse a variable

rawBodyTag Source

Arguments

:: Parser Text

start tag matcher

-> Parser Text

end tag matcher

-> Parser Text 

e.g. raw tag, comment tag

rawTag :: Parser Expr Source

Match interior of raw tag

commentTag :: Parser Expr Source

Match interior of comment tag

textPart :: Parser Expr Source

Match any raw text upto a tag/output start or the end of the input

manyTill1 :: Alternative f => f a -> f b -> f [a] Source

Force the first character to be valid, otherwise fail miserably

ordOperator :: Parser (Expr -> Expr -> Expr) Source

Match an Ord comparison operator

ordCombinator :: Parser (Expr -> Expr -> Expr) Source

Match an or, and or contains predicate

quoteString :: Parser Expr Source

Match a quoted string

binaryPredicate :: Parser Expr Source

Match a binary predicate, e.g. a.b >= b.name

truthy :: Parser Expr Source

Parse and evaluate truthiness

predicate :: Parser Expr Source

Match a binary predicate, e.g. a.b >= b.name or barry

predicateClause :: Parser Expr Source

Match any predicate clause

ifClause :: Parser Expr Source

Match an if clause

ifKeyClause :: Parser Expr Source

Match an ifkey clause

elsifClause :: Parser Expr Source

Match an elsif clause

elseClause :: Parser Expr Source

Match an else clause

endIfClause :: Parser Expr Source

Match the end of an if clause

caseClause :: Parser Expr Source

Match a variable condition for a case clause

whenClause :: Parser Expr Source

Match a when clause, part of a case pattern match block

endCaseClause :: Parser Expr Source

Match the end of a case pattern match block

filterName :: Parser Text Source

Match a filter fn name

filterArgs :: Parser [Expr] Source

Match the list of arguments for the filter fn

filterCell :: Parser Expr Source

Match a filter cell, fn and args

typeCheckFilter :: Text -> [Expr] -> Parser Expr Source

Type check the function args and check arity

filterCells :: Parser [Expr] Source

Match multiple filter fns and args

filterBlock :: Parser Expr Source

Match a lhs and a block of filters with their args

output :: Parser Expr Source

Output block, a variable, indexed variable, number or filter block

ifLogic :: Parser Expr Source

If statement, optional elsif or else

caseLogic :: Parser Expr Source

Case pattern match block

block :: Parser Expr Source

Parse any block type

templateParser :: Parser [Expr] Source

Parse an entire template into chunks

parseTemplate :: Text -> IResult Text [Expr] Source

Run the templateParser on input text, force partial results to terminate with Failure