Prototype for support of custom keywords
First prototype for support of custom keywords with syn's new parsing
API. Documentation and tests aren't present for now as I'm mainly
reaching for feedback.
This patch introduces a new Keyword trait, a new macro custom_keyword!
and exposes the existing TokenMarker enum. The Keyword trait
automatically implements the Token trait, making it possible to peek on
custom keywords (this is why I had to make TokenMarker public).
The custom macro generates a structure storing an Ident and implementing
the Keyword and Parse traits. A function with the same name as the
structure is also generated in order to use it like any predefined
keyword.
diff --git a/src/parse.rs b/src/parse.rs
index 0445cef..4dd735d 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -214,7 +214,8 @@
use token::Token;
pub use error::{Error, Result};
-pub use lookahead::{Lookahead1, Peek};
+pub use lookahead::{Lookahead1, Peek, TokenMarker};
+pub use keyword::Keyword;
/// Parsing interface implemented by all types that can be parsed in a default
/// way from a token stream.