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 {
// Should be token trees
pub text: String,

View file

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