2020-02-29 17:37:32 +00:00
|
|
|
use rustc_ast::tokenstream::TokenStream;
|
2020-01-11 16:02:46 +00:00
|
|
|
use rustc_ast_pretty::pprust;
|
2024-03-12 02:55:17 +00:00
|
|
|
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacroExpanderResult};
|
2012-12-23 22:41:37 +00:00
|
|
|
|
2024-04-25 21:56:48 +00:00
|
|
|
pub(crate) fn expand_log_syntax<'cx>(
|
2024-03-12 02:55:17 +00:00
|
|
|
_cx: &'cx mut ExtCtxt<'_>,
|
2019-12-31 17:15:40 +00:00
|
|
|
sp: rustc_span::Span,
|
2019-08-31 17:08:06 +00:00
|
|
|
tts: TokenStream,
|
2024-03-12 02:55:17 +00:00
|
|
|
) -> MacroExpanderResult<'cx> {
|
2020-06-24 14:45:08 +00:00
|
|
|
println!("{}", pprust::tts_to_string(&tts));
|
2011-08-08 21:17:33 +00:00
|
|
|
|
2014-03-18 12:14:08 +00:00
|
|
|
// any so that `log_syntax` can be invoked as an expression and item.
|
2024-03-12 02:55:17 +00:00
|
|
|
ExpandResult::Ready(DummyResult::any_valid(sp))
|
2011-08-12 14:15:18 +00:00
|
|
|
}
|