Give Derive enum and impls their own module
diff --git a/syntax/derive.rs b/syntax/derive.rs
new file mode 100644
index 0000000..435aa20
--- /dev/null
+++ b/syntax/derive.rs
@@ -0,0 +1,26 @@
+use proc_macro2::Ident;
+
+#[derive(Copy, Clone, PartialEq)]
+pub enum Derive {
+ Clone,
+ Copy,
+}
+
+impl Derive {
+ pub fn from(ident: &Ident) -> Option<Self> {
+ match ident.to_string().as_str() {
+ "Clone" => Some(Derive::Clone),
+ "Copy" => Some(Derive::Copy),
+ _ => None,
+ }
+ }
+}
+
+impl AsRef<str> for Derive {
+ fn as_ref(&self) -> &str {
+ match self {
+ Derive::Clone => "Clone",
+ Derive::Copy => "Copy",
+ }
+ }
+}