Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone, Eq, PartialEq, Hash #23

Merged
merged 1 commit into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ pub use crate::kind::Kind;
pub use crate::loc::{BareSourceLocation, IncludedFrom, SourceLocation, SourceRange};

/// <font style="font-variant:small-caps">syntax tree root</font>
#[derive(Debug)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct Node<T> {
pub id: Id,
pub kind: T,
Expand Down
8 changes: 4 additions & 4 deletions src/loc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ use std::cell::{Cell, RefCell};
use std::fmt::{self, Debug};
use std::sync::Arc;

#[derive(Default)]
#[derive(Default, Clone, Eq, PartialEq, Hash)]
pub struct SourceRange {
pub begin: SourceLocation,
pub end: SourceLocation,
}

#[derive(Default)]
#[derive(Default, Clone, Eq, PartialEq, Hash)]
pub struct SourceLocation {
pub spelling_loc: Option<BareSourceLocation>,
pub expansion_loc: Option<BareSourceLocation>,
}

#[derive(Clone, Debug)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct BareSourceLocation {
pub offset: usize,
pub file: Arc<str>,
Expand All @@ -30,7 +30,7 @@ pub struct BareSourceLocation {
pub is_macro_arg_expansion: bool,
}

#[derive(Clone, Debug)]
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct IncludedFrom {
pub included_from: Option<Box<IncludedFrom>>,
pub file: Arc<str>,
Expand Down