Remove the log keyword (by renaming it to __log)
We can't quite remove logging from the language, but this hides the keyword.
This commit is contained in:
parent
cb37d09f50
commit
9c7e16e48d
4 changed files with 10 additions and 24 deletions
|
@ -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),+ ))
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue