syntax: Add quote_method!
This commit is contained in:
@@ -371,6 +371,9 @@ pub fn syntax_expander_table() -> SyntaxEnv {
|
|||||||
syntax_expanders.insert(intern("quote_ty"),
|
syntax_expanders.insert(intern("quote_ty"),
|
||||||
builtin_normal_expander(
|
builtin_normal_expander(
|
||||||
ext::quote::expand_quote_ty));
|
ext::quote::expand_quote_ty));
|
||||||
|
syntax_expanders.insert(intern("quote_method"),
|
||||||
|
builtin_normal_expander(
|
||||||
|
ext::quote::expand_quote_method));
|
||||||
syntax_expanders.insert(intern("quote_item"),
|
syntax_expanders.insert(intern("quote_item"),
|
||||||
builtin_normal_expander(
|
builtin_normal_expander(
|
||||||
ext::quote::expand_quote_item));
|
ext::quote::expand_quote_item));
|
||||||
|
|||||||
@@ -353,6 +353,16 @@ pub fn expand_quote_ty(cx: &mut ExtCtxt,
|
|||||||
base::MacExpr::new(expanded)
|
base::MacExpr::new(expanded)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn expand_quote_method(cx: &mut ExtCtxt,
|
||||||
|
sp: Span,
|
||||||
|
tts: &[ast::TokenTree])
|
||||||
|
-> Box<base::MacResult> {
|
||||||
|
let e_param_colons = cx.expr_none(sp);
|
||||||
|
let expanded = expand_parse_call(cx, sp, "parse_method",
|
||||||
|
vec!(e_param_colons), tts);
|
||||||
|
base::MacExpr::new(expanded)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn expand_quote_stmt(cx: &mut ExtCtxt,
|
pub fn expand_quote_stmt(cx: &mut ExtCtxt,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
tts: &[ast::TokenTree])
|
tts: &[ast::TokenTree])
|
||||||
|
|||||||
Reference in New Issue
Block a user