2012-12-03 18:48:01 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-12-23 16:41:37 -06:00
|
|
|
use ast;
|
|
|
|
use codemap;
|
|
|
|
use ext::base;
|
|
|
|
use print;
|
|
|
|
|
2014-03-27 09:40:35 -05:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
2014-08-27 20:46:52 -05:00
|
|
|
pub fn expand_syntax_ext<'cx>(cx: &'cx mut base::ExtCtxt,
|
|
|
|
sp: codemap::Span,
|
|
|
|
tt: &[ast::TokenTree])
|
|
|
|
-> Box<base::MacResult+'cx> {
|
2012-08-06 19:50:45 -05:00
|
|
|
|
2011-08-08 16:17:33 -05:00
|
|
|
cx.print_backtrace();
|
2014-06-21 05:39:03 -05:00
|
|
|
println!("{}", print::pprust::tt_to_string(&ast::TTDelim(
|
2014-03-27 09:40:35 -05:00
|
|
|
Rc::new(tt.iter().map(|x| (*x).clone()).collect()))));
|
2011-08-08 16:17:33 -05:00
|
|
|
|
2014-03-18 07:14:08 -05:00
|
|
|
// any so that `log_syntax` can be invoked as an expression and item.
|
2014-04-15 07:00:14 -05:00
|
|
|
base::DummyResult::any(sp)
|
2011-08-12 09:15:18 -05:00
|
|
|
}
|