NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #136 most downloaded on crates.io
A byte-oriented, zero-copy, parser combinators library
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 1 weeks to 12 months
Nearly every release is documented
notes for 55 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
98 releases · first in 2015
v8.0.0
v8.0.0 (#1797)
This version represents a significant refactoring of nom to reduce the amount of code generated by parsers, and reduce the API surface. As such, it comes with some breaking changes, mostly around the move from closure based combinators to trait based ones. In practice, it means that instead of writing combinator(arg)(input), we now write combinator(arg).parse(input).
This release also marks the introduction of the nom-language crate, which will hold tools more focused on language parsing than the rest of nom, like the VerboseError type and the newly added precedence parsing combinators.
Parser::map_resParser::map_optmany and fold combinators using rangesmany can collect into other types than VecError and VerboseError can be converted to owned versionsnom::bits::* is no longer re-exported at the crate root. This export caused frequent confusion, since e.g. nom::complete::tag referred to nom::bits::complete::tag instead of the much more commonly used nom::bytes::complete::tag. To migrate, change any imports of nom::{complete::*, streaming::*, bits, bytes} to nom::bits::[...].parse combinatorInputIter, InputTakeAtPosition, InputLength, InputTake and Slice are now merged in the Input traitParser::map and Parser::flat_map now take a FnMut as argumentOne column per quarter.
Nothing published for this version
v8.0.0-alpha2
v8.0.0-alpha2 (#1758)
Nothing published for this version
Nothing published for this version
v7.1.2
v7.1.2 (#1605)
many_m_n to 64kiBParser implementors instead of only functionsTuple parsing for the unit type as a special caseErrorConvert on the unit type to make it usable as error type for bits parsers### Thanks - @ThomasdenH - @@SphinxKnight - @irevoire - @doehyunbaek - @pxeger - @punkeel - @max-sixty - @Xiretza - @5c077m4n - @erihsu - @TheNeikos -
the move to minimal-lexical for float parsing introduced bugs that cannot be resolved right now, so this version moves back to using the standard lib'
This release fixes dependency compilation issues and strengthen the minimum supported Rust version (MSRV) policy. This is also the first release witho
This release fixes dependency compilation issues and strengthen the minimum supported Rust version (MSRV) policy. This is also the first release without the macros that were used since nom's beginning.
take_until1 combinatorto_owned implementationsfail: a parser that always fail, useful as default condition in other combinatorscharacter::streaming and character::complete modules, there are parsers named i8, u16, u32, u64, u128 and u8 ,u16, u32, u64, u128 that recognize decimal digits and directly convert to a number in the target size (checking for max int size)BitSlice input type from bitvec has been moved into the nom-bitvec crate. nom does not depend on bitvec nowErrorKind::PArseTo was not needed anymoresplit_at_position* functions should now be guaranteed panic freelexical-core crate used for float parsing has now been replaced with minimal-lexical: the new crate is faster to compile, faster to parse, and has no dependenciesescaped combinatormany_m_n now fails if min > maxNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
Fix cargo feature usage in previous release
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
std::error::Error on VerboseErrorthe #[deprecated] attribute was removed from traits because it does not compile anymore on nightly
This release was done thanks to the hard work of (by order of appearance in the commit list):
ErrorConvert implementation for VerboseErrorfold_many* now accept FnMut for the accumulation functionlength_count#[deprecated] attribute was removed from traits because it does not compile anymore on nightlyFnMutThis release was done thanks to the hard work of (by order of appearance in the commit list):
This release was done thanks to the hard work of (by order of appearance in the commit list):
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
@AlexanderEkdahl, @JoshOrndorff, @akitsu-sanae for docs fixes
map implementation for errorsErr now has a map functionerror::context() available without alloc feature@Hywan, @nickmooney, @jplatte, @ngortheone, @ejmg, @SirWindfield, @demurgos, @spazm, @nyarly, @guedou, @adamnemecek, for docs fixes
convert_errorcompile_error macro usagestd::error::Error, std::fmt::Display, Eq, ToOwned implementations for errorsToUsizeconvert_error optimizationalt optimization@waywardmonkeys, @phaazon, @dalance for docs fixes
many0_m_n fixesmany0_m_n now supports the n=1 casecutpeek! macro reimplementationvalue!deprecated string parsers (with the _s suffix), the normal version can be used instead
This version comes with a complete rewrite of nom internals to use functions as a base for parsers, instead of macros. Macros have been updated to use functions under the hood, so that most existing parsers will work directly or require minimal changes.
The CompleteByteSlice and CompleteStr input types were removed. To get different
behaviour related to streaming or complete input, there are different versions of some
parsers in different submodules, like nom::character::streaming::alpha0 and
nom::character::complete::alpha0.
The verbose-errors feature is gone, now the error type is decided through a generic
bound. To get equivalent behaviour to verbose-errors, check out nom::error::VerboseError
escaped and escaped_transform fixesVerboseError type accumulates position info and error codes, and can generate a trace with span informationlexical-core crate is now used by default (through the lexical compilation feature) to parse floats from textcond will now return the error of the parser instead of Nonealpha*, digit*, hex_digit*, alphanumeric* now recognize only ASCII characters_s suffix), the normal version can be used insteadverbose-errors is not needed anymore, now the error type can be decided when writing the parsers, and parsers provided by nom are generic over the error typeAtEof, CompleteByteSlice and CompleteStr are gone, instead some parsers are specialized to work on streaming or complete input, and provided in different modules*1 version: eol, alpha, digit, hex_digit, oct_digit, alphanumeric, space, multispacecount_fixed macrowhitespace::sp can be replaced by character::complete::multispace0take_until_either, take_until_either1, take_until_either_and_consume and take_until_either_and_consume1: they can be replaced with is_not (possibly combined with something else)take_until_and_consume, take_until_and_consume1: they can be replaced with take_until combined with takesized_buffer and length_bytes!: they can be replaced with the length_data functionnon_empty, begin and rest_s functioncond_reduce!, cond_with_error!, closure!, apply, map_res_err!, expr_opt!, expr_res!alt_complete, separated_list_complete, separated_nonempty_list_completeNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
add missing build.rs file to the package
build.rs file to the packageregression in do_parse macro import for edition 2018
macro expansion error in do_parse due to compile_error macro usage
do_parse due to compile_error macro usagemethod combinators are now deprecated. They might be moved to a separate crate
many0_count and many1_count to count applications of a parser instead of
accumulating its results in a Vecf64 parsing does not use transmute anymorecompilation issue in verbose-errors mode for add_return_error
add_return_errorfloat_s and double_s got the same modification, but are now deprecated
rest_len parseru128 and i128 parserspub(crate) supportmap_res_err!rest_len parser, returns the length of the remaining inputparse_to has its own error code nowu128 and i128 parsers in big and little endian modespub(crate) syntaxmap_res_err! combinator that appends the error of its argument function in verbose errors modebytes combinator was not compiling in some casesadd_return_error, the provided error code is now evaluated only oncefold_many1 will now transmit a Failure instead of transforming it to an Errorfloat and double now work on all of nom's input types (&[u8], &str, CompleteByteSlice, CompleteStr and any type that implements the required traits). float_s and double_s got the same modification, but are now deprecatedCompleteByteSlice and CompleteStr get a small optimization by inlining some functions@tmccombs for fixes on escaped* combinators
AtEof traitescaped* combinatorsInputIter trait for &[u8]input_len() usage fixesswitch!Deref on CompleteStr and CompleteByteSliceparse_to! fixesCompleteStr and CompleteByteSliceCompleteStrAsRef<str> on CompleteStrstd::Error on nom:ErrSpecial thanks to @corkami for the logo :)
IResult type now becomes a Result from the standard libraryIncomplete now returns the additional data size needed, not the total data size needederror_position and other such macros were swapped to be more consistent with the rest of nomstd::convert::From<u32>not! combinator returns unit ()take_* combinators are now more coherent and stricter, see commit 484f6724ea3ccb for more informationmany0 and other related parsers will now return Incomplete if the reach the end of input without an error of the child parser. They will also return Incomplete on an empty inputsep! combinator for whitespace only consumes whitespace in the prefix, while the ws! combinator takes care of consuming the remaining whitespaceAtEof trait for input type: indicate if we can get more input data later (related to streaming parsers and Incomplete handling)escaped* parsers now support the &strinput typeFailure error variant represents an unrecoverable error, for which alt and other combinators will not try other branches. This error means we got in the right part of the code (like, a prefix was checked correctly), but there was an error in the following partsCompleteByteSlice and CompleteStr input types consider there will be no more refill of the input. They fixed the Incomplete related issues when we have all of the dataexact!() combinator will fail if we did not consume the whole inputtake_while_m_n! combinator will match a specified number of charactersErrorKind::TakeUntilAndConsume1recognize_float parser will match a float number's characters, but will not transform to a f32 or f64alpha and other basic parsers are now much stricter about partial inputs. We also introduce the *0 and *1 versions of those parsersnamed_args can now specify the input type as wellHexDisplay is now implemented for &stralloc featureInputTakeAtposition trait allows specialized implementations of parsers like take_while!error_code and error_node macros are not used anymoreanychar! now works correctly with multibyte characterstake_until_and_consume1! no longer results in "no method named `find_substring`" and "no method named `slice`" compilation errorstake_until_and_consume1! returns the correct Incomplete(Needed) amountno_std compiles properly, and nom can work with alloc tooparse_to! now consumes its inputalt and other combinators will now clone the input if necessary. If the input is already Copy there is no performance impactrest parser now works on various input typesInputIter::Item for &[u8] is now a u8 directly, not a referencecompile_error macro to return a compile time error if there was a syntax issueNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
@friedm for documentation fixes
alt_complete fixesalt_complete could return Incompleteinto_error_kind method can be used to transform any error to a common value. This helps when the library is included multiple times as dependency with different feature sets@jedireza for documentation fixes
bytes combinatorseparated_listanychar can now work on any input typelength_bytes is now an alias for length_dataone_of, none_of and char will now index correctly UTF-8 characterscompiler_error macro is now correctly exportedbytes combinator transforms a bit stream back to a byte slice for child parsers@sdroege: implementing be_i24 and le_i24
count no longer preallocates its vectoralt should now work with whitespace parsingmap should not make type inference errors anymoreseparated_list_complete and separated_nonempty_list_complete will treat incomplete from sub parsers as errorChris Pick for some Incomplete related refactors
Incomplete related refactorsbe_u24IResultCopy types as inputInputIternamed_argsaltalt and alt_completeescaped, separated_list and separated_nonempty_list can now return Incomplete when necessaryInputIter does not require AsChar on its Item type anymorecore feature that was putting nom in no_std mode has been removed. There is now a std feature, activated by default. If it is not activated, nom is in no_stdverbose-errors mode, the error list is now stored in a Vec instead of a box based linked listchain! has finally been removedEndianness now implements Debug, PartialEq, Eq, Clone and CopyCopystr is now available in no_std modeFileProducer will be marked as Eof on full buffernamed_args! now has lifetimes that cannot conflict with the lifetimes from other argumentsbe_u24: big endian 24 bit unsigned integer parsingIResult now has a unwrap_or methodThis would apparently not result in any security vulnerability on release code
IResult::Incomplete, the addition could overflow (it is stored as a usize). This would apparently not result in any security vulnerability on release code@Kerollmops for actually marking chain! as deprecated
named_argsIResult, adding the option of default cases in switch!, adding support for cargo-travishex_u32chain! as deprecatedIResult gets an or() methodtake_until1, take_until_and_consume1, take_till1! and take_till1_s! require at least 1 characterhex_u32 accepts uppercase digits as welltake_while1 returns Incomplete on empty inputswitch! can now take a default casenamed_args! now imports IResult directly@nickbabcock for documentation fixes
Slicenamed_args!verify! uses a first parser, then applies a function to check that its result satisfies some conditionsnamed_args! creates a parser function that can accept other arguments along with the inputparse_to! will use the parse method from FromStr to parse a value. It will automatically translate the input to a string if necessaryfloat, float_s, double, double_s can recognize floating point numbers in textescaped! will now return Incomplete if neededpermutation! supports up to 20 child parsers*Warning*: there is a small breaking change, add_error! is renamed to add_return_error!. This was planned for the 2.0 release but was forgotten. This…
Bugfix release
Warning: there is a small breaking change, add_error! is renamed to add_return_error!. This was planned for the 2.0 release but was forgotten. This is a small change in a feature that not many people use, for a release that is not yet widely in use, so there will be no 3.0 release for that change.
add_error! mixuptag_no_case! was not working at all for byte slicesadd_error! has been renamed to add_return_error!not! combinator now accepts functionstag_no_case! is now working as accepted (before, it accepted everything)Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →