#derive #spans #source #map #macro-derive #code

macro locspan-derive

Derive macros for the locspan code mapping library

9 releases (5 breaking)

0.6.0 Nov 3, 2022
0.5.2 Oct 10, 2022
0.5.1 Jul 2, 2022
0.4.0 Jun 30, 2022
0.1.0 Jun 28, 2022

#101 in #code

Download history 1171/week @ 2023-12-11 1142/week @ 2023-12-18 309/week @ 2023-12-25 1001/week @ 2024-01-01 873/week @ 2024-01-08 1104/week @ 2024-01-15 1177/week @ 2024-01-22 1722/week @ 2024-01-29 1637/week @ 2024-02-05 1551/week @ 2024-02-12 1717/week @ 2024-02-19 1780/week @ 2024-02-26 2041/week @ 2024-03-04 2232/week @ 2024-03-11 3217/week @ 2024-03-18 3804/week @ 2024-03-25

11,438 downloads per month
Used in 43 crates (3 directly)

MIT/Apache

44KB
1.5K SLoC

Derive macros for the locspan code mapping library.

CI Crate informations License Documentation

This library provides the StrippedPartialEq derive macro used to automatically implement the StrippedPartialEq comparison trait defined in the locspan library.

Usage

use locspan::Loc;
use locspan_derive::StrippedPartialEq;

// Implement `StrippedPartialEq` for the `Foo` type.
// Type parameters will be required to implement
// `StrippedPartialEq` themselves unless they are marked
// with `#[stripped]`.
#[derive(StrippedPartialEq)]
struct Foo<T, #[stripped] S, #[stripped] P> {
  a: Loc<T, S, P>,

  // Files are compared using `StrippedPartialEq`
  // unless they are marked with `#[stripped]`, in
  // which case `PartialEq` is used.
  #[stripped]
  b: std::path::PathBuf
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.5MB
~34K SLoC