Skip to content

Releases: m4rw3r/chomp

0.3.1

06 Sep 16:55
Compare
Choose a tag to compare
0.3.1 Pre-release
Pre-release

Added

  • combinators::either: Like or but allows different result types from the parsers.

Changes

  • Chomp is now licensed under both MIT and Apache-2.0 licenses.

Bugfixes

  • Feature tendril now compiles again.

0.3.0

01 Sep 17:54
Compare
Choose a tag to compare
0.3.0 Pre-release
Pre-release

Added

  • prelude module containing basic types, parsers and combinators.

    This is supposed to be the equivalent of Attoparsec's main package.

  • run_parser which executes a parser on any given Input type.

  • buffer::InputBuf which contains a slice and an incomplete flag, much as the old Input struct.

  • Input<Token=T, Buffer=&[T]> implementation for &[T] where T: Copy + PartialEq.

  • Input<Token=char, Buffer=&str> implementation for &str.

  • types::Buffer trait which is implemented for all buffers providing common logic to perform the
    final parsing on a buffer without knowing the exact buffer implementation.

  • types::U8Input trait alias for Input<Token=u8>.

  • primitives::Primitives trait providing access to the primitive methods of the Input trait.

    This is used for building fundamental parsers/combinators.

  • ParseResult::inspect allowing code to observe the success value.

  • types::numbering module for creating position-aware Input types.

  • parsers::skip_while using an efficient way of skipping data if provided, otherwise falls back
    on using take_while and throws the result away.

  • chomp::Error now includes a backtrace in test and debug build profiles thanks to the
    debugtrace crate. Backtraces can also be activated
    permanently using the backtrace feature but this will incur the significant cost of allocating
    backtraces even in the release profile.

  • Feature noop_error provides a zero-sized error type for the cases when the expected token is
    unimportant. Provides a small performance boost.

Changes

  • Backwards-incompatible: Input is now a trait with associated types Token and Buffer.

    This removes all incomplete logic from the parsers themselves and moves it into the InputBuf
    type. This InputBuf is used if a partial buffer is in memory. It also allows the parsers to
    operate directly on slices or use more effective means of storing buffers depending on the
    Input implementation.

    To upgrade you replace the previous concrete Input type with a generic, use its associated
    type if required, and refer to the Buffer associated type to allow for zero-copy parsing::

    -fn http_version(i: Input<u8>) -> U8Result<&[u8]>;
    +fn http_version<I: Input<Token=u8>>(i: I) -> SimpleResult<I, I::Buffer>;
    

    The associated types can be restricted if requried:

    fn request<I: U8Input>(i: I) -> SimpleResult<I, (Request<I::Buffer>, Vec<Header<I::Buffer>>)>
      where I::Buffer: ::std::ops::Deref<Target=[u8]>;
    
  • Backwards-incompatible: Moved types into a more logical module structure, prelude now
    exists as a prelude module.

  • Backwards-incompatible: chomp::Error is no longer an enum, this is to facillitate the
    support of backtraces while keeping code compatible between the different build profiles.

    Use chomp::Error::expected_token to determine if a specific token was expected.

  • Feature verbose_error is now default

Removed

  • Input::incomplete
  • Input::new
  • ParseResult::expect
  • ParseResult::unwrap_err
  • ParseResult::unwrap
  • buffer::IntoStream
  • primitives::InputClone
  • primitives::State

Bugfixes

  • combinators::bounded now have a defined behavior when a Range<usize> has start == end: They will parse exactly start times. This also fixed a few overflows and unreachable code being reachable.
  • combinators::bounded::many_till got fixed for an overflow happening when 0: usize was used to limit the number of iterations.

0.2.6

07 Jul 16:18
Compare
Choose a tag to compare
0.2.6 Pre-release
Pre-release

Bugfixes

  • Macro expansion is now again compatible with nightly.
  • Now uses std feature of conv dependency, fixing build breakage on rustc 1.2.0.

0.2.5

08 Mar 12:37
Compare
Choose a tag to compare
0.2.5 Pre-release
Pre-release
Version 0.2.5

0.2.4

25 Jan 10:30
Compare
Choose a tag to compare
0.2.4 Pre-release
Pre-release
Version 0.2.4

0.2.3

21 Jan 18:28
Compare
Choose a tag to compare
0.2.3 Pre-release
Pre-release
Version 0.2.3

0.2.2

18 Jan 07:40
Compare
Choose a tag to compare
0.2.2 Pre-release
Pre-release
Version 0.2.2

0.2.1

20 Dec 00:02
Compare
Choose a tag to compare
0.2.1 Pre-release
Pre-release
Version 0.2.1

0.2.0

16 Dec 15:49
Compare
Choose a tag to compare
0.2.0 Pre-release
Pre-release
Changelog: Added missing feature

0.1.2

02 Dec 10:11
Compare
Choose a tag to compare
0.1.2 Pre-release
Pre-release
Cargo: bump version