about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-13 10:40:07 -0700
committerbors <bors@rust-lang.org>2013-03-13 10:40:07 -0700
commit695e9fd13cd71c87e9afc0903b3fb6856452d345 (patch)
tree5c97280a8ddc0e2a797912c4b3007461841d1a74 /src/libsyntax/parse
parent0ad3a110be9070b87ecd7e1c71d20a02660d8959 (diff)
parent9c7e16e48d15b3380cc680f6194fe3516867d2db (diff)
downloadrust-695e9fd13cd71c87e9afc0903b3fb6856452d345.tar.gz
rust-695e9fd13cd71c87e9afc0903b3fb6856452d345.zip
auto merge of #5293 : brson/rust/logging, r=brson
r? @graydon

This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros.

After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later.

I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/comments.rs4
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/libsyntax/parse/token.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 494ef3a81a0..360cdebc670 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -183,7 +183,7 @@ fn read_line_comments(rdr: @mut StringReader, code_to_the_left: bool,
     let mut lines: ~[~str] = ~[];
     while rdr.curr == '/' && nextch(rdr) == '/' {
         let line = read_one_line_comment(rdr);
-        log(debug, line);
+        debug!("%s", line);
         if is_doc_comment(line) { // doc-comments are not put in comments
             break;
         }
@@ -221,7 +221,7 @@ fn trim_whitespace_prefix_and_push_line(lines: &mut ~[~str],
             s1 = str::slice(s, col, len);
         } else { s1 = ~""; }
     } else { s1 = /*bad*/ copy s; }
-    log(debug, ~"pushing line: " + s1);
+    debug!("pushing line: %s", s1);
     lines.push(s1);
 }
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 51e36d9ec02..0c38b2f5ab5 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",