]>
git.proxmox.com Git - rustc.git/blob - src/libsyntax_ext/log_syntax.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use syntax
::ext
::base
;
12 use syntax
::feature_gate
;
14 use syntax
::tokenstream
;
17 pub fn expand_syntax_ext
<'cx
>(cx
: &'cx
mut base
::ExtCtxt
,
19 tts
: &[tokenstream
::TokenTree
])
20 -> Box
<base
::MacResult
+ 'cx
> {
21 if !cx
.ecfg
.enable_log_syntax() {
22 feature_gate
::emit_feature_err(&cx
.parse_sess
,
25 feature_gate
::GateIssue
::Language
,
26 feature_gate
::EXPLAIN_LOG_SYNTAX
);
27 return base
::DummyResult
::any(sp
);
30 println
!("{}", print
::pprust
::tts_to_string(tts
));
32 // any so that `log_syntax` can be invoked as an expression and item.
33 base
::DummyResult
::any(sp
)