Move Ident conversions to ident.rs
diff --git a/src/ident.rs b/src/ident.rs
index 368b0c3..cb9978e 100644
--- a/src/ident.rs
+++ b/src/ident.rs
@@ -35,3 +35,19 @@
})
}
}
+
+macro_rules! ident_from_token {
+ ($token:ident) => {
+ impl From<Token![$token]> for Ident {
+ fn from(token: Token![$token]) -> Ident {
+ Ident::new(stringify!($token), token.span)
+ }
+ }
+ };
+}
+
+ident_from_token!(self);
+ident_from_token!(Self);
+ident_from_token!(super);
+ident_from_token!(crate);
+ident_from_token!(extern);
diff --git a/src/token.rs b/src/token.rs
index a95bdc2..be9b68e 100644
--- a/src/token.rs
+++ b/src/token.rs
@@ -684,22 +684,6 @@
(_) => { $crate::token::Underscore };
}
-macro_rules! ident_from_token {
- ($token:ident) => {
- impl From<Token![$token]> for Ident {
- fn from(token: Token![$token]) -> Ident {
- Ident::new(stringify!($token), token.span)
- }
- }
- };
-}
-
-ident_from_token!(self);
-ident_from_token!(Self);
-ident_from_token!(super);
-ident_from_token!(crate);
-ident_from_token!(extern);
-
#[cfg(feature = "parsing")]
mod parsing {
use proc_macro2::{Spacing, Span};