syntax: Add quote_method!
This commit is contained in:
parent
96072d6efc
commit
a807aa1fca
2 changed files with 13 additions and 0 deletions
|
@ -371,6 +371,9 @@ pub fn syntax_expander_table() -> SyntaxEnv {
|
|||
syntax_expanders.insert(intern("quote_ty"),
|
||||
builtin_normal_expander(
|
||||
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"),
|
||||
builtin_normal_expander(
|
||||
ext::quote::expand_quote_item));
|
||||
|
|
|
@ -353,6 +353,16 @@ pub fn expand_quote_ty(cx: &mut ExtCtxt,
|
|||
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,
|
||||
sp: Span,
|
||||
tts: &[ast::TokenTree])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue