NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #24 most downloaded on pub.dev
Build fast, composable, and type-safe grammars and parsers in Dart.
Last release 11 days ago
27 Sep 2026
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 43 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
93 releases · first in 2012
…helper with automatic state rollback on failure, deprecate Indent.increase and Indent.decrease, and remove @experimental.
.then to fluently construct strongly typed sequences.StringParser and StringIgnoreCaseParser.Indent parser): add Indent.during helper with automatic state rollback on failure, deprecate Indent.increase and Indent.decrease, and remove @experimental.ConstantCharPredicate.any.Ready for PetitParser 7.0.2
One column per quarter.
Ready for PetitParser 7.0.2
Parser.constant(Object value) that can be used to return a constant value.Update CHANGELOG.md for 7.0.1
Update CHANGELOG.md for 7.0.1
Removal of long deprecated code.
message: to customize the default error message;ignoreCase: to accept lower- and upper-case variations; andunicode: to decode surrogate pairs and instead of UTF-16 only.Parser.flatten({String message}), Parser.not({String message}), Parser.neg({String message}), Parser.end({String message}), Parser.starString([String? message]), Parser.plusString({String? message}), Parser.timesString(int count, {String? message}), Parser.repeatString(int min, int max, {String? message}), failure({String message}), newline({String message}), undefined({String message}) (breaking-change).replaceAll is now also supported in dart2js
replaceAll is now also supported in dart2js
loopback variable in the expression builder public (thanks to joranmulderij).Nothing published for this version
Relax SDK constraint, ready for 6.0.1
Relax SDK constraint, ready for 6.0.1
And extension methods to emulate the old Sequence classes, deprecate old accessors.
(char('a'), char('b')).toSequenceParser()Sequence classes, deprecate old accessors.Result a sealed class to be able to pattern match Success and Failure.
Failure, which is of type Result<Never> now.isSuccess and isFailure, instead use the more efficient is Success and is Failure operators.hasSideEffect in MapParser and consider callbacks to be side-effect free by default.Fix linter rule for UnnecessaryFlatten
Fix linter rule for UnnecessaryFlatten
starString, plusString, timesString and repeatString for extra fast reading of strings.AnyParser to AnyCharacterParser, and CharacterParser to SingleCharacterParser for consistency.ExpressionBuilder.optimize to in-place optimize parser graphs.Maintenance release deprecating some old code in anticipation of the upcoming major release.
ExpressionBuilder.GrammarDefinition.build(Function, List<Object?>), use buildFrom(Parser) for a strongly typed parser instead.Add @useResult to parser constructors to avoid bugs when using the old parser instance.
@useResult to parser constructors to avoid bugs when using the old parser instance.…with the strongly typed elements and separators. Deprecate the dynamically typed Parser.separatedBy.
seq2, seq3, ... combinator functions returning strongly typed sequences of Sequence2<R1, R2>, Sequence3<R1, R2, R3>, ...Parser.starSeparated, Parser.plusSeparated, Parser.timesSeparated, and Parser.repeatSeparated returning SeparatedList with the strongly typed elements and separators. Deprecate the dynamically typed Parser.separatedBy.Parser.matchesAll that creates a lazy iterable over the (overlapping or non-overlapping) successful parse results. Deprecate matches and matchesSkipping.newline parser.ref0, ref1, ... instance methods, these methods are globally defined since 4.2.0.GrammarDefinition and GrammarDefinition.start() optionally typed.Deprecate hasSideEffect in MapParser by considering all callbacks to have side-effects, the benefit of the added complications is negligible.
skip helper that silently consumes input before and/or after another parser.ExpressionBuilder<T> statically typed. This requires existing code to specify the desired result type, and provide all reduction actions.hasSideEffect in MapParser by considering all callbacks to have side-effects, the benefit of the added complications is negligible.charIgnoringCase, and provide better standard error messages for character parsers.Add a PatternParser that allows to use any Dart Pattern as a parser.
PatternParser that allows to use any Dart Pattern as a parser.Add a labeled parser, that allows to add a debug label to the parser graph.
labeled parser, that allows to add a debug label to the parser graph.Predicate<T> and Callback<T> function types to shared file.Analyzer:
Deprecated removeSettables, that is superseded by the more powerful resolve operation.
ref0, ref1, ref2, ... is now also usable outside of GrammarDefinition.
resolve to inline all the referenced parsers, which now also works with SettableParser.removeSettables, that is superseded by the more powerful resolve operation.Token and transform their values.Analyzer to compute nullability, as well as first-, follow-, and cycle-sets of parsers.linter that performs a series of checks on grammar graphs.Deprecate GrammarParser, a no longer needed wrapper around GrammarDefinition. Call build() on the definition to get the parser.
ChoiceParser parsers:
selectLast is the default strategy, reporting the failure of the last parser tried.selectFarthest reports the parser failure the farthest down in the input string, preferring later failures to earlier ones.selectFarthestJoined is the same as above, but joins error messages that happen at the same position.transformParser and its users (debug tools, optimizers). To fix type your transformation function.GrammarDefinition and reference parsers. To take advantage replace uses of ref with ref0, ref1, ...GrammarParser, a no longer needed wrapper around GrammarDefinition. Call build() on the definition to get the parser.GrammarDefinition.Nothing published for this version
Nothing published for this version
Dart 2.12 requirement and null-safety.
Success.message throws an UnsupportedError exception, instead of returning null.DelegateParser has been made abstract to avoid a concrete class in-between abstract classes.Parser.delegate() has been removed, use Parser.settable() as an equivalent replacement.Parser.optional() is now returning Parser<T?>, to provide a non-null default value use Parser.optionalWith(T value).Parser.not() is now returning the failure Parser<Failure> as success value, instead of null.epsilon() is now returning Parser<void>, to provide a non-null default value use epsilonWith(T value).Parser hierarchy, as most parsers are inherently mutable and having some constant makes things inconsistent and more complicated than necessary.Nothing published for this version
Nothing published for this version
Fix missing type information on eof and failure parser.
eof and failure parser.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Dart 2.7 compatibility and requirement (extension methods).
String.toParser() enables creating efficient string and character parsers more easily.Iterable.toChoiceParser() and Iterable.toSequenceParser() enables creating parsers from collections more easily.Parser.callCC(Function) enables capturing a parse continuation more easily.Parser class now only defines a few core methods, everything else is an extension method.package:petitparser/petitparser.dart none of the changes should affect existing code.package:petitparser/parser.dart.package:petitparser/matcher.dart.package:petitparser/expression.dart.package:petitparser/definition.dart.Parser is no longer a Pattern, but can be converted to one with toPattern.anyIn has been removed in favor of the already existing and equivalent anyOf parser.pick and permute are defined on Parser<List>, thus they won't be available on the more generic Parser<dynamic> any longer. Prefix the operators with a castList operator.Dart 2.4 compatibility and requirement.
Dart 2.3 compatibility and requirement.
Nothing published for this version
Dart 2.2 compatibility and requirement.
Pattern interface.Nothing published for this version
Rename ParserError to ParserException, and make it an Exception.
EndOfInputParser and the ListParser.PositionParser that produces the current input position.Nothing published for this version
Nothing published for this version
Make parsers fully typed, where it makes sense.
cast<R> or castList<R> at the appropriate places.Nothing published for this version
- More Dart 2 strong mode fixes.
Removed deprecated code, and empty beta package.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed numerous analyzer warnings.
Fix bug with duplicated package name.
Move Smalltalk, Json, Dart and Lisp grammars to examples.
- Strict typing fixes.
- Fix analyzer warnings. - Fix package dependencies.
- Dev compiler support.
- Enable strong mode.
Improve the Dart parser and add more tests.
Update documentation to match the style guide.
Restore the CompositeParser class.
Integrate the tutorial into the README.
Remove deprecated CompositeParser class.
Allow for const GrammarDefinitions.
browser is now >=0.10.0 <0.11.0.
>=0.10.0 <0.11.0.>=0.11.0 <0.12.0.Add a benchmark for JSON native vs PetitParser.
- Format source code. - Add missing documentation.
Your coding agent can read these notes before it upgrades. Set up the MCP server →