parser
library
Classes
AbstractTag
Abstract base class for all Liquid tags.
AndParser <R >
The and-predicate, a parser that succeeds whenever its delegate does, but
does not consume the input stream.
AnySingleCharacterParser
Optimized version of SingleCharacterParser that parses any 16-bit UTF-16
character (including possible surrogate pairs).
AnyUnicodeCharacterParser
Optimized version of UnicodeCharacterParser that parses any Unicode
character (including possible surrogate pairs).
ArrayAccess
Assignment
ASTNode
BinaryOperation
Buffer
CastListParser <R , S >
A parser that casts a Result<List>
to a Result<List<S>>
.
CastParser <R , S >
A parser that casts a Result
to a Result<R>
.
CharacterParser
Parser class for an individual character satisfying a CharacterPredicate .
CharacterPredicate
Abstract class for character predicates.
ChoiceParser <R >
A parser that uses the first parser that succeeds.
Context
An immutable parse context.
ContinuationParser <R , S >
Continuation parser that when activated captures a continuation function
and passes it together with the current context into the handler.
DelegateParser <T , R >
An abstract parser that delegates to a parser of type T
and returns a
result of type R
.
Document
Empty
EndOfInputParser
A parser that succeeds at the end of input.
Environment
EpsilonParser <R >
A parser that consumes nothing and succeeds.
Evaluator
Evaluates Liquid templates by traversing and executing AST nodes.
ExpressionBuilder <T >
A builder that allows the simple definition of expression grammars with
prefix, postfix, and left- and right-associative infix operators.
ExpressionGroup <T >
Models a group of operators of the same precedence.
Failure
An immutable failed parse result.
FailureParser
A parser that consumes nothing and fails.
Filter
FilteredExpression
FlattenParser
A parser that discards the result of the delegate and answers the
sub-string its delegate consumes.
GrammarDefinition <R >
Helper to conveniently define and build complex, recursive grammars using
plain Dart code.
GreedyRepeatingParser <R >
A greedy repeating parser, commonly seen in regular expression
implementations. It aggressively consumes as much input as possible and then
backtracks to meet the 'limit' condition.
GroupedExpression
Identifier
LabeledParser <R >
Interface of a parser that has a debug label.
LabelParser <R >
A parser that always defers to its delegate, but that also holds a label
for debugging purposes.
LazyRepeatingParser <R >
A lazy repeating parser, commonly seen in regular expression
implementations. It limits its consumption to meet the 'limit' condition as
early as possible.
LimitedRepeatingParser <R >
An abstract parser that repeatedly parses between 'min' and 'max' instances
of its delegate and that requires the input to be completed with a specified
parser 'limit'. Subclasses provide repeating behavior as typically seen in
regular expression implementations (non-blind).
ListParser <R , S >
Abstract parser that parses a list of things in some way.
Literal
MapParser <R , S >
A parser that performs a transformation with a given function on the
successful parse result of the delegate.
MemberAccess
NamedArgument
NewlineParser
A parser that consumes newlines platform independently.
NotParser <R >
The not-predicate, a parser that succeeds whenever its delegate does not,
but consumes no input.
OptionalParser <R >
A parser that optionally parsers its delegate, or answers null
.
Parser <R >
Abstract base class of all parsers that produce a parse result of type R
.
PatternParser
A parser that uses a Pattern matcher for parsing.
PermuteParser <R >
A parser that performs a transformation with a given function on the
successful parse result of the delegate.
PickParser <R >
A parser that performs a transformation with a given function on the
successful parse result of the delegate.
PositionParser
A parser that reports the current input position.
PossessiveRepeatingParser <R >
A greedy parser that repeatedly parses between 'min' and 'max' instances of
its delegate.
PredicateParser
A parser for a literal satisfying a predicate.
RepeatingCharacterParser
An abstract parser that repeatedly parses between 'min' and 'max' instances
of its delegate.
RepeatingParser <T , R >
An abstract parser that repeatedly parses between 'min' and 'max' instances
of its delegate.
ResolvableParser <R >
Interface of a parser that can be resolved to another one.
Result <R >
An immutable parse result that is either a Success or a Failure .
SeparatedList <R , S >
A list of elements and its separators .
SeparatedRepeatingParser <R , S >
A parser that consumes the delegate between min and max times
separated by the separator parser.
SequenceParser <R >
A parser that parses a sequence of parsers.
SequenceParser2 <R1 , R2 >
A parser that consumes a sequence of 2 parsers and returns a Record with
2 positional parse results.
SequenceParser3 <R1 , R2 , R3 >
A parser that consumes a sequence of 3 parsers and returns a Record with
3 positional parse results.
SequenceParser4 <R1 , R2 , R3 , R4 >
A parser that consumes a sequence of 4 parsers and returns a Record with
4 positional parse results.
SequenceParser5 <R1 , R2 , R3 , R4 , R5 >
A parser that consumes a sequence of 5 parsers and returns a Record with
5 positional parse results.
SequenceParser6 <R1 , R2 , R3 , R4 , R5 , R6 >
A parser that consumes a sequence of 6 parsers and returns a Record with
6 positional parse results.
SequenceParser7 <R1 , R2 , R3 , R4 , R5 , R6 , R7 >
A parser that consumes a sequence of 7 parsers and returns a Record with
7 positional parse results.
SequenceParser8 <R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 >
A parser that consumes a sequence of 8 parsers and returns a Record with
8 positional parse results.
SequenceParser9 <R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 , R9 >
A parser that consumes a sequence of 9 parsers and returns a Record with
9 positional parse results.
SettableParser <R >
A parser that is not defined, but that can be set at a later
point in time.
SingleCharacterParser
Parser class for an individual 16-bit UTF-16 code units satisfying a
specified CharacterPredicate .
SkipParser <R >
A parser that silently consumes input of another parser before and after
its delegate.
Success <R >
An immutable successful parse result.
Tag
TagRegistry
TagRegistry is responsible for managing and creating Liquid template tags.
TextNode
Token <R >
A token represents a parsed part of the input stream.
TokenParser <R >
A parser that creates a token of the result its delegate parses.
TrimmingParser <R >
A parser that silently consumes input of another parser around
its delegate.
UnaryOperation
UnicodeCharacterParser
Parser class for an individual Unicode code-point (including possible
surrogate pairs) satisfying a specified CharacterPredicate .
Variable
WhereParser <R >
Extensions
AcceptParser
on Parser <R >
AndParserExtension
on Parser <R >
AsyncVisits
on Evaluator
BufferHandling
on Evaluator
CastListParserExtension
on Parser <R >
CastParserExtension
on Parser <R >
ChoiceIterableExtension
on Iterable <Parser <R > >
ChoiceParserExtension
on Parser
ContinuationParserExtension
on Parser <R >
EndOfInputParserExtension
on Parser <R >
Evaluation
on Evaluator
FlattenParserExtension
on Parser
GreedyRepeatingParserExtension
on Parser <R >
LabelParserExtension
on Parser <R >
LazyRepeatingParserExtension
on Parser <R >
MapParserExtension
on Parser <R >
MatchesParserExtension
on Parser <T >
NotParserExtension
on Parser <R >
OptionalParserExtension
on Parser <R >
PatternParserExtension
on Parser <R >
PermuteParserExtension
on Parser <List <R > >
PickParserExtension
on Parser <List <R > >
PossessiveRepeatingParserExtension
on Parser <R >
RecordOfParsersExtension2
on (Parser <R1 > , Parser <R2 > )
Extensions on a Record with 2 positional Parser s.
RecordOfParsersExtension3
on (Parser <R1 > , Parser <R2 > , Parser <R3 > )
Extensions on a Record with 3 positional Parser s.
RecordOfParsersExtension4
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > )
Extensions on a Record with 4 positional Parser s.
RecordOfParsersExtension5
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > , Parser <R5 > )
Extensions on a Record with 5 positional Parser s.
RecordOfParsersExtension6
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > , Parser <R5 > , Parser <R6 > )
Extensions on a Record with 6 positional Parser s.
RecordOfParsersExtension7
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > , Parser <R5 > , Parser <R6 > , Parser <R7 > )
Extensions on a Record with 7 positional Parser s.
RecordOfParsersExtension8
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > , Parser <R5 > , Parser <R6 > , Parser <R7 > , Parser <R8 > )
Extensions on a Record with 8 positional Parser s.
RecordOfParsersExtension9
on (Parser <R1 > , Parser <R2 > , Parser <R3 > , Parser <R4 > , Parser <R5 > , Parser <R6 > , Parser <R7 > , Parser <R8 > , Parser <R9 > )
Extensions on a Record with 9 positional Parser s.
RecordOfValuesExtension2
on (T1 , T2 )
Extension on a Record with 2 positional values.
RecordOfValuesExtension3
on (T1 , T2 , T3 )
Extension on a Record with 3 positional values.
RecordOfValuesExtension4
on (T1 , T2 , T3 , T4 )
Extension on a Record with 4 positional values.
RecordOfValuesExtension5
on (T1 , T2 , T3 , T4 , T5 )
Extension on a Record with 5 positional values.
RecordOfValuesExtension6
on (T1 , T2 , T3 , T4 , T5 , T6 )
Extension on a Record with 6 positional values.
RecordOfValuesExtension7
on (T1 , T2 , T3 , T4 , T5 , T6 , T7 )
Extension on a Record with 7 positional values.
RecordOfValuesExtension8
on (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 )
Extension on a Record with 8 positional values.
RecordOfValuesExtension9
on (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 )
Extension on a Record with 9 positional values.
RecordParserExtension2
on Parser <(T1 , T2 ) >
Extension on a Parser producing a Record of 2 positional values.
RecordParserExtension3
on Parser <(T1 , T2 , T3 ) >
Extension on a Parser producing a Record of 3 positional values.
RecordParserExtension4
on Parser <(T1 , T2 , T3 , T4 ) >
Extension on a Parser producing a Record of 4 positional values.
RecordParserExtension5
on Parser <(T1 , T2 , T3 , T4 , T5 ) >
Extension on a Parser producing a Record of 5 positional values.
RecordParserExtension6
on Parser <(T1 , T2 , T3 , T4 , T5 , T6 ) >
Extension on a Parser producing a Record of 6 positional values.
RecordParserExtension7
on Parser <(T1 , T2 , T3 , T4 , T5 , T6 , T7 ) >
Extension on a Parser producing a Record of 7 positional values.
RecordParserExtension8
on Parser <(T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) >
Extension on a Parser producing a Record of 8 positional values.
RecordParserExtension9
on Parser <(T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) >
Extension on a Parser producing a Record of 9 positional values.
RepeatingCharacterParserExtension
on Parser <String >
SeparatedRepeatingParserExtension
on Parser <R >
SequenceIterableExtension
on Iterable <Parser <R > >
SequenceParserExtension
on Parser
SettableParserExtension
on Parser <R >
SkipParserExtension
on Parser <R >
TokenParserExtension
on Parser <R >
ToParserStringExtension
on String
TrimmingParserExtension
on Parser <R >
WhereParserExtension
on Parser <R >
Constants
unbounded
→ const int
An int used to mark an unbounded maximum repetition.
Functions
any ({String message = 'input expected' , bool unicode = false })
→ Parser <String >
Returns a parser that accepts any character.
anyOf (String value , {String ? message , bool ignoreCase = false , bool unicode = false })
→ Parser <String >
Returns a parser that accepts any of the specified characters in value
.
argument ()
→ Parser
arithmeticExpression ()
→ Parser
arrayAccess ()
→ Parser
assignment ()
→ Parser
booleanLiteral ()
→ Parser <Literal >
breakTag ()
→ Parser <Tag >
caseBlock ()
→ Parser
caseTag ()
→ Parser <Tag >
char (String value , {String ? message , bool ignoreCase = false , bool unicode = false })
→ Parser <String >
Returns a parser that accepts a specific character value
.
collapseTextNodes (List <ASTNode > elements )
→ List <ASTNode >
comparison ()
→ Parser
comparisonOperator ()
→ Parser
comparisonOrExpression ()
→ Parser
continueTag ()
→ Parser <Tag >
defaultFactory_ <R > (String ? message )
→ FailureFactory <R >
digit ({String message = 'digit expected' })
→ Parser <String >
Returns a parser that accepts any digit character. The accepted input is
equivalent to the character-set 0-9
.
document ()
→ Parser <Document >
element ()
→ Parser
elseBlock ()
→ Parser
elseBlockForCase ()
→ Parser
elseBlockForFor ()
→ Parser
elseBranchContent ()
→ Parser
elseIfBlock ()
→ Parser
elseTag ()
→ Parser <Tag >
elsifBranchContent ()
→ Parser
elsifTag ()
→ Parser
emptyLiteral ()
→ Parser
endCaseTag ()
→ Parser
endForTag ()
→ Parser
endIfTag ()
→ Parser
endOfInput ({String message = 'end of input expected' })
→ Parser <void >
Returns a parser that succeeds at the end of input.
epsilon ()
→ Parser <void >
Returns a parser that consumes nothing and succeeds.
epsilonWith <R > (R result )
→ Parser <R >
Returns a parser that consumes nothing and succeeds with result
.
expression ()
→ Parser
failure <R > ({String message = 'unable to parse' })
→ Parser <R >
Returns a parser that consumes nothing and fails.
filter ()
→ Parser
filterArguments ()
→ Parser
forBlock ()
→ Parser
forElseBranchContent ()
→ Parser
forTag ()
→ Parser
groupedExpression ()
→ Parser
identifier ()
→ Parser
ifBlock ()
→ Parser
ifBranchContent ()
→ Parser
ifTag ()
→ Parser
letter ({String message = 'letter expected' })
→ Parser <String >
Returns a parser that accepts any letter character (lowercase or uppercase).
The accepted input is equivalent to the character-set a-zA-Z
.
literal ()
→ Parser
logicalExpression ()
→ Parser
logicalOperator ()
→ Parser
lowercase ({String message = 'lowercase letter expected' })
→ Parser <String >
Returns a parser that accepts any lowercase character. The accepted input is
equivalent to the character-set a-z
.
memberAccess ()
→ Parser
namedArgument ()
→ Parser
newline ({String message = 'newline expected' })
→ Parser <String >
Returns a parser that detects newlines platform independently.
nilLiteral ()
→ Parser <Literal >
noneOf (String value , {String ? message , bool ignoreCase = false , bool unicode = false })
→ Parser <String >
Returns a parser that accepts none of the specified characters in value
.
numericLiteral ()
→ Parser
parseInput (String input , {bool enableTrace = false , bool shouldLint = false })
→ List <ASTNode >
Parses the given input string and returns a list of ASTNode objects representing the parsed document.
pattern (String pattern , {String ? message , bool ignoreCase = false , bool unicode = false })
→ Parser <String >
Returns a parser that accepts a single character of a given character set
pattern
provided as a string.
position ()
→ Parser
Returns a parser that reports the current input position.
predicate (int length , Predicate<String > predicate , String message )
→ Parser <String >
Returns a parser that reads input of the specified length
, accepts
it if the predicate
matches, or fails with the given message
.
range ()
→ Parser
ref <R > (Function function , [dynamic arg1 = undefined , dynamic arg2 = undefined , dynamic arg3 = undefined , dynamic arg4 = undefined , dynamic arg5 = undefined , dynamic arg6 = undefined , dynamic arg7 = undefined , dynamic arg8 = undefined , dynamic arg9 = undefined ])
→ Parser <R >
Creates a Parser from a function
reference, possibly with the given
arguments arg1
, arg2
, arg3
, ...
ref0 <R > (Parser <R > function () )
→ Parser <R >
Creates a Parser from a function
without arguments.
ref1 <R , A1 > (Parser <R > function (A1 ), A1 arg1 )
→ Parser <R >
Reference to a production function
parametrized with 1 argument.
ref2 <R , A1 , A2 > (Parser <R > function (A1 , A2 ), A1 arg1 , A2 arg2 )
→ Parser <R >
Reference to a production function
parametrized with 2 arguments.
ref3 <R , A1 , A2 , A3 > (Parser <R > function (A1 , A2 , A3 ), A1 arg1 , A2 arg2 , A3 arg3 )
→ Parser <R >
Reference to a production function
parametrized with 3 arguments.
ref4 <R , A1 , A2 , A3 , A4 > (Parser <R > function (A1 , A2 , A3 , A4 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 )
→ Parser <R >
Reference to a production function
parametrized with 4 arguments.
ref5 <R , A1 , A2 , A3 , A4 , A5 > (Parser <R > function (A1 , A2 , A3 , A4 , A5 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 , A5 arg5 )
→ Parser <R >
Reference to a production function
parametrized with 5 arguments.
ref6 <R , A1 , A2 , A3 , A4 , A5 , A6 > (Parser <R > function (A1 , A2 , A3 , A4 , A5 , A6 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 , A5 arg5 , A6 arg6 )
→ Parser <R >
Reference to a production function
parametrized with 6 arguments.
ref7 <R , A1 , A2 , A3 , A4 , A5 , A6 , A7 > (Parser <R > function (A1 , A2 , A3 , A4 , A5 , A6 , A7 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 , A5 arg5 , A6 arg6 , A7 arg7 )
→ Parser <R >
Reference to a production function
parametrized with 7 arguments.
ref8 <R , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 > (Parser <R > function (A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 , A5 arg5 , A6 arg6 , A7 arg7 , A8 arg8 )
→ Parser <R >
Reference to a production function
parametrized with 8 arguments.
ref9 <R , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 > (Parser <R > function (A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9 ), A1 arg1 , A2 arg2 , A3 arg3 , A4 arg4 , A5 arg5 , A6 arg6 , A7 arg7 , A8 arg8 , A9 arg9 )
→ Parser <R >
Reference to a production function
parametrized with 9 arguments.
registerBuiltInTags ()
→ void
Registers all built-in Liquid tags.
resolve <R > (Parser <R > parser )
→ Parser <R >
Resolves all parser references reachable through parser
. Returns an
optimized parser graph that inlines all references directly.
selectFarthest (Failure first , Failure second )
→ Failure
Reports the parser failure farthest down in the input string, preferring
later failures over earlier ones.
selectFarthestJoined (Failure first , Failure second )
→ Failure
Reports the parser failure farthest down in the input string, joining
error messages at the same position.
selectFirst (Failure first , Failure second )
→ Failure
Reports the first parse failure observed.
selectLast (Failure first , Failure second )
→ Failure
Reports the last parse failure observed (default).
seq2 <R1 , R2 > (Parser <R1 > parser1 , Parser <R2 > parser2 )
→ Parser <(R1 , R2 ) >
Creates a Parser that consumes the 2 parsers passed as argument in
sequence and returns a Record with the 2 positional parse results.
seq3 <R1 , R2 , R3 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 )
→ Parser <(R1 , R2 , R3 ) >
Creates a Parser that consumes the 3 parsers passed as argument in
sequence and returns a Record with the 3 positional parse results.
seq4 <R1 , R2 , R3 , R4 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 )
→ Parser <(R1 , R2 , R3 , R4 ) >
Creates a Parser that consumes the 4 parsers passed as argument in
sequence and returns a Record with the 4 positional parse results.
seq5 <R1 , R2 , R3 , R4 , R5 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 , Parser <R5 > parser5 )
→ Parser <(R1 , R2 , R3 , R4 , R5 ) >
Creates a Parser that consumes the 5 parsers passed as argument in
sequence and returns a Record with the 5 positional parse results.
seq6 <R1 , R2 , R3 , R4 , R5 , R6 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 , Parser <R5 > parser5 , Parser <R6 > parser6 )
→ Parser <(R1 , R2 , R3 , R4 , R5 , R6 ) >
Creates a Parser that consumes the 6 parsers passed as argument in
sequence and returns a Record with the 6 positional parse results.
seq7 <R1 , R2 , R3 , R4 , R5 , R6 , R7 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 , Parser <R5 > parser5 , Parser <R6 > parser6 , Parser <R7 > parser7 )
→ Parser <(R1 , R2 , R3 , R4 , R5 , R6 , R7 ) >
Creates a Parser that consumes the 7 parsers passed as argument in
sequence and returns a Record with the 7 positional parse results.
seq8 <R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 , Parser <R5 > parser5 , Parser <R6 > parser6 , Parser <R7 > parser7 , Parser <R8 > parser8 )
→ Parser <(R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 ) >
Creates a Parser that consumes the 8 parsers passed as argument in
sequence and returns a Record with the 8 positional parse results.
seq9 <R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 , R9 > (Parser <R1 > parser1 , Parser <R2 > parser2 , Parser <R3 > parser3 , Parser <R4 > parser4 , Parser <R5 > parser5 , Parser <R6 > parser6 , Parser <R7 > parser7 , Parser <R8 > parser8 , Parser <R9 > parser9 )
→ Parser <(R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 , R9 ) >
Creates a Parser that consumes the 9 parsers passed as argument in
sequence and returns a Record with the 9 positional parse results.
someTag (String name , {Parser ? start , Parser ? end , Parser ? content , Parser ? filters , bool hasContent = true })
→ Parser <Tag >
string (String string , {String ? message , bool ignoreCase = false })
→ Parser <String >
Returns a parser that accepts the string
.
stringLiteral ()
→ Parser <Literal >
tag ()
→ Parser
tagContent ()
→ Parser
tagEnd ()
→ Parser
tagStart ()
→ Parser
text ()
→ Parser
unaryOperation ()
→ Parser
unaryOperator ()
→ Parser
undefined <R > ({String message = 'undefined parser' })
→ SettableParser <R >
Returns a parser that is not defined, but that can be set at a later
point in time.
uppercase ({String message = 'uppercase letter expected' })
→ Parser <String >
Returns a parser that accepts any uppercase character. The accepted input is
equivalent to the character-set A-Z
.
varEnd ()
→ Parser
variable ()
→ Parser
varStart ()
→ Parser
whenBlock ()
→ Parser
whenTag ()
→ Parser <Tag >
whitespace ({String message = 'whitespace expected' })
→ Parser <String >
Returns a parser that accepts any whitespace character.
word ({String message = 'letter or digit expected' })
→ Parser <String >
Returns a parser that accepts any word character (lowercase, uppercase,
underscore, or digit). The accepted input is equivalent to the character-set
a-zA-Z_0-9
.