mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
make token trees eq
This commit is contained in:
parent
3e367b5760
commit
5f89180fd9
2 changed files with 6 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue