make token trees eq

This commit is contained in:
Aleksey Kladov 2019-02-12 20:57:13 +03:00
parent 3e367b5760
commit 5f89180fd9
2 changed files with 6 additions and 6 deletions

View file

@ -67,7 +67,7 @@ impl MacroDef {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct MacroInput { pub struct MacroInput {
// Should be token trees // Should be token trees
pub text: String, pub text: String,

View file

@ -33,14 +33,14 @@ impl TokenId {
} }
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq)]
pub enum TokenTree { pub enum TokenTree {
Leaf(Leaf), Leaf(Leaf),
Subtree(Subtree), Subtree(Subtree),
} }
impl_froms!(TokenTree: Leaf, Subtree); impl_froms!(TokenTree: Leaf, Subtree);
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq)]
pub enum Leaf { pub enum Leaf {
Literal(Literal), Literal(Literal),
Punct(Punct), Punct(Punct),
@ -48,7 +48,7 @@ pub enum Leaf {
} }
impl_froms!(Leaf: Literal, Punct, Ident); impl_froms!(Leaf: Literal, Punct, Ident);
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct Subtree { pub struct Subtree {
pub delimiter: Delimiter, pub delimiter: Delimiter,
pub token_trees: Vec<TokenTree>, pub token_trees: Vec<TokenTree>,
@ -62,7 +62,7 @@ pub enum Delimiter {
None, None,
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct Literal { pub struct Literal {
pub text: SmolStr, pub text: SmolStr,
} }
@ -79,7 +79,7 @@ pub enum Spacing {
Joint, Joint,
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct Ident { pub struct Ident {
pub text: SmolStr, pub text: SmolStr,
pub id: TokenId, pub id: TokenId,