]> git.lizzy.rs Git - rust.git/blobdiff - src/macros.rs
Extract checkstyle output into a separate module.
[rust.git] / src / macros.rs
index bede00d6e9e3b54f6fa1f67063cd6ca719c3e2e0..8739d234fd2a4677941a9e1bb2ea9375dff81f63 100644 (file)
@@ -20,8 +20,8 @@
 // and those with brackets will be formatted as array literals.
 
 use syntax::ast;
-use syntax::parse::token::{Eof, Comma, Token};
-use syntax::parse::{ParseSess, tts_to_parser};
+use syntax::parse::token::Token;
+use syntax::parse::tts_to_parser;
 use syntax::codemap::{mk_sp, BytePos};
 
 use Indent;
@@ -73,12 +73,11 @@ pub fn rewrite_macro(mac: &ast::Mac,
         };
     }
 
-    let parse_session = ParseSess::new();
-    let mut parser = tts_to_parser(&parse_session, mac.node.tts.clone(), Vec::new());
+    let mut parser = tts_to_parser(context.parse_session, mac.node.tts.clone(), Vec::new());
     let mut expr_vec = Vec::new();
 
     loop {
-        expr_vec.push(match parser.parse_expr_nopanic() {
+        expr_vec.push(match parser.parse_expr() {
             Ok(expr) => expr,
             Err(..) => return None,
         });