diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-03-08 18:32:03 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-03-11 23:19:42 -0700 |
| commit | 9c7e16e48d15b3380cc680f6194fe3516867d2db (patch) | |
| tree | bf5fdfb45faa8e8f1023ad46f53c8063245257ef | |
| parent | cb37d09f50e6e1ac50eee35b0874167f0119c114 (diff) | |
| download | rust-9c7e16e48d15b3380cc680f6194fe3516867d2db.tar.gz rust-9c7e16e48d15b3380cc680f6194fe3516867d2db.zip | |
Remove the log keyword (by renaming it to __log)
We can't quite remove logging from the language, but this hides the keyword.
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 | ||||
| -rw-r--r-- | src/test/run-fail/issue-1459.rs | 14 |
4 files changed, 10 insertions, 24 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 9cca2332374..831d1140a53 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -411,34 +411,34 @@ pub fn core_macros() -> ~str { macro_rules! error ( ($arg:expr) => ( - log(1u32, fmt!( \"%?\", $arg )) + __log(1u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(1u32, fmt!( $($arg),+ )) + __log(1u32, fmt!( $($arg),+ )) ) ) macro_rules! warn ( ($arg:expr) => ( - log(2u32, fmt!( \"%?\", $arg )) + __log(2u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(2u32, fmt!( $($arg),+ )) + __log(2u32, fmt!( $($arg),+ )) ) ) macro_rules! info ( ($arg:expr) => ( - log(3u32, fmt!( \"%?\", $arg )) + __log(3u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(3u32, fmt!( $($arg),+ )) + __log(3u32, fmt!( $($arg),+ )) ) ) macro_rules! debug ( ($arg:expr) => ( - log(4u32, fmt!( \"%?\", $arg )) + __log(4u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(4u32, fmt!( $($arg),+ )) + __log(4u32, fmt!( $($arg),+ )) ) ) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 99c1c2cb1fe..7d3f5c12612 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1184,7 +1184,7 @@ pub impl Parser { } } hi = self.span.hi; - } else if self.eat_keyword(&~"log") { + } else if self.eat_keyword(&~"__log") { self.expect(&token::LPAREN); let lvl = self.parse_expr(); self.expect(&token::COMMA); diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 81aacbf173d..c41b3aec09b 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -495,7 +495,7 @@ pub fn strict_keyword_table() -> HashMap<~str, ()> { ~"else", ~"enum", ~"extern", ~"false", ~"fn", ~"for", ~"if", ~"impl", - ~"let", ~"log", ~"loop", + ~"let", ~"__log", ~"loop", ~"match", ~"mod", ~"mut", ~"once", ~"priv", ~"pub", ~"pure", diff --git a/src/test/run-fail/issue-1459.rs b/src/test/run-fail/issue-1459.rs deleted file mode 100644 index 7f8cc7459de..00000000000 --- a/src/test/run-fail/issue-1459.rs +++ /dev/null @@ -1,14 +0,0 @@ -// 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. - -// error-pattern:roflcopter -fn main() { - log (fail!(~"roflcopter"), 2); -} |
