#derive #spans #map #source #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

#5 in #span

Download history 4762/week @ 2024-06-30 6704/week @ 2024-07-07 5834/week @ 2024-07-14 6218/week @ 2024-07-21 5764/week @ 2024-07-28 6261/week @ 2024-08-04 6509/week @ 2024-08-11 5588/week @ 2024-08-18 5948/week @ 2024-08-25 6752/week @ 2024-09-01 6776/week @ 2024-09-08 6095/week @ 2024-09-15 5969/week @ 2024-09-22 5078/week @ 2024-09-29 7418/week @ 2024-10-06 5485/week @ 2024-10-13

24,407 downloads per month
Used in 83 crates (via json-syntax)

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
~38K SLoC