about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-03-13 11:34:51 +0200
committerEduard Burtescu <edy.burt@gmail.com>2015-03-13 11:36:30 +0200
commit9889aae13e14c306fce8cefd669841fa40f26ee9 (patch)
treebbcd59c8ec0c1038956b9b8982f404c52311c4a8 /src/libsyntax/ext/quote.rs
parent79dd393a4f144fa5e6f81c720c782de3175810d7 (diff)
downloadrust-9889aae13e14c306fce8cefd669841fa40f26ee9.tar.gz
rust-9889aae13e14c306fce8cefd669841fa40f26ee9.zip
syntax: use lookahead to distinguish inner and outer attributes, instead of passing the latter around.
Diffstat (limited to 'src/libsyntax/ext/quote.rs')
-rw-r--r--src/libsyntax/ext/quote.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 48c045ee4f9..c38556b0782 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -361,8 +361,7 @@ pub mod rt {
             parse::parse_stmt_from_source_str("<quote expansion>".to_string(),
                                               s,
                                               self.cfg(),
-                                              Vec::new(),
-                                              self.parse_sess())
+                                              self.parse_sess()).expect("parse error")
         }
 
         fn parse_expr(&self, s: String) -> P<ast::Expr> {
@@ -407,7 +406,7 @@ pub fn expand_quote_expr<'cx>(cx: &'cx mut ExtCtxt,
                               sp: Span,
                               tts: &[ast::TokenTree])
                               -> Box<base::MacResult+'cx> {
-    let expanded = expand_parse_call(cx, sp, "parse_expr", Vec::new(), tts);
+    let expanded = expand_parse_call(cx, sp, "parse_expr", vec!(), tts);
     base::MacEager::expr(expanded)
 }
 
@@ -415,8 +414,7 @@ pub fn expand_quote_item<'cx>(cx: &mut ExtCtxt,
                               sp: Span,
                               tts: &[ast::TokenTree])
                               -> Box<base::MacResult+'cx> {
-    let expanded = expand_parse_call(cx, sp, "parse_item_with_outer_attributes",
-                                    vec!(), tts);
+    let expanded = expand_parse_call(cx, sp, "parse_item", vec!(), tts);
     base::MacEager::expr(expanded)
 }
 
@@ -448,9 +446,7 @@ pub fn expand_quote_stmt(cx: &mut ExtCtxt,
                          sp: Span,
                          tts: &[ast::TokenTree])
                          -> Box<base::MacResult+'static> {
-    let e_attrs = cx.expr_vec_ng(sp);
-    let expanded = expand_parse_call(cx, sp, "parse_stmt",
-                                    vec!(e_attrs), tts);
+    let expanded = expand_parse_call(cx, sp, "parse_stmt", vec!(), tts);
     base::MacEager::expr(expanded)
 }