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.
ConstantParser<R, S>
A parser that returns a constant value.
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.
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.
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'.
LiquidConfig
Configuration for Liquid template parsing.
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 parses 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.
StringIgnoreCaseParser
A parser for a literal string, case-insensitive.
StringParser
A parser for a literal string.
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>
A parser that evaluates a predicate on the successful result of its delegate.

Enums

BlockMode
Represents the execution environment for a code context.
LiteralType
TagDelimiterType
Indicates the delimiter type used by a custom tag parser.

Mixins

AsyncTag
Marker mixin for tags that support async operations
CustomTagParser
Mixin for custom tag parsers.

Extensions

AcceptParser on Parser<R>
Extension on Parser providing acceptance testing.
AndParserExtension on Parser<R>
AsyncVisits on Evaluator
BufferHandling on Evaluator
CastListParserExtension on Parser<R>
CastParserExtension on Parser<R>
Extension on Parser to cast its result type.
ChoiceIterableExtension on Iterable<Parser<R>>
ChoiceParserExtension on Parser
ConstantParserExtension on Parser<R>
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>
Extension on Parser providing match extraction.
NotParserExtension on Parser<R>
OptionalParserExtension on Parser<R>
PatternParserExtension on Parser<R>
Extension on Parser to convert it to a Pattern.
PermuteParserExtension on Parser<List<R>>
PickParserExtension on Parser<List<R>>
PossessiveRepeatingParserExtension on Parser<R>
RecordOfParsersExtension2 on (Parser<R1>, Parser<R2>)
Extension on a Record with 2 positional Parsers.
RecordOfParsersExtension3 on (Parser<R1>, Parser<R2>, Parser<R3>)
Extension on a Record with 3 positional Parsers.
RecordOfParsersExtension4 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>)
Extension on a Record with 4 positional Parsers.
RecordOfParsersExtension5 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>, Parser<R5>)
Extension on a Record with 5 positional Parsers.
RecordOfParsersExtension6 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>, Parser<R5>, Parser<R6>)
Extension on a Record with 6 positional Parsers.
RecordOfParsersExtension7 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>, Parser<R5>, Parser<R6>, Parser<R7>)
Extension on a Record with 7 positional Parsers.
RecordOfParsersExtension8 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>, Parser<R5>, Parser<R6>, Parser<R7>, Parser<R8>)
Extension on a Record with 8 positional Parsers.
RecordOfParsersExtension9 on (Parser<R1>, Parser<R2>, Parser<R3>, Parser<R4>, Parser<R5>, Parser<R6>, Parser<R7>, Parser<R8>, Parser<R9>)
Extension on a Record with 9 positional Parsers.
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<R1>
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
arithmeticExpr() → Parser
Arithmetic expression: term (arithmeticOp term)? Note: Single operation only for now (no chaining like a + b + c)
arithmeticExpression() → Parser
arithmeticOperator() → Parser
Arithmetic operator parser. Note: .trim() removed from individual operators since primaryTerm().trim() handles surrounding whitespace in arithmeticExpr().
arrayAccess() → Parser
assignment() → Parser
@Deprecated: This parser is no longer used. Assignment is now handled by the expression() parser through _assignmentExpr(). Kept for backwards compatibility.
assignmentExpr() → Parser
Assignment expression: identifier = expression
booleanLiteral() → Parser<Literal>
breakTag([LiquidConfig? config]) → Parser<Tag>
Break tag parser - parses {% break %}. If config is provided, uses custom delimiters.
caseBlock() → Parser
caseTag([LiquidConfig? config]) → Parser<Tag>
Case tag parser - parses {% case variable %}. If config is provided, uses custom delimiters.
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
comparisonExpr() → Parser
Comparison expression: arithmetic (comparisonOp arithmetic)? Note: Single comparison only (no chaining like a == b == c)
comparisonOperator() → Parser
comparisonOrExpression() → Parser
continueTag([LiquidConfig? config]) → Parser<Tag>
Continue tag parser - parses {% continue %}. If config is provided, uses custom delimiters.
createTagEnd([LiquidConfig? config]) → Parser
Creates a tag end delimiter parser with optional custom config.
createTagStart([LiquidConfig? config]) → Parser
Creates a tag start delimiter parser with optional custom config.
createVarEnd([LiquidConfig? config]) → Parser
Creates a variable end delimiter parser with optional custom config.
createVarStart([LiquidConfig? config]) → Parser
Creates a variable start delimiter parser with optional custom config.
defaultFactory_<R>(String? message) → FailureFactory<R>
Creates a default FailureFactory with an optional error message.
digit({String message = 'digit expected'}) → Parser<String>
Returns a parser that accepts any digit character.
document() → Parser<Document>
element() → Parser
Optimized element parser using lookahead to avoid unnecessary backtracking.
elseBlock() → Parser
elseBlockForCase() → Parser
elseBlockForFor() → Parser
elseBranchContent() → Parser
elseIfBlock() → Parser
elseTag([LiquidConfig? config]) → Parser<Tag>
Else tag parser - parses {% else %}. If config is provided, uses custom delimiters.
elsifBranchContent() → Parser
elsifTag([LiquidConfig? config]) → Parser
Elsif tag parser - parses {% elsif condition %}. If config is provided, uses custom delimiters.
emptyLiteral() → Parser
endCaseTag([LiquidConfig? config]) → Parser
End case tag parser - parses {% endcase %}. If config is provided, uses custom delimiters.
endForTag([LiquidConfig? config]) → Parser
End for tag parser - parses {% endfor %}. If config is provided, uses custom delimiters.
endIfTag([LiquidConfig? config]) → Parser
End if tag parser - parses {% endif %}. If config is provided, uses custom delimiters.
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
Optimized expression parser with proper precedence handling.
expressionWithAssignment() → Parser
Top-level expression handling assignment and named arguments. These are special because they require an identifier on the left.
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([LiquidConfig? config]) → Parser
For tag parser - parses {% for item in collection %}. If config is provided, uses custom delimiters.
groupedExpression() → Parser
hashBlockComment([LiquidConfig? config]) → Parser
Hash block comment parser - parses {# comment #} syntax.
identifier() → Parser
@Deprecated: These old parsers are no longer used by expression(). The new expression() uses a precedence-based approach via _logicalExpr, _comparisonExpr, _arithmeticExpr, and primaryTerm. Kept for backwards compatibility and testing. Identifier parser - matches variable names, function names, etc.
ifBlock() → Parser
ifBranchContent() → Parser
ifTag([LiquidConfig? config]) → Parser
If tag parser - parses {% if condition %}. If config is provided, uses custom delimiters.
letter({String message = 'letter expected'}) → Parser<String>
Returns a parser that accepts any letter character (lowercase or uppercase).
literal() → Parser
logicalExpr() → Parser
Logical expression: comparison (and|or comparison)* Lowest precedence binary operator.
logicalExpression() → Parser
logicalOperator() → Parser
lowercase({String message = 'lowercase letter expected'}) → Parser<String>
Returns a parser that accepts any lowercase character.
memberAccess() → Parser
Member access parser - handles dot notation like product.name.first.
namedArgExpr() → Parser
Named argument expression: identifier: expression
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, {LiquidConfig? config, 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.
primaryTerm() → Parser
Primary term parser - parses the basic building blocks of expressions.
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>
Creates a Parser from a function reference with 1 argument.
ref2<R, A1, A2>(Parser<R> function(A1, A2), A1 arg1, A2 arg2) → Parser<R>
Creates a Parser from a function reference with 2 arguments.
ref3<R, A1, A2, A3>(Parser<R> function(A1, A2, A3), A1 arg1, A2 arg2, A3 arg3) → Parser<R>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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>
Creates a Parser from a function reference 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.
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 arguments 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 arguments 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 arguments 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 arguments 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 arguments 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 arguments 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 arguments 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 arguments in sequence and returns a Record with the 9 positional parse results.
someTag(String name, {LiquidConfig? config, Parser? start, Parser? end, Parser? content, Parser? filters, bool hasContent = true}) → Parser<Tag>
Creates a tag parser for a named tag with optional custom delimiters.
string(String string, {String? message, bool ignoreCase = false}) → Parser<String>
Returns a parser that accepts the string.
stringLiteral() → Parser<Literal>
tag([LiquidConfig? config]) → Parser
Generic tag parser - parses {% tagname content %} syntax.
tagContent() → Parser
tagEnd([LiquidConfig? config]) → Parser
Tag end delimiter. The -%} variant strips following whitespace (via .trim()).
tagStart([LiquidConfig? config]) → Parser
Tag start delimiter. The {%- variant strips preceding whitespace (via .trim()).
text([LiquidConfig? config]) → Parser
Text parser - parses plain text content until a delimiter is encountered.
unaryOperand() → Parser
Operand for unary operations - can be a full expression (minus unary itself to avoid left-recursion).
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.
varEnd([LiquidConfig? config]) → Parser
Variable end delimiter. The whitespace-stripping variant -}} is handled semantically at evaluation time, not by the parser consuming whitespace.
variable([LiquidConfig? config]) → Parser
Variable parser - parses {{ expression | filter }} syntax.
varStart([LiquidConfig? config]) → Parser
Variable start delimiter. The whitespace-stripping variant {{- is handled semantically at evaluation time, not by the parser consuming whitespace.
whenBlock() → Parser
whenTag([LiquidConfig? config]) → Parser<Tag>
When tag parser - parses {% when value %}. If config is provided, uses custom delimiters.
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).

Typedefs

ContinuationFunction<R> = Result<R> Function(Context context)
Continuation function of the ContinuationHandler.
ContinuationHandler<R, S> = Result<S> Function(ContinuationFunction<R> continuation, Context context)
Handler function for the ContinuationParser.
FailureFactory<R> = Result<R> Function(Context context, Success<R> success)
FailureJoiner = Failure Function(Failure first, Failure second)
Function definition that joins parse Failure instances.
TagCreator = dynamic Function(List<ASTNode>, List<Filter>)

Exceptions / Errors

ParserException
An exception raised in case of a parse error.
ParsingException
Represents an exception that occurred during parsing.