2013-08-07 00:50:23 -04:00
|
|
|
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
2012-12-03 16:48:01 -08:00
|
|
|
// 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.
|
|
|
|
|
2013-10-18 16:01:40 -07:00
|
|
|
/// Deprecated fmt! syntax extension
|
2012-12-23 17:41:37 -05:00
|
|
|
|
|
|
|
use ast;
|
2013-08-31 18:13:04 +02:00
|
|
|
use codemap::Span;
|
2012-12-23 17:41:37 -05:00
|
|
|
use ext::base;
|
2013-05-18 00:19:28 +10:00
|
|
|
use ext::build::AstBuilder;
|
2013-03-01 10:44:43 -08:00
|
|
|
|
2014-05-05 18:56:44 -07:00
|
|
|
|
|
|
|
pub fn expand_syntax_ext(ecx: &mut base::ExtCtxt,
|
|
|
|
sp: Span,
|
|
|
|
_tts: &[ast::TokenTree])
|
2014-08-27 21:46:52 -04:00
|
|
|
-> Box<base::MacResult+'static> {
|
2013-10-18 16:01:40 -07:00
|
|
|
ecx.span_err(sp, "`fmt!` is deprecated, use `format!` instead");
|
|
|
|
ecx.parse_sess.span_diagnostic.span_note(sp,
|
2014-05-21 19:55:39 -07:00
|
|
|
"see http://doc.rust-lang.org/std/fmt/ \
|
2013-10-18 16:01:40 -07:00
|
|
|
for documentation");
|
2012-12-23 17:41:37 -05:00
|
|
|
|
2014-04-15 22:00:14 +10:00
|
|
|
base::MacExpr::new(ecx.expr_uint(sp, 2))
|
2011-08-27 21:27:39 -07:00
|
|
|
}
|