810: make token trees eq r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot]
2019-02-12 17:57:39 +00:00
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ fn expand_vec(self, input: MacroInput) -> Option<MacroExpansion> {
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MacroInput {
// Should be token trees
pub text: String,
+5 -5
View File
@@ -33,14 +33,14 @@ pub const fn unspecified() -> 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,