Get synom compiling again
Add a `Synom` trait along with impls for all the base types here, to be used
later.
diff --git a/synom/src/lib.rs b/synom/src/lib.rs
index 7bb7bec..a536888 100644
--- a/synom/src/lib.rs
+++ b/synom/src/lib.rs
@@ -22,19 +22,21 @@
//! correctness, and compile time over nom's `ws!` strategy.
extern crate unicode_xid;
+extern crate proc_macro2;
#[cfg(feature = "printing")]
extern crate quote;
-#[cfg(feature = "parsing")]
#[doc(hidden)]
-pub mod space;
+pub use proc_macro2::TokenTree;
#[cfg(feature = "parsing")]
#[doc(hidden)]
pub mod helper;
pub mod delimited;
+pub mod tokens;
+pub mod span;
/// The result of a parser.
#[derive(Debug, PartialEq, Eq, Clone)]
@@ -86,6 +88,10 @@
}
}
+pub trait Synom: Sized {
+ fn parse(input: &[TokenTree]) -> IResult<&[TokenTree], Self>;
+}
+
/// Define a function from a parser combination.
///
/// - **Syntax:** `named!(NAME -> TYPE, PARSER)` or `named!(pub NAME -> TYPE, PARSER)`