nom8
A byte-oriented, zero-copy, parser combinators library (fork for proposals for v8)
0.2.0
6.1M downloads/mo
#4096 most downloaded on crates.io
epage/nom-experimental
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Too new to tell
only 2 dated releases
Nearly every release is documented
notes for 2 of 2 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
2 releases · first in 2022
0 releases in the last 12 months
see the full history below
Release timeline
2 releases · Dec 2022 to Dec 2022
2023
2024
2025
2026
Releases
latest 2-
0.2.027 Dec 2022Release notes
Open source →works with
rustc 1.0.0-dev (81e2396c7 2015-03-19) (built 2015-03-19)Thanks
- Ryman for the AsBytes implementation
- jag426 and jaredly for documentation fixes
- eternaleye on #rust IRC for his help on the new macro syntax
Changed
- the AsBytes trait improves readability, no more b"...", but "..." instead
- Incomplete will now hold either Needed;;Unknown, or Needed::Size(u32). Matching on Incomplete without caring for the value is done with
Incomplete(_), but if more granularity is mandatory,Neededcan be matched too alt!can pass the result of the parser to a closure- the
take_*macros changed behaviour, the default case is now not to consume the separator. The macros have been renamed as follows:take_until!->take_until_and_consume!,take_until_and_leave!->take_until!,take_until_either_and_leave!->take_until_either!,take_until_either!->take_until_either_and_consume!
Added
peek!macro: matches the future input but does not consume itlength_value!macro: the first argument is a parser returning anthat can cast to usize, then applies the second parserntimes. The macro has a variant with a third argument indicating the expected input size for the second parser- benchmarks are available at https://github.com/Geal/nom_benchmarks
- more documentation
- Unnamed parser syntax: warning, this is a breaking change. With this new syntax, the macro combinators do not generate functions anymore, they create blocks. That way, they can be nested, for better readability. The
named!macro is provided to create functions from parsers. Please be aware that nesting parsers comes with a small cost of compilation time, negligible in most cases, but can quickly get to the minutes scale if not careful. If this happens, separate your parsers in multiple subfunctions. named!,closure!andcall!macros used to support the unnamed syntaxmap!,map_opt!andmap_res!to combine a parser with a normal function, transforming the input directly, or returning anOptionorResult
Fixed
is_a!is now working properly
Removed
- the
o!macro does less thanchain!, so it has been removed - the
fold0!andfold1!macros were too complex and awkward to use, themany*combinators will be useful for most uses for now
Release notes
Open source →Breaking Changes
From nom8
- Removed
pub use bits::*;into root namespace (epage/nom-experiment#52) - Removed
error::error_to_u32(epage/nom-experiment#54)a
From 0.1.0
- Removed
nom::character::charin favor ofnom::bytes::one_of(epage/nom-experiment#45) - Changed
IntoOutputto allow reconstructing state (epage/nom-experiment#57)
Deprecations
- Deprecated
ParseError::from_charin favor ofContextError(epage/nom-experiment#45) - Deprecated
error::make_erroranderror::append_error(epage/nom-experiment#55)
Feature
nom::input::Statefulfor attaching state to the input type (epage/nom-experiment#58)nom::input::Locatedfor tracking the input's location, along withParser::spanandParser::with_spanto capture it (epage/nom-experiment#58)
Fixes
From 0.1.0
- Generalize
InputTakeAtPositionforStreaming
-
0.1.023 Dec 2022Release notes
Open source →Breaking Changes
- Moved input traits from
nomtonom::input(epage/nom-experiment#13) - Renamed
InputTakeAtPositionfunctions to be explicit about complete vs streaming policy - Removed
impl ExtendInto for char(epage/nom-experiment#19) - Combinator structs returned by
Parserwere moved tocombinatormodule (epage/nom-experiment#4) - Tweaks were made to what input traits are needed for various types
Deprecations
character::is_*functions in favor ofAsChar(epage/nom-experiment#25)*::complete::*and*::streaming::*parsers in favor of merged ones (epage/nom-experiment#28)- Freestanding
map,flat_map,map_parserin favor ofParserfunctions (epage/nom-experiment#37) - Freestanding
map_res,map_opt,complete,verify,value,recognize_with_value,context,dbg_dmpin favor ofParsermethods (epage/nom-experiment#40) - Freestanding
intoin favor ofParser::output_intoandParser::err_into(epage/nom-experiment#37, epage/nom-experiment#48) is_awithtake_while1thanks to newFindTokenimpls (epage/nom-experiment#44)is_notwithtake_till1thanks to newFindTokenimpls (epage/nom-experiment#44)satisfywithone_ofthanks to newFindTokenimpls (epage/nom-experiment#44)Parser::and,Parser::orin favor ofimpl Parser for <tuples>andalt(epage/nom-experiment#37)tuple,pairparser in favor of using tuples (epage/nom-experiment#42, epage/nom-experiment#46)
Features
- Merged streaming/complete parsers, opting in to streaming with the
Streaming<I>input type (epage/nom-experiment#28)- Merged ASCII float parsers moved to
characterand renamed to their rust types (epage/nom-experiment#38) - Moved
one_of,none_offromcharactertobytesas they are more general (epage/nom-experiment#44) - Moved
character::anychartobytes::anywith a more generic return type (epage/nom-experiment#44)
- Merged ASCII float parsers moved to
- Allow generic context in errors (epage/nom-experiment#49)
Parser::by_refto allow using&mut impl Parseras aParser(epage/nom-experiment#34, epage/nom-experiment#41)impl Parser for <tuples>as an alternative totuple(())(epage/nom-experiment#42)impl Parser for (char|u8|&str|&[u8])as an alternative toone_of,char, andtag(epage/nom-experiment#47, epage/nom-experiment#50)- Add
Parser::map_res,Parser::map_opt,Parser::complete,Parser::verify,Parser::value,Parser::with_recognized,Parser::context,Parser::dbg_err(epage/nom-experiment#40) - Allow
u8/char/ ranges of the prior, functions, and tuples of the prior whereeverFindTokenis accepted (epage/nom-experiment#44) - Generalize
take_while,take_tillwithFindTokentrait (epage/nom-experiment#44) - Add
character::is_*functions toAsCharthat were missing (epage/nom-experiment#2)
Fixes
- Change
fill,iterator,bits::bits, andbits::byutesfrom taking a function to taking aParser(epage/nom-experiment#10, epage/nom-experiment#11, epage/nom-experiment#120) - Allow byte arrays of any size (epage/nom-experiment#14)
length_dataandlength_valuenow auto-detect complete/streaming, before were streaming only (epage/nom-experiment#28)hex_u32is now generic over input (epage/nom-experiment#32)- Clamp allocations in
many_m_n,count(Geal/nom#1545)
Documentation
- Pulled loose markdown into rustdoc (epage/nom-experiment#1)
- Moved input traits from