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