diff --git a/src/lib.rs b/src/lib.rs index 3341a16..d1b2b6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -942,6 +942,10 @@ macro_rules! quote_token { $crate::__rt::push_sub_eq(&mut $tokens, $span); }; + ($tokens:ident $span:ident $ident:ident) => { + $crate::__rt::push_ident(&mut $tokens, $span, stringify!($ident)); + }; + ($tokens:ident $span:ident $other:tt) => { $crate::__rt::parse(&mut $tokens, $span, stringify!($other)); }; diff --git a/src/runtime.rs b/src/runtime.rs index 4a1c14c..9394996 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -208,6 +208,10 @@ pub fn parse(tokens: &mut TokenStream, span: Span, s: &str) { } } +pub fn push_ident(tokens: &mut TokenStream, span: Span, s: &str) { + tokens.append(Ident::new(s, span)); +} + macro_rules! push_punct { ($name:ident $char1:tt) => { pub fn $name(tokens: &mut TokenStream, span: Span) {